Skip to content

Commit 38b1ee4

Browse files
committed
tests: decoding: Follow the cut off change
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent c3d4095 commit 38b1ee4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/decoding.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@
3232

3333
#include "cmt_tests.h"
3434

35-
static struct cmt *generate_encoder_test_data()
35+
static struct cmt *generate_encoder_test_data_with_timestamp(uint64_t ts)
3636
{
3737
double quantiles[5];
3838
struct cmt_histogram_buckets *buckets;
3939
double val;
4040
struct cmt *cmt;
41-
uint64_t ts;
4241
struct cmt_gauge *g1;
4342
struct cmt_counter *c1;
4443
struct cmt_summary *s1;
4544
struct cmt_histogram *h1;
4645

47-
ts = 0;
4846
cmt = cmt_create();
4947

5048
c1 = cmt_counter_create(cmt, "kubernetes", "network", "load_counter", "Network load counter",
@@ -124,6 +122,14 @@ static struct cmt *generate_encoder_test_data()
124122
return cmt;
125123
}
126124

125+
static struct cmt *generate_encoder_test_data_now()
126+
{
127+
uint64_t ts = 0;
128+
ts = cfl_time_now();
129+
130+
return generate_encoder_test_data_with_timestamp(ts);
131+
}
132+
127133
void test_opentelemetry()
128134
{
129135
cfl_sds_t reference_prometheus_context;
@@ -139,7 +145,7 @@ void test_opentelemetry()
139145

140146
cmt_initialize();
141147

142-
cmt = generate_encoder_test_data();
148+
cmt = generate_encoder_test_data_now();
143149
TEST_CHECK(cmt != NULL);
144150

145151
reference_prometheus_context = cmt_encode_prometheus_create(cmt, CMT_TRUE);

0 commit comments

Comments
 (0)