diff options
author | LuK1337 <priv.luk@gmail.com> | 2024-05-26 13:18:30 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-05-26 14:03:04 +0200 |
commit | 14187b38342987fa83b90039973d25ffa452870a (patch) | |
tree | 13a009ab315006c0ae4842da4a5304abc694d3d3 | |
parent | 9bd1ea1e5eb06a70ee907c1a10fc0316e0c740ba (diff) | |
download | weechat-14187b38342987fa83b90039973d25ffa452870a.zip |
tests: relay: fix HotlistToJson test on s390x
1: error: Failure in TEST(RelayApiMsg, HotlistToJson)
1: expected <2024-05-26T10:29:37.716512Z>
1: but was <2024-05-26T10:29:37.000000Z>
1: difference starts at position 20 at: <T10:29:37.000000Z >
-rw-r--r-- | tests/unit/plugins/relay/api/test-relay-api-msg.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unit/plugins/relay/api/test-relay-api-msg.cpp b/tests/unit/plugins/relay/api/test-relay-api-msg.cpp index 696bf1fc8..ffa6945c4 100644 --- a/tests/unit/plugins/relay/api/test-relay-api-msg.cpp +++ b/tests/unit/plugins/relay/api/test-relay-api-msg.cpp @@ -26,6 +26,7 @@ extern "C" #include <time.h> #include <sys/time.h> #include <cjson/cJSON.h> +#include "src/core/core-hdata.h" #include "src/core/core-util.h" #include "src/gui/gui-buffer.h" #include "src/gui/gui-chat.h" @@ -502,6 +503,7 @@ TEST(RelayApiMsg, HotlistToJson) { char str_date[128]; cJSON *json, *json_obj, *json_count; + time_t time_value; struct timeval tv; struct tm gm_time; @@ -526,9 +528,10 @@ TEST(RelayApiMsg, HotlistToJson) CHECK(json); CHECK(cJSON_IsObject (json)); WEE_CHECK_OBJ_NUM(GUI_HOTLIST_HIGHLIGHT, json, "priority"); - gmtime_r (&(gui_hotlist->creation_time.tv_sec), &gm_time); + time_value = hdata_time (relay_hdata_hotlist, gui_hotlist, "time"); + gmtime_r (&time_value, &gm_time); tv.tv_sec = mktime (&gm_time); - tv.tv_usec = gui_hotlist->creation_time.tv_usec; + tv.tv_usec = hdata_integer (relay_hdata_hotlist, gui_hotlist, "time_usec"); util_strftimeval (str_date, sizeof (str_date), "%FT%T.%fZ", &tv); WEE_CHECK_OBJ_STR(str_date, json, "date"); WEE_CHECK_OBJ_NUM(gui_buffers->id, json, "buffer_id"); |