]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test/unit: follow chrony function naming convention
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 15 Feb 2016 12:13:13 +0000 (13:13 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 15 Feb 2016 15:09:05 +0000 (16:09 +0100)
test/unit/addrfilt.c
test/unit/clientlog.c
test/unit/ntp_sources.c
test/unit/test.c
test/unit/test.h

index fec45e3826ef93c384ae7f41987d2e82d95c85b4..3a21671d42f08f75cd9aea99aabdeafbaf172e48 100644 (file)
@@ -36,10 +36,10 @@ test_unit(void)
     for (j = 0; j < 1000; j++) {
       if (j % 2) {
         maxsub = 32;
-        get_random_address(&ip, IPADDR_INET4, -1);
+        TST_GetRandomAddress(&ip, IPADDR_INET4, -1);
       } else {
         maxsub = 128;
-        get_random_address(&ip, IPADDR_INET6, -1);
+        TST_GetRandomAddress(&ip, IPADDR_INET6, -1);
       }
 
       DEBUG_LOG(0, "address %s", UTI_IPToString(&ip));
@@ -51,16 +51,16 @@ test_unit(void)
       TEST_CHECK(ADF_IsAllowed(table, &ip));
 
       if (sub < maxsub) {
-        swap_address_bit(&ip, sub);
+        TST_SwapAddressBit(&ip, sub);
         TEST_CHECK(ADF_IsAllowed(table, &ip));
       }
 
       if (sub > 0) {
-        swap_address_bit(&ip, sub - 1);
+        TST_SwapAddressBit(&ip, sub - 1);
         TEST_CHECK(!ADF_IsAllowed(table, &ip));
         if (sub % 4 != 1) {
           ADF_Deny(table, &ip, sub - 1);
-          swap_address_bit(&ip, sub - 1);
+          TST_SwapAddressBit(&ip, sub - 1);
           TEST_CHECK(!ADF_IsAllowed(table, &ip));
         }
       }
index 2dda992b4783858f1df0dc8d00ad082fb491daf9..85e7f19195630d6c3585077397e906b4e1f74061 100644 (file)
@@ -48,7 +48,7 @@ test_unit(void)
     tv.tv_usec = 0;
 
     for (j = 0; j < 1000; j++) {
-      get_random_address(&ip, IPADDR_UNSPEC, i % 8 ? -1 : i / 8 % 9);
+      TST_GetRandomAddress(&ip, IPADDR_UNSPEC, i % 8 ? -1 : i / 8 % 9);
       DEBUG_LOG(0, "address %s", UTI_IPToString(&ip));
 
       if (random() % 2) {
index c16d5aeb82685d0219075454da230f8a57c7010a..40df9d3777cca192aee0e0d543fa0431246fe4fc 100644 (file)
@@ -51,7 +51,7 @@ test_unit(void)
 
     for (j = 0; j < sizeof (addrs) / sizeof (addrs[0]); j++) {
       do {
-        get_random_address(&addrs[j].ip_addr, IPADDR_UNSPEC, -1);
+        TST_GetRandomAddress(&addrs[j].ip_addr, IPADDR_UNSPEC, -1);
       } while (UTI_IPToHash(&addrs[j].ip_addr) % (1U << i) != hash % (1U << i));
 
       addrs[j].port = random() % 1024;
index 1a7bc4a7850362793429461ed6841a1684e59a57..3a1103301c761a414324cdbe130668da50a90d5a 100644 (file)
@@ -25,7 +25,7 @@
 #include "test.h"
 
 void
-test_fail(int line)
+TST_Fail(int line)
 {
   printf("FAIL (on line %d)\n", line);
   exit(1);
@@ -69,7 +69,7 @@ main(int argc, char **argv)
 }
 
 void
-get_random_address(IPAddr *ip, int family, int bits)
+TST_GetRandomAddress(IPAddr *ip, int family, int bits)
 {
   if (family != IPADDR_INET4 && family != IPADDR_INET6)
     family = random() % 2 ? IPADDR_INET4 : IPADDR_INET6;
@@ -104,7 +104,7 @@ get_random_address(IPAddr *ip, int family, int bits)
 }
 
 void
-swap_address_bit(IPAddr *ip, unsigned int b)
+TST_SwapAddressBit(IPAddr *ip, unsigned int b)
 {
   if (ip->family == IPADDR_INET4) {
     assert(b < 32);
index d1e83cb84e109f4d290c59601a4a0a88d0f5fafa..e736e27458b317c6fbb14f6aa2b095525b94fb21 100644 (file)
@@ -28,14 +28,14 @@ extern void test_unit(void);
 #define TEST_CHECK(expr) \
   do { \
     if (!(expr)) { \
-      test_fail(__LINE__); \
+      TST_Fail(__LINE__); \
       exit(1); \
     } \
   } while (0)
 
-extern void test_fail(int line);
+extern void TST_Fail(int line);
 
-extern void get_random_address(IPAddr *ip, int family, int bits);
-extern void swap_address_bit(IPAddr *ip, unsigned int b);
+extern void TST_GetRandomAddress(IPAddr *ip, int family, int bits);
+extern void TST_SwapAddressBit(IPAddr *ip, unsigned int b);
 
 #endif