2 * Copyright (C) 2020 EfficiOS, inc.
4 * SPDX-License-Identifier: GPL-2.0-only
9 #include <common/buffer-view.h>
12 static const int TEST_COUNT
= 5;
15 int lttng_opt_quiet
= 1;
16 int lttng_opt_verbose
;
19 static void test_contains_string(void)
21 const char buf
[] = {'A', 'l', 'l', 'o', '\0'};
22 struct lttng_buffer_view view
= lttng_buffer_view_init(buf
, 0, 5);
23 struct lttng_buffer_view view_minus_one
=
24 lttng_buffer_view_init(buf
, 0, 4);
26 ok1(!lttng_buffer_view_contains_string(&view
, buf
, 4));
27 ok1(lttng_buffer_view_contains_string(&view
, buf
, 5));
28 ok1(!lttng_buffer_view_contains_string(&view
, buf
, 6));
30 ok1(!lttng_buffer_view_contains_string(&view_minus_one
, buf
, 4));
31 ok1(!lttng_buffer_view_contains_string(&view_minus_one
, buf
, 5));
36 plan_tests(TEST_COUNT
);
38 test_contains_string();