From 086701e7dea1578de85dfdcc88cdfa6dca1c4169 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Mon, 13 Sep 2021 22:51:00 +0800 Subject: [PATCH] Move `pt` UTC timezone tests out of `archos/` (#1668) * Move `pt` UTC timezone tests out of `archos/` * Do Windows hack if `__OpenBSD__` --- librz/util/time.c | 8 +- test/db/archos/windows-x64/cmd_pt | 149 ----------------------------- test/db/cmd/cmd_pt | 151 +++++++++++++++++++++++++++++- 3 files changed, 154 insertions(+), 154 deletions(-) delete mode 100644 test/db/archos/windows-x64/cmd_pt diff --git a/librz/util/time.c b/librz/util/time.c index cc6c88f488..1eea92d083 100644 --- a/librz/util/time.c +++ b/librz/util/time.c @@ -53,9 +53,9 @@ RZ_API char *rz_time_stamp_to_str(ut32 timeStamp) { time_t ts = (time_t)timeStamp; struct tm time; rz_gmtime_r(&ts, &time); -#if __WINDOWS__ - // Hack on Windows to prevent mktime() from returning -1 when the - // timestamp is close to 0. +#if __WINDOWS__ || __OpenBSD__ + // Hack on Windows and OpenBSD so that mktime() returns proper values + // when the timestamp is close to 0. bool advance_1_day = false; if (time.tm_mday == 1 && time.tm_mon == 0 && time.tm_year == 70) { time.tm_mday++; @@ -64,7 +64,7 @@ RZ_API char *rz_time_stamp_to_str(ut32 timeStamp) { #endif time_t gmt_time = mktime(&time); rz_localtime_r(&ts, &time); -#if __WINDOWS__ +#if __WINDOWS__ || __OpenBSD__ if (advance_1_day) { time.tm_mday++; } diff --git a/test/db/archos/windows-x64/cmd_pt b/test/db/archos/windows-x64/cmd_pt deleted file mode 100644 index 8dac135b2c..0000000000 --- a/test/db/archos/windows-x64/cmd_pt +++ /dev/null @@ -1,149 +0,0 @@ -NAME=pt print unix epoch time (UTC+7:30) -FILE=-- -CMDS=<