blob: 38a7239eb3a5ee6d5ab8af55676351cccf259363 [file] [log] [blame]
Michal Vasko004d3152020-06-11 19:59:22 +02001/**
Radek Krejci1f05b6a2019-07-18 16:15:06 +02002 * @file test_tree_schema.c
3 * @author: Radek Krejci <rkrejci@cesnet.cz>
4 * @brief unit tests for functions from tress_data.c
5 *
6 * Copyright (c) 2018-2019 CESNET, z.s.p.o.
7 *
8 * This source code is licensed under BSD 3-Clause License (the "License").
9 * You may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * https://opensource.org/licenses/BSD-3-Clause
13 */
14
15#include <stdarg.h>
16#include <stddef.h>
17#include <stdio.h>
18#include <setjmp.h>
19#include <cmocka.h>
20
Radek Krejci70593c12020-06-13 20:48:09 +020021#include "libyang.h"
Michal Vasko38c2ba72020-07-27 14:46:59 +020022#include "common.h"
23#include "path.h"
24#include "xpath.h"
Radek Krejci1f05b6a2019-07-18 16:15:06 +020025
26#define BUFSIZE 1024
27char logbuf[BUFSIZE] = {0};
28int store = -1; /* negative for infinite logging, positive for limited logging */
29
30struct ly_ctx *ctx; /* context for tests */
31
32/* set to 0 to printing error messages to stderr instead of checking them in code */
33#define ENABLE_LOGGER_CHECKING 1
34
35#if ENABLE_LOGGER_CHECKING
36static void
37logger(LY_LOG_LEVEL level, const char *msg, const char *path)
38{
39 (void) level; /* unused */
40 if (store) {
41 if (path && path[0]) {
42 snprintf(logbuf, BUFSIZE - 1, "%s %s", msg, path);
43 } else {
44 strncpy(logbuf, msg, BUFSIZE - 1);
45 }
46 if (store > 0) {
47 --store;
48 }
49 }
50}
51#endif
52
53static int
54setup(void **state)
55{
56 (void) state; /* unused */
57
58 const char *schema_a = "module a {namespace urn:tests:a;prefix a;yang-version 1.1;"
59 "list l1 { key \"a b\"; leaf a {type string;} leaf b {type string;} leaf c {type string;}}"
60 "leaf foo { type string;}"
61 "leaf-list ll { type string;}"
62 "container c {leaf-list x {type string;}}"
63 "anydata any {config false;}"
Michal Vasko38c2ba72020-07-27 14:46:59 +020064 "list l2 {config false;"
65 "container c{leaf x {type string;} leaf-list d {type string;}}"
66 "}}";
Radek Krejci1f05b6a2019-07-18 16:15:06 +020067
68#if ENABLE_LOGGER_CHECKING
69 ly_set_log_clb(logger, 1);
70#endif
71
72 assert_int_equal(LY_SUCCESS, ly_ctx_new(NULL, 0, &ctx));
Michal Vasko3a41dff2020-07-15 14:30:28 +020073 assert_int_equal(LY_SUCCESS, lys_parse_mem(ctx, schema_a, LYS_IN_YANG, NULL));
Radek Krejci1f05b6a2019-07-18 16:15:06 +020074
75 return 0;
76}
77
78static int
79teardown(void **state)
80{
81#if ENABLE_LOGGER_CHECKING
82 if (*state) {
83 fprintf(stderr, "%s\n", logbuf);
84 }
85#else
86 (void) state; /* unused */
87#endif
88
89 ly_ctx_destroy(ctx, NULL);
90 ctx = NULL;
91
92 return 0;
93}
94
95void
96logbuf_clean(void)
97{
98 logbuf[0] = '\0';
99}
100
101#if ENABLE_LOGGER_CHECKING
102# define logbuf_assert(str) assert_string_equal(logbuf, str)
103#else
104# define logbuf_assert(str)
105#endif
106
107static void
108test_compare(void **state)
109{
110 *state = test_compare;
111
112 struct lyd_node *tree1, *tree2;
113
114 const char *data1 = "<l1 xmlns=\"urn:tests:a\"><a>a</a><b>b</b><c>x</c></l1>";
115 const char *data2 = "<l1 xmlns=\"urn:tests:a\"><a>a</a><b>b</b><c>y</c></l1>";
116
Michal Vasko8f359bf2020-07-28 10:41:15 +0200117 assert_int_equal(LY_SUCCESS, lyd_compare_single(NULL, NULL, 0));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200118
Radek Krejci7931b192020-06-25 17:05:03 +0200119 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data1, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
120 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data2, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200121 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, 0));
122 assert_int_equal(LY_ENOT, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
123 assert_int_equal(LY_ENOT, lyd_compare_single(((struct lyd_node_inner*)tree1)->child, tree2, 0));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200124 lyd_free_all(tree1);
125 lyd_free_all(tree2);
126
127 data1 = "<l2 xmlns=\"urn:tests:a\"><c><x>a</x></c></l2><l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
128 data2 = "<l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
Radek Krejci7931b192020-06-25 17:05:03 +0200129 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data1, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
130 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data2, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200131 assert_int_equal(LY_ENOT, lyd_compare_single(tree1, tree2, 0));
132 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1->next, tree2, 0));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200133 lyd_free_all(tree1);
134 lyd_free_all(tree2);
135
136 data1 = "<ll xmlns=\"urn:tests:a\">a</ll><ll xmlns=\"urn:tests:a\">b</ll>";
137 data2 = "<ll xmlns=\"urn:tests:a\">b</ll>";
Radek Krejci7931b192020-06-25 17:05:03 +0200138 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data1, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
139 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data2, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200140 assert_int_equal(LY_ENOT, lyd_compare_single(tree1, tree2, 0));
141 assert_int_equal(LY_ENOT, lyd_compare_single(NULL, tree2, 0));
142 assert_int_equal(LY_ENOT, lyd_compare_single(tree1, NULL, 0));
143 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1->next, tree2, 0));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200144 lyd_free_all(tree1);
145 lyd_free_all(tree2);
146
147 data1 = "<c xmlns=\"urn:tests:a\"><x>x</x></c>";
148 data2 = "<c xmlns=\"urn:tests:a\"><x>y</x></c>";
Radek Krejci7931b192020-06-25 17:05:03 +0200149 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data1, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
150 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data2, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200151 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, 0));
152 assert_int_equal(LY_ENOT, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200153 lyd_free_all(tree1);
154 lyd_free_all(tree2);
155
156 data1 = "<c xmlns=\"urn:tests:a\"><x>x</x></c>";
157 data2 = "<c xmlns=\"urn:tests:a\"><x>x</x><x>y</x></c>";
Radek Krejci7931b192020-06-25 17:05:03 +0200158 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data1, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
159 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data2, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200160 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, 0));
161 assert_int_equal(LY_ENOT, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200162 lyd_free_all(tree1);
163 lyd_free_all(tree2);
164
165 data1 = "<any xmlns=\"urn:tests:a\"><x>x</x></any>";
166 data2 = "<any xmlns=\"urn:tests:a\"><x>x</x><x>y</x></any>";
Radek Krejci7931b192020-06-25 17:05:03 +0200167 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data1, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
168 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data2, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200169 assert_int_equal(LY_ENOT, lyd_compare_single(tree1, tree2, 0));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200170 lyd_free_all(tree1);
171 data1 = "<any xmlns=\"urn:tests:a\"><x>x</x><x>y</x></any>";
Radek Krejci7931b192020-06-25 17:05:03 +0200172 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data1, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200173 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, 0));
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200174 lyd_free_all(tree1);
175 lyd_free_all(tree2);
176
177 *state = NULL;
178}
179
Radek Krejci22ebdba2019-07-25 13:59:43 +0200180static void
181test_dup(void **state)
182{
183 *state = test_dup;
184
185 struct lyd_node *tree1, *tree2;
186 const char *result;
187 const char *data = "<l1 xmlns=\"urn:tests:a\"><a>a</a><b>b</b><c>x</c></l1>";
188
Radek Krejci7931b192020-06-25 17:05:03 +0200189 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200190 assert_int_equal(LY_SUCCESS, lyd_dup_single(tree1, NULL, LYD_DUP_RECURSIVE, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200191 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200192 lyd_free_all(tree1);
193 lyd_free_all(tree2);
194
195 data = "<l1 xmlns=\"urn:tests:a\"><a>a</a><b>b</b><c>x</c></l1>";
196 result = "<l1 xmlns=\"urn:tests:a\"><a>a</a><b>b</b></l1>";
Radek Krejci7931b192020-06-25 17:05:03 +0200197 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200198 assert_int_equal(LY_SUCCESS, lyd_dup_single(tree1, NULL, 0, &tree2));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200199 lyd_free_all(tree1);
Radek Krejci7931b192020-06-25 17:05:03 +0200200 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, result, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200201 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200202 lyd_free_all(tree1);
203 lyd_free_all(tree2);
204
205 data = "<l2 xmlns=\"urn:tests:a\"><c><x>a</x></c></l2><l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
206 result = "<l2 xmlns=\"urn:tests:a\"><c><x>a</x></c></l2>";
Radek Krejci7931b192020-06-25 17:05:03 +0200207 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200208 assert_int_equal(LY_SUCCESS, lyd_dup_siblings(tree1, NULL, LYD_DUP_RECURSIVE, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200209 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200210 lyd_free_all(tree2);
Michal Vasko3a41dff2020-07-15 14:30:28 +0200211 assert_int_equal(LY_SUCCESS, lyd_dup_single(tree1, NULL, LYD_DUP_RECURSIVE, &tree2));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200212 lyd_free_all(tree1);
Radek Krejci7931b192020-06-25 17:05:03 +0200213 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, result, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200214 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200215 lyd_free_all(tree2);
216
Michal Vasko3a41dff2020-07-15 14:30:28 +0200217 assert_int_equal(LY_SUCCESS, lyd_dup_single(tree1, NULL, 0, &tree2));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200218 lyd_free_all(tree1);
219 result = "<l2 xmlns=\"urn:tests:a\"/>";
Radek Krejci7931b192020-06-25 17:05:03 +0200220 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, result, LYD_XML, LYD_PARSE_ONLY, 0, &tree1));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200221 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200222 lyd_free_all(tree1);
223 lyd_free_all(tree2);
224
225 data = "<any xmlns=\"urn:tests:a\"><c><a>a</a></c></any>";
Radek Krejci7931b192020-06-25 17:05:03 +0200226 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200227 assert_int_equal(LY_SUCCESS, lyd_dup_single(tree1, NULL, 0, &tree2));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200228 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200229 lyd_free_all(tree1);
230 lyd_free_all(tree2);
231
232 data = "<l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
Radek Krejci7931b192020-06-25 17:05:03 +0200233 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200234 assert_int_equal(LY_SUCCESS, lyd_dup_single(((struct lyd_node_inner*)((struct lyd_node_inner*)tree1)->child)->child, NULL,
235 LYD_DUP_WITH_PARENTS, &tree2));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200236 assert_string_equal("x", tree2->schema->name);
237 assert_non_null(tree2->parent);
Michal Vasko8f359bf2020-07-28 10:41:15 +0200238 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, (struct lyd_node*)tree2->parent->parent, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200239 lyd_free_all(tree1);
240 lyd_free_all(tree2);
241
242 data = "<l1 xmlns=\"urn:tests:a\"><a>a</a><b>b</b><c>c</c></l1>";
Radek Krejci7931b192020-06-25 17:05:03 +0200243 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200244 assert_int_equal(LY_SUCCESS, lyd_dup_single(((struct lyd_node_inner*)tree1)->child->prev, NULL,
245 LYD_DUP_WITH_PARENTS, &tree2));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200246 assert_string_equal("c", tree2->schema->name);
247 assert_non_null(tree2->parent);
Michal Vasko8f359bf2020-07-28 10:41:15 +0200248 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, (struct lyd_node*)tree2->parent, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200249 lyd_free_all(tree1);
250 lyd_free_all(tree2);
251
252 data = "<l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
Radek Krejci7931b192020-06-25 17:05:03 +0200253 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200254 assert_int_equal(LY_SUCCESS, lyd_dup_single(tree1, NULL, 0, &tree2));
255 assert_int_equal(LY_SUCCESS, lyd_dup_single(((struct lyd_node_inner*)((struct lyd_node_inner*)tree1)->child)->child,
256 (struct lyd_node_inner*)tree2, LYD_DUP_WITH_PARENTS, NULL));
Michal Vasko8f359bf2020-07-28 10:41:15 +0200257 assert_int_equal(LY_SUCCESS, lyd_compare_single(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200258 lyd_free_all(tree1);
259 lyd_free_all(tree2);
260
261 /* invalid */
262 data = "<l1 xmlns=\"urn:tests:a\"><a>a</a><b>b</b><c>c</c></l1><l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
Radek Krejci7931b192020-06-25 17:05:03 +0200263 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree1));
Michal Vasko3a41dff2020-07-15 14:30:28 +0200264 assert_int_equal(LY_EINVAL, lyd_dup_single(((struct lyd_node_inner*)tree1)->child->prev,
265 (struct lyd_node_inner*)tree1->next, LYD_DUP_WITH_PARENTS, NULL));
Radek Krejci22ebdba2019-07-25 13:59:43 +0200266 lyd_free_all(tree1);
267
268 *state = NULL;
269}
270
Michal Vasko38c2ba72020-07-27 14:46:59 +0200271static void
272test_target(void **state)
273{
274 *state = test_target;
275
276 const struct lyd_node_term *term;
277 struct lyd_node *tree;
278 struct lyxp_expr *exp;
279 struct ly_path *path;
280 const char *path_str = "/a:l2[2]/c/d[3]", *val;
281 int dynamic;
282 const char *data =
283 "<l2 xmlns=\"urn:tests:a\"><c>"
284 "<d>a</d>"
285 "</c></l2>"
286 "<l2 xmlns=\"urn:tests:a\"><c>"
287 "<d>a</d>"
288 "<d>b</d>"
289 "<d>b</d>"
290 "<d>c</d>"
291 "</c></l2>"
292 "<l2 xmlns=\"urn:tests:a\"><c>"
293 "</c></l2>";
294
295 assert_int_equal(LY_SUCCESS, lyd_parse_data_mem(ctx, data, LYD_XML, 0, LYD_VALIDATE_PRESENT, &tree));
296 assert_int_equal(LY_SUCCESS, ly_path_parse(ctx, NULL, path_str, strlen(path_str), LY_PATH_BEGIN_EITHER, LY_PATH_LREF_FALSE,
297 LY_PATH_PREFIX_OPTIONAL, LY_PATH_PRED_SIMPLE, &exp));
298 assert_int_equal(LY_SUCCESS, ly_path_compile(ctx, NULL, NULL, exp, LY_PATH_LREF_FALSE, LY_PATH_OPER_INPUT,
Michal Vaskoc8a230d2020-08-14 12:17:10 +0200299 LY_PATH_TARGET_SINGLE, LY_PREF_JSON, NULL, &path));
Michal Vasko38c2ba72020-07-27 14:46:59 +0200300 term = lyd_target(path, tree);
301
302 assert_string_equal(term->schema->name, "d");
303 val = lyd_value2str(term, &dynamic);
304 assert_int_equal(dynamic, 0);
305 assert_string_equal(val, "b");
306 val = lyd_value2str((struct lyd_node_term *)term->prev, &dynamic);
307 assert_int_equal(dynamic, 0);
308 assert_string_equal(val, "b");
309
310 lyd_free_all(tree);
311 ly_path_free(ctx, path);
312 lyxp_expr_free(ctx, exp);
313
314 *state = NULL;
315}
316
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200317int main(void)
318{
319 const struct CMUnitTest tests[] = {
320 cmocka_unit_test_setup_teardown(test_compare, setup, teardown),
Radek Krejci22ebdba2019-07-25 13:59:43 +0200321 cmocka_unit_test_setup_teardown(test_dup, setup, teardown),
Michal Vasko38c2ba72020-07-27 14:46:59 +0200322 cmocka_unit_test_setup_teardown(test_target, setup, teardown),
Radek Krejci1f05b6a2019-07-18 16:15:06 +0200323 };
324
325 return cmocka_run_group_tests(tests, NULL, NULL);
326}