tests: internal: gelf: adjust test case for expected records and timestamp
#include "flb_tests_internal.h"
#include <string.h>
-#define EXPECTED_OUT "{\"version\":\"1.1\", \"short_message\":\"true, 2019, str\", \"timestamp\":337647600.000000}"
+#define EXPECTED_OUT \
+ "{\"version\":\"1.1\", \"short_message\":\"true, 2019, str\", \"_t2\":\"false\", \"timestamp\":337647600.1234}"
void test_gelf_pack()
{
@@ -23,10 +24,9 @@ void test_gelf_pack()
msgpack_sbuffer_init(&mp_sbuf);
msgpack_packer_init(&mp_pck, &mp_sbuf, msgpack_sbuffer_write);
- msgpack_pack_array(&mp_pck, 2);
- flb_time_from_double(&ts, 337647600.0);
- flb_time_append_to_msgpack(&ts, &mp_pck, 0);
+ ts.tm.tv_sec = 337647600;
+ ts.tm.tv_nsec = 1234111111;
msgpack_pack_map(&mp_pck, 2);
msgpack_pack_str(&mp_pck, 2);
@@ -45,7 +45,6 @@ void test_gelf_pack()
TEST_CHECK(out != NULL);
TEST_CHECK(strcmp(out, EXPECTED_OUT) == 0);
- printf("%s", out);
flb_sds_destroy(out);
flb_sds_destroy(fields.short_message_key);
msgpack_sbuffer_destroy(&mp_sbuf);
