1a7374c956
RTE_PTR_SUB(ptr, x) and RTE_PTR_ALIGN_FLOOR() worked incorrectly
if "ptr" was an expression:
uint32_t arr[3];
RTE_PTR_SUB(arr + 1, sizeof(arr[0]));
// expected: (uint32_t *)((uintptr_t)(arr + 1) - 4) == arr
// actual: (uint32_t *)((uintptr_t) arr + 1 - 4) != arr
RTE_PTR_ALIGN_FLOOR(arr + 2, sizeof(arr[0]));
// expected: RTE_ALIGN_FLOOR((uintptr_t)(arr + 2), 4) == &arr[2]
// actual: RTE_ALIGN_FLOOR((uintptr_t) arr + 2, 4) == &arr[0]
Fix the macros and extend the relevant unit test.
Convert uses of a custom test failure macro to RTE_TEST_ASSERT*().
Fixes:
|
||
---|---|---|
.. | ||
arm | ||
common | ||
freebsd | ||
include | ||
linux | ||
ppc | ||
riscv | ||
unix | ||
windows | ||
x86 | ||
meson.build | ||
version.map |