]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-time-util: use standard intro and print timezones read from file 11856/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Feb 2019 14:38:16 +0000 (15:38 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Feb 2019 14:38:52 +0000 (15:38 +0100)
The asserts are OK, but it's also nice to see the list by eye.

src/test/test-time-util.c

index 633544ff2e1d7de04aa4fd9140d161ff78261265..d05bb614290e1ff9479b725f4ed23bb37adbee49 100644 (file)
@@ -4,6 +4,7 @@
 #include "serialize.h"
 #include "string-util.h"
 #include "strv.h"
+#include "tests.h"
 #include "time-util.h"
 
 static void test_parse_sec(void) {
@@ -260,8 +261,10 @@ static void test_get_timezones(void) {
         r = get_timezones(&zones);
         assert_se(r == 0);
 
-        STRV_FOREACH(zone, zones)
+        STRV_FOREACH(zone, zones) {
+                log_info("zone: %s", *zone);
                 assert_se(timezone_is_valid(*zone, LOG_ERR));
+        }
 }
 
 static void test_usec_add(void) {
@@ -481,7 +484,7 @@ static void test_in_utc_timezone(void) {
 }
 
 int main(int argc, char *argv[]) {
-        uintmax_t x;
+        test_setup_logging(LOG_INFO);
 
         log_info("realtime=" USEC_FMT "\n"
                  "monotonic=" USEC_FMT "\n"
@@ -513,7 +516,7 @@ int main(int argc, char *argv[]) {
         assert_cc((time_t) -1 < (time_t) 1);
 
         /* Ensure TIME_T_MAX works correctly */
-        x = (uintmax_t) TIME_T_MAX;
+        uintmax_t x = TIME_T_MAX;
         x++;
         assert((time_t) x < 0);