]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-macro: use capital test names for macro tests
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 26 Nov 2023 14:54:11 +0000 (15:54 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 2 Dec 2023 08:47:11 +0000 (09:47 +0100)
It's just easier if the test is named as the thing being tested. Also, this way
inconsistent, because lower in the file uppercase test names are used.

src/test/test-macro.c

index 63fe6ea95e76bdb7fdb6505338150453a660a06e..b91a1f96ac71b5b9b86eda8a76982569e8d4e2a3 100644 (file)
@@ -15,7 +15,7 @@ TEST(saturate_add) {
         assert_se(saturate_add(60, 60, 50) == 50);
 }
 
-TEST(align_power2) {
+TEST(ALIGN_POWER2) {
         unsigned long i, p2;
 
         assert_se(ALIGN_POWER2(0) == 0);
@@ -57,7 +57,7 @@ TEST(align_power2) {
         }
 }
 
-TEST(max) {
+TEST(MAX) {
         static const struct {
                 int a;
                 int b[CONST_MAX(10, 100)];
@@ -159,7 +159,7 @@ TEST(container_of) {
 
 #pragma GCC diagnostic pop
 
-TEST(div_round_up) {
+TEST(DIV_ROUND_UP) {
         int div;
 
         /* basic tests */
@@ -192,7 +192,7 @@ TEST(div_round_up) {
         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);
@@ -201,7 +201,7 @@ TEST(ptr_to_int) {
         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));
@@ -221,7 +221,7 @@ TEST(in_set) {
         assert_se(!IN_SET(t.x, 2, 3, 4));
 }
 
-TEST(foreach_pointer) {
+TEST(FOREACH_POINTER) {
         int a, b, c, *i;
         size_t k = 0;
 
@@ -300,7 +300,7 @@ TEST(foreach_pointer) {
         assert_se(k == 11);
 }
 
-TEST(foreach_va_args) {
+TEST(FOREACH_VA_ARGS) {
         size_t i;
 
         i = 0;
@@ -484,7 +484,7 @@ TEST(foreach_va_args) {
                 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);
@@ -1005,7 +1005,7 @@ TEST(FOREACH_ARRAY) {
                 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);