2 * Copyright 2020 EfficiOS, Inc.
4 * SPDX-License-Identifier: GPL-2.0-only
8 #include <common/bytecode/bytecode.hpp>
10 #include <lttng/event-expr-internal.hpp>
11 #include <lttng/event-expr.h>
17 static void test_event_payload_field()
19 struct lttng_event_expr
*event_expr
;
20 struct lttng_bytecode
*bytecode
= nullptr;
23 event_expr
= lttng_event_expr_event_payload_field_create("tourlou");
24 ret
= lttng_event_expr_to_bytecode(event_expr
, &bytecode
);
26 ok(ret
== 0, "event payload field");
28 lttng_event_expr_destroy(event_expr
);
32 static void test_channel_context_field()
34 struct lttng_event_expr
*event_expr
;
35 struct lttng_bytecode
*bytecode
= nullptr;
38 event_expr
= lttng_event_expr_channel_context_field_create("tourlou");
39 ret
= lttng_event_expr_to_bytecode(event_expr
, &bytecode
);
41 ok(ret
== 0, "channel context field");
43 lttng_event_expr_destroy(event_expr
);
47 static void test_app_specific_context_field()
49 struct lttng_event_expr
*event_expr
;
50 struct lttng_bytecode
*bytecode
= nullptr;
53 event_expr
= lttng_event_expr_app_specific_context_field_create("Bob", "Leponge");
54 ret
= lttng_event_expr_to_bytecode(event_expr
, &bytecode
);
56 ok(ret
== 0, "app-specific context field");
58 lttng_event_expr_destroy(event_expr
);
62 static void test_array_field_element()
64 struct lttng_event_expr
*event_expr
;
65 struct lttng_bytecode
*bytecode
= nullptr;
68 event_expr
= lttng_event_expr_event_payload_field_create("allo");
69 event_expr
= lttng_event_expr_array_field_element_create(event_expr
, 168);
70 ret
= lttng_event_expr_to_bytecode(event_expr
, &bytecode
);
72 ok(ret
== 0, "array field element");
74 lttng_event_expr_destroy(event_expr
);
82 test_event_payload_field();
83 test_channel_context_field();
84 test_app_specific_context_field();
85 test_array_field_element();
This page took 0.031407 seconds and 4 git commands to generate.