From c40847b833ee74a047e72f2a64a67a264f162bfd Mon Sep 17 00:00:00 2001 From: nirenjan Date: Sun, 28 Jun 2020 11:32:19 -0700 Subject: [PATCH] Add clock tests to verify PDT/PST/UTC --- lib/libx52/x52_tests.json | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/lib/libx52/x52_tests.json b/lib/libx52/x52_tests.json index 5d31a71..f7a576d 100644 --- a/lib/libx52/x52_tests.json +++ b/lib/libx52/x52_tests.json @@ -1974,6 +1974,55 @@ {"params": ["MMDDYY"], "output": [["00c4", "0102"], ["00c8", "0003"]]}, {"params": ["YYMMDD"], "output": [["00c4", "0203"], ["00c8", "0001"]]} ] + }, + "Clock": { + "function": "libx52_set_clock", + "setup_hook": [ + "putenv(\"TZ=America/Los_Angeles\");" + ], + "tests": [ + { + "_comment": "2020-06-01 15:04:05 PDT", + "params": ["1591049045", "1"], + "output": [ + ["00c4", "0601"], + ["00c8", "0014"], + ["00c0", "0f04"], + ["00c1", "01a4"], + ["00c2", "01a4"] + ] + }, + { + "_comment": "2020-06-01 22:04:05 UTC", + "params": ["1591049045", "0"], + "output": [ + ["00c4", "0601"], + ["00c8", "0014"], + ["00c0", "1604"] + ] + }, + + { + "_comment": "2020-03-01 15:04:05 PST", + "params": ["1583103845", "1"], + "output": [ + ["00c4", "0301"], + ["00c8", "0014"], + ["00c0", "0f04"], + ["00c1", "01e0"], + ["00c2", "01e0"] + ] + }, + { + "_comment": "2020-03-01 23:04:05 UTC", + "params": ["1583103845", "0"], + "output": [ + ["00c4", "0301"], + ["00c8", "0014"], + ["00c0", "1704"] + ] + } + ] } }