mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-22 22:03:43 +03:00
test-time-util: use standard intro and print timezones read from file
The asserts are OK, but it's also nice to see the list by eye.
This commit is contained in:
parent
781748af45
commit
f0e2e0db00
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user