]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: fix DEBUG_LOG use in unit tests
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 13 Mar 2017 10:54:32 +0000 (11:54 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 13 Mar 2017 11:04:26 +0000 (12:04 +0100)
This was missing in commit f282856c72b7e8904e70527210915e12e6ed7227.

test/unit/addrfilt.c
test/unit/clientlog.c
test/unit/hwclock.c
test/unit/keys.c
test/unit/ntp_core.c
test/unit/ntp_sources.c
test/unit/smooth.c
test/unit/sources.c

index 3a21671d42f08f75cd9aea99aabdeafbaf172e48..b2360736dc02731317622b7c96219734f3787a38 100644 (file)
@@ -42,7 +42,7 @@ test_unit(void)
         TST_GetRandomAddress(&ip, IPADDR_INET6, -1);
       }
 
-      DEBUG_LOG(0, "address %s", UTI_IPToString(&ip));
+      DEBUG_LOG("address %s", UTI_IPToString(&ip));
 
       sub = random() % (maxsub + 1);
 
index ee29936ad72fe5b9132829d2b3c7d32400ae8b7e..51f3c9da2cb8f2b40e5c764de2ebc2af7c8d3fe7 100644 (file)
@@ -42,14 +42,14 @@ test_unit(void)
   TEST_CHECK(ARR_GetSize(records) == 16);
 
   for (i = 0; i < 500; i++) {
-    DEBUG_LOG(0, "iteration %d", i);
+    DEBUG_LOG("iteration %d", i);
 
     ts.tv_sec = (time_t)random() & 0x0fffffff;
     ts.tv_nsec = 0;
 
     for (j = 0; j < 1000; j++) {
       TST_GetRandomAddress(&ip, IPADDR_UNSPEC, i % 8 ? -1 : i / 8 % 9);
-      DEBUG_LOG(0, "address %s", UTI_IPToString(&ip));
+      DEBUG_LOG("address %s", UTI_IPToString(&ip));
 
       if (random() % 2) {
         index = CLG_LogNTPAccess(&ip, &ts);
@@ -65,7 +65,7 @@ test_unit(void)
     }
   }
 
-  DEBUG_LOG(0, "records %d", ARR_GetSize(records));
+  DEBUG_LOG("records %d", ARR_GetSize(records));
   TEST_CHECK(ARR_GetSize(records) == 64);
 
   for (i = j = 0; i < 10000; i++) {
@@ -76,7 +76,7 @@ test_unit(void)
       j++;
   }
 
-  DEBUG_LOG(0, "requests %u responses %u", i, j);
+  DEBUG_LOG("requests %u responses %u", i, j);
   TEST_CHECK(j * 4 < i && j * 6 > i);
 
   CLG_Finalise();
index 5b2406a89dcec98f8859f0a468cb9ecdc5361d71..6f02ce04903d761eccbd3867749be9a6b7be20db 100644 (file)
@@ -39,7 +39,7 @@ test_unit(void)
     UTI_AddDoubleToTimespec(&start_hw_ts, TST_GetRandomDouble(0.0, 1e9), &start_hw_ts);
     UTI_AddDoubleToTimespec(&start_local_ts, TST_GetRandomDouble(0.0, 1e9), &start_local_ts);
 
-    DEBUG_LOG(0, "iteration %d", i);
+    DEBUG_LOG("iteration %d", i);
 
     freq = TST_GetRandomDouble(0.9, 1.1);
     jitter = TST_GetRandomDouble(10.0e-9, 1000.0e-9);
index 9743b036d91d98c2349dc08ff683f7fbdc639f69..264285f5904ea4ace4575b8bc34fc1253c13e01f 100644 (file)
@@ -98,7 +98,7 @@ test_unit(void)
   KEY_Initialise();
 
   for (i = 0; i < 100; i++) {
-    DEBUG_LOG(0, "iteration %d", i);
+    DEBUG_LOG("iteration %d", i);
 
     if (i) {
       generate_key_file(KEYFILE, keys);
index 40ca03b100ec49442efb8788dd6da9847cc29f6d..34a0682e7feeb4b3110962a9df56cbb36b7510c9 100644 (file)
@@ -249,7 +249,7 @@ test_unit(void)
     has_updated = 0;
 
     for (j = 0; j < 50; j++) {
-      DEBUG_LOG(0, "iteration %d, %d", i, j);
+      DEBUG_LOG("iteration %d, %d", i, j);
 
       interleaved = random() % 2;
       authenticated = random() % 2;
index f55612df2382c3c5be0d450e90d7db9d67c9ece9..f88d27a228862a424812b81f9c98994d0ab8582f 100644 (file)
@@ -47,7 +47,7 @@ test_unit(void)
   for (i = 0; i < 6; i++) {
     TEST_CHECK(ARR_GetSize(records) == 1);
 
-    DEBUG_LOG(0, "collision mod %u", 1U << i);
+    DEBUG_LOG("collision mod %u", 1U << i);
 
     for (j = 0; j < sizeof (addrs) / sizeof (addrs[0]); j++) {
       do {
@@ -59,7 +59,7 @@ test_unit(void)
       if (!j)
         hash = UTI_IPToHash(&addrs[j].ip_addr);
 
-      DEBUG_LOG(0, "adding source %s hash %"PRIu32, UTI_IPToString(&addrs[j].ip_addr),
+      DEBUG_LOG("adding source %s hash %"PRIu32, UTI_IPToString(&addrs[j].ip_addr),
                 UTI_IPToHash(&addrs[j].ip_addr) % (1U << i));
 
       NSR_AddSource(&addrs[j], random() % 2 ? NTP_SERVER : NTP_PEER, &params);
@@ -79,7 +79,7 @@ test_unit(void)
     }
 
     for (j = 0; j < sizeof (addrs) / sizeof (addrs[0]); j++) {
-      DEBUG_LOG(0, "removing source %s", UTI_IPToString(&addrs[j].ip_addr));
+      DEBUG_LOG("removing source %s", UTI_IPToString(&addrs[j].ip_addr));
       NSR_RemoveSource(&addrs[j]);
 
       for (k = 0; k < sizeof (addrs) / sizeof (addrs[0]); k++) {
index 0cc6a40d773c77b9dc24338a640f1b037ee6effe..772f07e0889e9fbf4f836ac938e9f63650da212f 100644 (file)
@@ -40,7 +40,7 @@ test_unit(void)
     UTI_ZeroTimespec(&ts);
     SMT_Reset(&ts);
 
-    DEBUG_LOG(0, "iteration %d", i);
+    DEBUG_LOG("iteration %d", i);
 
     offset = (random() % 1000000 - 500000) / 1.0e6;
     freq = (random() % 1000000 - 500000) / 1.0e9;
index 08ee20c2e53918888dbdfd5a34bf2d1972e0c5a9..c9f33241a3337280585fe933582cc080c63956f4 100644 (file)
@@ -41,7 +41,7 @@ test_unit(void)
   REF_SetMode(REF_ModeIgnore);
 
   for (i = 0; i < 1000; i++) {
-    DEBUG_LOG(0, "iteration %d", i);
+    DEBUG_LOG("iteration %d", i);
 
     for (j = 0; j < sizeof (srcs) / sizeof (srcs[0]); j++) {
       TEST_CHECK(n_sources == j);
@@ -51,7 +51,7 @@ test_unit(void)
       sel_options = i & random() & (SRC_SELECT_NOSELECT | SRC_SELECT_PREFER |
                                     SRC_SELECT_TRUST | SRC_SELECT_REQUIRE);
 
-      DEBUG_LOG(0, "added source %d options %d", j, sel_options);
+      DEBUG_LOG("added source %d options %d", j, sel_options);
       srcs[j] = SRC_CreateNewInstance(UTI_IPToRefid(&addr), SRC_NTP, sel_options, &addr,
                                          SRC_DEFAULT_MINSAMPLES, SRC_DEFAULT_MAXSAMPLES);
       SRC_UpdateReachability(srcs[j], 1);
@@ -68,7 +68,7 @@ test_unit(void)
         delay = TST_GetRandomDouble(1.0e-6, 1.0e-1);
         disp = TST_GetRandomDouble(1.0e-6, 1.0e-1);
 
-        DEBUG_LOG(0, "source %d sample %d offset %f delay %f disp %f", j, k,
+        DEBUG_LOG("source %d sample %d offset %f delay %f disp %f", j, k,
                   offset, delay, disp);
 
         SRC_AccumulateSample(srcs[j], &ts, offset, delay, disp, delay, disp,
@@ -81,7 +81,7 @@ test_unit(void)
         double passed_lo = DBL_MAX, passed_hi = DBL_MIN;
 
         SRC_SelectSource(srcs[k]);
-        DEBUG_LOG(0, "source %d status %d", k, sources[k]->status);
+        DEBUG_LOG("source %d status %d", k, sources[k]->status);
 
         for (l = 0; l <= j; l++) {
           TEST_CHECK(sources[l]->status > SRC_OK && sources[l]->status <= SRC_SELECTED);
@@ -114,7 +114,7 @@ test_unit(void)
           }
         }
 
-        DEBUG_LOG(0, "sources %d passed %d trusted %d/%d required %d/%d", j, passed,
+        DEBUG_LOG("sources %d passed %d trusted %d/%d required %d/%d", j, passed,
                   trusted_passed, trusted, required_passed, required);
 
         TEST_CHECK(!trusted || !passed || (passed_lo >= trusted_lo && passed_hi <= trusted_hi));