assert_se(saturate_add(60, 60, 50) == 50);
}
-TEST(align_power2) {
+TEST(ALIGN_POWER2) {
unsigned long i, p2;
assert_se(ALIGN_POWER2(0) == 0);
}
}
-TEST(max) {
+TEST(MAX) {
static const struct {
int a;
int b[CONST_MAX(10, 100)];
#pragma GCC diagnostic pop
-TEST(div_round_up) {
+TEST(DIV_ROUND_UP) {
int div;
/* basic tests */
assert_se(0xfffffffdU / 10U + !!(0xfffffffdU % 10U) == 429496730U);
}
-TEST(ptr_to_int) {
+TEST(PTR_TO_INT) {
/* Primary reason to have this test is to validate that pointers are large enough to hold entire int range */
assert_se(PTR_TO_INT(INT_TO_PTR(0)) == 0);
assert_se(PTR_TO_INT(INT_TO_PTR(1)) == 1);
assert_se(PTR_TO_INT(INT_TO_PTR(INT_MIN)) == INT_MIN);
}
-TEST(in_set) {
+TEST(IN_SET) {
assert_se(IN_SET(1, 1, 2));
assert_se(IN_SET(1, 1, 2, 3, 4));
assert_se(IN_SET(2, 1, 2, 3, 4));
assert_se(!IN_SET(t.x, 2, 3, 4));
}
-TEST(foreach_pointer) {
+TEST(FOREACH_POINTER) {
int a, b, c, *i;
size_t k = 0;
assert_se(k == 11);
}
-TEST(foreach_va_args) {
+TEST(FOREACH_VA_ARGS) {
size_t i;
i = 0;
assert_se(false);
}
-TEST(align_to) {
+TEST(ALIGN_TO) {
assert_se(ALIGN_TO(0, 1) == 0);
assert_se(ALIGN_TO(1, 1) == 1);
assert_se(ALIGN_TO(2, 1) == 2);
assert_se(ROUND_UP(x, y) == max_value); \
})
-TEST(round_up) {
+TEST(ROUND_UP) {
TEST_ROUND_UP_BY_TYPE(uint8_t, UINT8_MAX);
TEST_ROUND_UP_BY_TYPE(uint16_t, UINT16_MAX);
TEST_ROUND_UP_BY_TYPE(uint32_t, UINT32_MAX);