fae7eb26ebe214f567a37bdf12bcd0abbf49e73a
2 * Copyright 2020 EfficiOS, Inc.
4 * SPDX-License-Identifier: GPL-2.0-only
8 #include <common/bytecode/bytecode.h>
9 #include <lttng/event-expr-internal.h>
10 #include <lttng/event-expr.h>
16 void test_event_payload_field(void)
18 struct lttng_event_expr
*event_expr
;
19 struct lttng_bytecode
*bytecode
= NULL
;
22 event_expr
= lttng_event_expr_event_payload_field_create("tourlou");
23 ret
= lttng_event_expr_to_bytecode(event_expr
, &bytecode
);
25 ok(ret
== 0, "event payload field");
27 lttng_event_expr_destroy(event_expr
);
32 void test_channel_context_field(void)
34 struct lttng_event_expr
*event_expr
;
35 struct lttng_bytecode
*bytecode
= NULL
;
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
);
48 void test_app_specific_context_field(void)
50 struct lttng_event_expr
*event_expr
;
51 struct lttng_bytecode
*bytecode
= NULL
;
54 event_expr
= lttng_event_expr_app_specific_context_field_create("Bob", "Leponge");
55 ret
= lttng_event_expr_to_bytecode(event_expr
, &bytecode
);
57 ok(ret
== 0, "app-specific context field");
59 lttng_event_expr_destroy(event_expr
);
64 void test_array_field_element(void)
66 struct lttng_event_expr
*event_expr
;
67 struct lttng_bytecode
*bytecode
= NULL
;
70 event_expr
= lttng_event_expr_event_payload_field_create("allo");
71 event_expr
= lttng_event_expr_array_field_element_create(event_expr
, 168);
72 ret
= lttng_event_expr_to_bytecode(event_expr
, &bytecode
);
74 ok(ret
== 0, "array field element");
76 lttng_event_expr_destroy(event_expr
);
84 test_event_payload_field();
85 test_channel_context_field();
86 test_app_specific_context_field();
87 test_array_field_element();
This page took 0.034058 seconds and 3 git commands to generate.