2 * Copyright (C) 2020 EfficiOS, inc.
4 * SPDX-License-Identifier: GPL-2.0-only
8 #include <common/buffer-view.hpp>
12 static const int TEST_COUNT
= 5;
15 int lttng_opt_quiet
= 1;
16 int lttng_opt_verbose
;
19 static void test_contains_string()
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
= lttng_buffer_view_init(buf
, 0, 4);
25 ok1(!lttng_buffer_view_contains_string(&view
, buf
, 4));
26 ok1(lttng_buffer_view_contains_string(&view
, buf
, 5));
27 ok1(!lttng_buffer_view_contains_string(&view
, buf
, 6));
29 ok1(!lttng_buffer_view_contains_string(&view_minus_one
, buf
, 4));
30 ok1(!lttng_buffer_view_contains_string(&view_minus_one
, buf
, 5));
35 plan_tests(TEST_COUNT
);
37 test_contains_string();