diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-02-26 11:25:22 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-02-26 11:28:49 +0100 |
commit | 6369641d6f594557114b78fe740544ecf69a6d37 (patch) | |
tree | 9970181e381ca65c923bec9ef8ab711b705eb397 /src/basic/clock-util.h | |
parent | 06fb28b16eb4b6170c2e2c0cf1f673730309509b (diff) |
clock-util: make clock_is_localtime() testable and add initial tests
Add path argument to clock_is_localtime() and default to "/etc/adjtime" if it's
NULL. This makes the function testable.
Add test-clock: initial test cases for some scenarios, using a temporary file.
This also checks the behaviour with a NULL (i. e. the system's /etc/adjtime)
file.
Diffstat (limited to 'src/basic/clock-util.h')
-rw-r--r-- | src/basic/clock-util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/clock-util.h b/src/basic/clock-util.h index f471f2abcf..8830cd2f38 100644 --- a/src/basic/clock-util.h +++ b/src/basic/clock-util.h @@ -21,7 +21,7 @@ #include <time.h> -int clock_is_localtime(void); +int clock_is_localtime(const char* adjtime_path); int clock_set_timezone(int *min); int clock_reset_timewarp(void); int clock_get_hwclock(struct tm *tm); |