summaryrefslogtreecommitdiffstats
path: root/src/test/test-date.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/test/test-date.c
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-date.c')
-rw-r--r--src/test/test-date.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/test/test-date.c b/src/test/test-date.c
index 162ac34..c7d239e 100644
--- a/src/test/test-date.c
+++ b/src/test/test-date.c
@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <unistd.h>
+
#include "alloc-util.h"
#include "string-util.h"
#include "tests.h"
@@ -83,9 +85,11 @@ int main(int argc, char *argv[]) {
test_one("today");
test_one("tomorrow");
test_one_noutc("16:20 UTC");
- test_one_noutc("16:20 Asia/Seoul");
- test_one_noutc("tomorrow Asia/Seoul");
- test_one_noutc("2012-12-30 18:42 Asia/Seoul");
+ if (access("/usr/share/zoneinfo/Asia/Seoul", F_OK) >= 0) {
+ test_one_noutc("16:20 Asia/Seoul");
+ test_one_noutc("tomorrow Asia/Seoul");
+ test_one_noutc("2012-12-30 18:42 Asia/Seoul");
+ }
test_one_noutc("now");
test_one_noutc("+2d");
test_one_noutc("+2y 4d");
@@ -96,9 +100,11 @@ int main(int argc, char *argv[]) {
test_should_fail("1969-12-31 UTC");
test_should_fail("-1000y");
test_should_fail("today UTC UTC");
- test_should_fail("now Asia/Seoul");
- test_should_fail("+2d Asia/Seoul");
- test_should_fail("@1395716396 Asia/Seoul");
+ if (access("/usr/share/zoneinfo/Asia/Seoul", F_OK) >= 0) {
+ test_should_fail("now Asia/Seoul");
+ test_should_fail("+2d Asia/Seoul");
+ test_should_fail("@1395716396 Asia/Seoul");
+ }
#if SIZEOF_TIME_T == 8
test_should_pass("9999-12-30 23:59:59 UTC");
test_should_fail("9999-12-31 00:00:00 UTC");