]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-clock.c
test-process-util: add (void) cast to make coverity happy
[thirdparty/systemd.git] / src / test / test-clock.c
index 7d97328416b433ffa49382883c3d5d94e6bae4cc..11773cc180ca8c593c5d4055158b21de25787956 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -66,7 +67,7 @@ static void test_clock_is_localtime(void) {
                 log_info("%s", scenarios[i].contents);
                 rewind(f);
                 ftruncate(fd, 0);
-                assert_se(write_string_stream(f, scenarios[i].contents, false) == 0);
+                assert_se(write_string_stream(f, scenarios[i].contents, WRITE_STRING_FILE_AVOID_NEWLINE) == 0);
                 assert_se(clock_is_localtime(adjtime) == scenarios[i].expected_result);
         }
 
@@ -82,7 +83,7 @@ static void test_clock_is_localtime_system(void) {
                 log_info("/etc/adjtime exists, clock_is_localtime() == %i", r);
                 /* if /etc/adjtime exists we expect some answer, no error or
                  * crash */
-                assert_se(r == 0 || r == 1);
+                assert_se(IN_SET(r, 0, 1));
         } else
                 /* default is UTC if there is no /etc/adjtime */
                 assert_se(r == 0);