blob: d31ef4a6b3f22ab57539ee7e55e0484de298fec1 [file] [log] [blame]
David Sedlákb1ce3f82019-06-05 14:37:26 +02001/**
2 * @file test_parser_yin.c
3 * @author David Sedlák <xsedla1d@stud.fit.vutbr.cz>
4 * @brief unit tests for functions from parser_yin.c
5 *
6 * Copyright (c) 2015 - 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
David Sedlák3b4db242018-10-19 16:11:01 +020015#include <stdarg.h>
16#include <stddef.h>
17#include <setjmp.h>
18#include <cmocka.h>
19
20#include <stdio.h>
21#include <string.h>
David Sedlák79e50cb2019-06-05 16:33:09 +020022#include <stdbool.h>
David Sedlák3b4db242018-10-19 16:11:01 +020023
David Sedlákecf5eb82019-06-03 14:12:44 +020024#include "../../src/common.h"
25#include "../../src/tree_schema.h"
26#include "../../src/tree_schema_internal.h"
27#include "../../src/parser_yin.h"
David Sedlák8f5bce02019-06-03 16:41:08 +020028#include "../../src/xml.h"
David Sedlák3b4db242018-10-19 16:11:01 +020029
David Sedlák68a1af12019-03-08 13:46:54 +010030struct state {
David Sedlák3b4db242018-10-19 16:11:01 +020031 struct ly_ctx *ctx;
David Sedlák3017da42019-02-15 09:48:04 +010032 struct lys_module *mod;
David Sedlák8f5bce02019-06-03 16:41:08 +020033 struct lyxml_context *xml_ctx;
David Sedlák79e50cb2019-06-05 16:33:09 +020034 bool finished_correctly;
David Sedlák68a1af12019-03-08 13:46:54 +010035};
David Sedlák872c7b42018-10-26 13:15:20 +020036
David Sedlák79e50cb2019-06-05 16:33:09 +020037#define BUFSIZE 1024
38char logbuf[BUFSIZE] = {0};
39int store = -1; /* negative for infinite logging, positive for limited logging */
40
41/* set to 0 to printing error messages to stderr instead of checking them in code */
42#define ENABLE_LOGGER_CHECKING 1
43
44#if ENABLE_LOGGER_CHECKING
45static void
46logger(LY_LOG_LEVEL level, const char *msg, const char *path)
47{
48 (void) level; /* unused */
49 if (store) {
50 if (path && path[0]) {
51 snprintf(logbuf, BUFSIZE - 1, "%s %s", msg, path);
52 } else {
53 strncpy(logbuf, msg, BUFSIZE - 1);
54 }
55 if (store > 0) {
56 --store;
57 }
58 }
59}
60#endif
61
62#if ENABLE_LOGGER_CHECKING
63# define logbuf_assert(str) assert_string_equal(logbuf, str)
64#else
65# define logbuf_assert(str)
66#endif
67
68#define TEST_DUP_GENERIC(PREFIX, MEMBER, VALUE1, VALUE2, FUNC, RESULT, LINE, CLEANUP) \
69 str = PREFIX MEMBER" "VALUE1";"MEMBER" "VALUE2";} ..."; \
70 assert_int_equal(LY_EVALID, FUNC(&ctx, &str, RESULT)); \
71 logbuf_assert("Duplicate keyword \""MEMBER"\". Line number "LINE"."); \
72 CLEANUP
73
74
David Sedlák68a1af12019-03-08 13:46:54 +010075static int
76setup_f(void **state)
77{
78 struct state *st = NULL;
David Sedlák3b4db242018-10-19 16:11:01 +020079
David Sedlák79e50cb2019-06-05 16:33:09 +020080#if ENABLE_LOGGER_CHECKING
81 /* setup logger */
82 ly_set_log_clb(logger, 1);
83#endif
84
David Sedlák68a1af12019-03-08 13:46:54 +010085 /* allocate state variable */
86 (*state) = st = calloc(1, sizeof(*st));
87 if (!st) {
88 fprintf(stderr, "Memmory allocation failed");
89 return EXIT_FAILURE;
90 }
David Sedlák872c7b42018-10-26 13:15:20 +020091
David Sedlák68a1af12019-03-08 13:46:54 +010092 /* create new libyang context */
93 ly_ctx_new(NULL, 0, &st->ctx);
David Sedlák872c7b42018-10-26 13:15:20 +020094
David Sedlák68a1af12019-03-08 13:46:54 +010095 /* allocate new module */
96 st->mod = calloc(1, sizeof(*st->mod));
97 st->mod->ctx = st->ctx;
98
David Sedlák8f5bce02019-06-03 16:41:08 +020099 st->xml_ctx = calloc(1, sizeof(struct lys_parser_ctx));
100 st->xml_ctx->ctx = st->ctx;
101 st->xml_ctx->line = 1;
102
David Sedlák68a1af12019-03-08 13:46:54 +0100103 return EXIT_SUCCESS;
David Sedlák3b4db242018-10-19 16:11:01 +0200104}
105
106static int
David Sedlák68a1af12019-03-08 13:46:54 +0100107teardown_f(void **state)
108{
109 struct state *st = *(struct state **)state;
110
David Sedlák79e50cb2019-06-05 16:33:09 +0200111#if ENABLE_LOGGER_CHECKING
112 /* teardown logger */
113 if (!st->finished_correctly && logbuf[0] != '\0') {
114 fprintf(stderr, "%s\n", logbuf);
115 }
116#endif
117
David Sedlák8f5bce02019-06-03 16:41:08 +0200118 lyxml_context_clear(st->xml_ctx);
David Sedlák68a1af12019-03-08 13:46:54 +0100119 lys_module_free(st->mod, NULL);
120 ly_ctx_destroy(st->ctx, NULL);
David Sedlák8f5bce02019-06-03 16:41:08 +0200121 free(st->xml_ctx);
David Sedlák68a1af12019-03-08 13:46:54 +0100122 free(st);
123
124 return EXIT_SUCCESS;
125}
126
David Sedlák392af4f2019-06-04 16:02:42 +0200127static struct state*
128reset_state(void **state)
129{
David Sedlák79e50cb2019-06-05 16:33:09 +0200130 ((struct state *)*state)->finished_correctly = true;
David Sedlák392af4f2019-06-04 16:02:42 +0200131 teardown_f(state);
132 setup_f(state);
133
134 return *state;
135}
136
David Sedlák79e50cb2019-06-05 16:33:09 +0200137void
138logbuf_clean(void)
139{
140 logbuf[0] = '\0';
141}
142
David Sedlák68a1af12019-03-08 13:46:54 +0100143static void
David Sedlák392af4f2019-06-04 16:02:42 +0200144test_yin_parse_module(void **state)
David Sedlák68a1af12019-03-08 13:46:54 +0100145{
146 LY_ERR ret = LY_SUCCESS;
147 struct state *st = *state;
148
149 ret = yin_parse_module(st->ctx,
David Sedlák18730132019-03-15 15:51:34 +0100150 "<module name=\"example-foo\"\
151 xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"\
152 xmlns:foo=\"urn:example:foo\"\
153 xmlns:myext=\"urn:example:extensions\">\
David Sedlákcd0c9512019-03-29 13:23:06 +0100154 <namespace uri=\"urn:example:foo\" xmlns:myext=\"urn:example:extensions\"/>\
David Sedláka7406952019-04-05 10:33:07 +0200155 <prefix xmlns:myxt=\"urn:emple:extensions\" value=\"foo\" xmlns:myext=\"urn:example:extensions\"/>\
David Sedlákd9d3a312019-06-04 09:47:10 +0200156 </module>",
David Sedlák68a1af12019-03-08 13:46:54 +0100157 st->mod);
158
159 assert_int_equal(ret, LY_SUCCESS);
160 assert_string_equal(st->mod->parsed->mod->name, "example-foo");
161 assert_string_equal(st->mod->parsed->mod->prefix, "foo");
David Sedlákcd0c9512019-03-29 13:23:06 +0100162 assert_string_equal(st->mod->parsed->mod->ns, "urn:example:foo");
David Sedlák392af4f2019-06-04 16:02:42 +0200163
164 st = reset_state(state);
165 ret = yin_parse_module(st->ctx,
166 "<module name=\"example-foo\">\
167 <invalid-tag uri=\"urn:example:foo\"\"/>\
168 </module>",
169 st->mod);
170 assert_int_equal(ret, LY_EVALID);
171
172 st = reset_state(state);
173 ret = yin_parse_module(st->ctx,
174 "<module>\
175 </module>",
176 st->mod);
177 assert_int_equal(ret, LY_EVALID);
David Sedlák79e50cb2019-06-05 16:33:09 +0200178 logbuf_assert("Missing argument name of a module Line number 1.");
David Sedlák392af4f2019-06-04 16:02:42 +0200179
180 st = reset_state(state);
181 ret = yin_parse_module(st->ctx,
182 "",
183 st->mod);
184 assert_int_equal(ret, LY_EVALID);
David Sedlák79e50cb2019-06-05 16:33:09 +0200185 logbuf_assert("Invalid keyword \"(null)\", expected \"module\" or \"submodule\". Line number 1.");
186 st->finished_correctly = true;
David Sedlák3b4db242018-10-19 16:11:01 +0200187}
188
189static void
190test_match_keyword(void **state)
191{
192 (void)state; /* unused */
193
David Sedlák18730132019-03-15 15:51:34 +0100194 assert_int_equal(match_keyword("anydatax", strlen("anydatax"), 0), YANG_NONE);
195 assert_int_equal(match_keyword("asdasd", strlen("asdasd"), 0), YANG_NONE);
196 assert_int_equal(match_keyword("", 0, 0), YANG_NONE);
197 assert_int_equal(match_keyword("anydata", strlen("anydata"), 0), YANG_ANYDATA);
198 assert_int_equal(match_keyword("anyxml", strlen("anyxml"), 0), YANG_ANYXML);
199 assert_int_equal(match_keyword("argument", strlen("argument"), 0), YANG_ARGUMENT);
200 assert_int_equal(match_keyword("augment", strlen("augment"), 0), YANG_AUGMENT);
201 assert_int_equal(match_keyword("base", strlen("base"), 0), YANG_BASE);
202 assert_int_equal(match_keyword("belongs-to", strlen("belongs-to"), 0), YANG_BELONGS_TO);
203 assert_int_equal(match_keyword("bit", strlen("bit"), 0), YANG_BIT);
204 assert_int_equal(match_keyword("case", strlen("case"), 0), YANG_CASE);
205 assert_int_equal(match_keyword("choice", strlen("choice"), 0), YANG_CHOICE);
206 assert_int_equal(match_keyword("config", strlen("config"), 0), YANG_CONFIG);
207 assert_int_equal(match_keyword("contact", strlen("contact"), 0), YANG_CONTACT);
208 assert_int_equal(match_keyword("container", strlen("container"), 0), YANG_CONTAINER);
209 assert_int_equal(match_keyword("default", strlen("default"), 0), YANG_DEFAULT);
210 assert_int_equal(match_keyword("description", strlen("description"), 0), YANG_DESCRIPTION);
211 assert_int_equal(match_keyword("deviate", strlen("deviate"), 0), YANG_DEVIATE);
212 assert_int_equal(match_keyword("deviation", strlen("deviation"), 0), YANG_DEVIATION);
213 assert_int_equal(match_keyword("enum", strlen("enum"), 0), YANG_ENUM);
214 assert_int_equal(match_keyword("error-app-tag", strlen("error-app-tag"), 0), YANG_ERROR_APP_TAG);
215 assert_int_equal(match_keyword("error-message", strlen("error-message"), 0), YANG_ERROR_MESSAGE);
216 assert_int_equal(match_keyword("extension", strlen("extension"), 0), YANG_EXTENSION);
217 assert_int_equal(match_keyword("feature", strlen("feature"), 0), YANG_FEATURE);
218 assert_int_equal(match_keyword("fraction-digits", strlen("fraction-digits"), 0), YANG_FRACTION_DIGITS);
219 assert_int_equal(match_keyword("grouping", strlen("grouping"), 0), YANG_GROUPING);
220 assert_int_equal(match_keyword("identity", strlen("identity"), 0), YANG_IDENTITY);
221 assert_int_equal(match_keyword("if-feature", strlen("if-feature"), 0), YANG_IF_FEATURE);
222 assert_int_equal(match_keyword("import", strlen("import"), 0), YANG_IMPORT);
223 assert_int_equal(match_keyword("include", strlen("include"), 0), YANG_INCLUDE);
224 assert_int_equal(match_keyword("input", strlen("input"), 0), YANG_INPUT);
225 assert_int_equal(match_keyword("key", strlen("key"), 0), YANG_KEY);
226 assert_int_equal(match_keyword("leaf", strlen("leaf"), 0), YANG_LEAF);
227 assert_int_equal(match_keyword("leaf-list", strlen("leaf-list"), 0), YANG_LEAF_LIST);
228 assert_int_equal(match_keyword("length", strlen("length"), 0), YANG_LENGTH);
229 assert_int_equal(match_keyword("list", strlen("list"), 0), YANG_LIST);
230 assert_int_equal(match_keyword("mandatory", strlen("mandatory"), 0), YANG_MANDATORY);
231 assert_int_equal(match_keyword("max-elements", strlen("max-elements"), 0), YANG_MAX_ELEMENTS);
232 assert_int_equal(match_keyword("min-elements", strlen("min-elements"), 0), YANG_MIN_ELEMENTS);
233 assert_int_equal(match_keyword("modifier", strlen("modifier"), 0), YANG_MODIFIER);
234 assert_int_equal(match_keyword("module", strlen("module"), 0), YANG_MODULE);
235 assert_int_equal(match_keyword("must", strlen("must"), 0), YANG_MUST);
236 assert_int_equal(match_keyword("namespace", strlen("namespace"), 0), YANG_NAMESPACE);
237 assert_int_equal(match_keyword("notification", strlen("notification"), 0), YANG_NOTIFICATION);
238 assert_int_equal(match_keyword("ordered-by", strlen("ordered-by"), 0), YANG_ORDERED_BY);
239 assert_int_equal(match_keyword("organization", strlen("organization"), 0), YANG_ORGANIZATION);
240 assert_int_equal(match_keyword("output", strlen("output"), 0), YANG_OUTPUT);
241 assert_int_equal(match_keyword("path", strlen("path"), 0), YANG_PATH);
242 assert_int_equal(match_keyword("pattern", strlen("pattern"), 0), YANG_PATTERN);
243 assert_int_equal(match_keyword("position", strlen("position"), 0), YANG_POSITION);
244 assert_int_equal(match_keyword("prefix", strlen("prefix"), 0), YANG_PREFIX);
245 assert_int_equal(match_keyword("presence", strlen("presence"), 0), YANG_PRESENCE);
246 assert_int_equal(match_keyword("range", strlen("range"), 0), YANG_RANGE);
247 assert_int_equal(match_keyword("reference", strlen("reference"), 0), YANG_REFERENCE);
248 assert_int_equal(match_keyword("refine", strlen("refine"), 0), YANG_REFINE);
249 assert_int_equal(match_keyword("require-instance", strlen("require-instance"), 0), YANG_REQUIRE_INSTANCE);
250 assert_int_equal(match_keyword("revision", strlen("revision"), 0), YANG_REVISION);
251 assert_int_equal(match_keyword("revision-date", strlen("revision-date"), 0), YANG_REVISION_DATE);
252 assert_int_equal(match_keyword("rpc", strlen("rpc"), 0), YANG_RPC);
253 assert_int_equal(match_keyword("status", strlen("status"), 0), YANG_STATUS);
254 assert_int_equal(match_keyword("submodule", strlen("submodule"), 0), YANG_SUBMODULE);
255 assert_int_equal(match_keyword("type", strlen("type"), 0), YANG_TYPE);
256 assert_int_equal(match_keyword("typedef", strlen("typedef"), 0), YANG_TYPEDEF);
257 assert_int_equal(match_keyword("unique", strlen("unique"), 0), YANG_UNIQUE);
258 assert_int_equal(match_keyword("units", strlen("units"), 0), YANG_UNITS);
259 assert_int_equal(match_keyword("uses", strlen("uses"), 0), YANG_USES);
260 assert_int_equal(match_keyword("value", strlen("value"), 0), YANG_VALUE);
261 assert_int_equal(match_keyword("when", strlen("when"), 0), YANG_WHEN);
262 assert_int_equal(match_keyword("yang-version", strlen("yang-version"), 0), YANG_YANG_VERSION);
263 assert_int_equal(match_keyword("yin-element", strlen("yin-element"), 0), YANG_YIN_ELEMENT);
David Sedlák872c7b42018-10-26 13:15:20 +0200264}
David Sedlák3b4db242018-10-19 16:11:01 +0200265
David Sedlák872c7b42018-10-26 13:15:20 +0200266static void
267test_match_argument(void **state)
268{
David Sedlák68a1af12019-03-08 13:46:54 +0100269 (void)state; /* unused */
David Sedlák872c7b42018-10-26 13:15:20 +0200270
David Sedláka7406952019-04-05 10:33:07 +0200271 assert_int_equal(match_argument_name("", 5), YIN_ARG_UNKNOWN);
272 assert_int_equal(match_argument_name("qwertyasd", 5), YIN_ARG_UNKNOWN);
273 assert_int_equal(match_argument_name("conditionasd", 8), YIN_ARG_UNKNOWN);
David Sedlák872c7b42018-10-26 13:15:20 +0200274 assert_int_equal(match_argument_name("condition", 9), YIN_ARG_CONDITION);
275 assert_int_equal(match_argument_name("date", 4), YIN_ARG_DATE);
276 assert_int_equal(match_argument_name("module", 6), YIN_ARG_MODULE);
277 assert_int_equal(match_argument_name("name", 4), YIN_ARG_NAME);
278 assert_int_equal(match_argument_name("tag", 3), YIN_ARG_TAG);
279 assert_int_equal(match_argument_name("target-node", 11), YIN_ARG_TARGET_NODE);
280 assert_int_equal(match_argument_name("text", 4), YIN_ARG_TEXT);
281 assert_int_equal(match_argument_name("uri", 3), YIN_ARG_URI);
282 assert_int_equal(match_argument_name("value", 5), YIN_ARG_VALUE);
David Sedlák3b4db242018-10-19 16:11:01 +0200283}
284
David Sedlák68a1af12019-03-08 13:46:54 +0100285static void
286test_meta(void **state)
287{
288 LY_ERR ret = LY_SUCCESS;
289 struct state *st = *state;
290
291 ret = yin_parse_module(st->ctx,"<module name=\"example-foo\">\
David Sedláka7406952019-04-05 10:33:07 +0200292 <organization xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">organization...</organization>\
David Sedlák68a1af12019-03-08 13:46:54 +0100293 <contact>contact...</contact>\
294 <description>description...</description>\
295 <reference>reference...</reference>\
296 </module>", st->mod);
297
298 assert_int_equal(ret, LY_SUCCESS);
David Sedláka7406952019-04-05 10:33:07 +0200299 assert_string_equal(st->mod->parsed->mod->org, "organization...");
David Sedlák68a1af12019-03-08 13:46:54 +0100300 assert_string_equal(st->mod->parsed->mod->contact, "contact...");
301 assert_string_equal(st->mod->parsed->mod->dsc, "description...");
302 assert_string_equal(st->mod->parsed->mod->ref, "reference...");
David Sedlák68826732019-06-05 10:50:58 +0200303
304 st = reset_state(state);
305 ret = yin_parse_module(st->ctx,"<module name=\"example-foo\">\
306 <organization test=\"invalid-argument\">organization...</organization>\
307 </module>", st->mod);
308 assert_int_equal(ret, LY_EVALID);
David Sedlák79e50cb2019-06-05 16:33:09 +0200309
310 st->finished_correctly = true;
David Sedlák68a1af12019-03-08 13:46:54 +0100311}
312
David Sedlák8f5bce02019-06-03 16:41:08 +0200313static void
314test_parse_text_element(void **state)
315{
316 struct state *st = *state;
317 const char *res = NULL, *prefix = NULL, *name = NULL;
318 size_t prefix_len = 0, name_len = 0;
319 LY_ERR ret = LY_SUCCESS;
320
321 const char *data = "<elem>content</elem>";
322 lyxml_get_element(st->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
323 parse_text_element(st->xml_ctx, &data, &res);
324 assert_string_equal(res, "content");
325 lydict_remove(st->ctx, "content");
326
David Sedlák8f5bce02019-06-03 16:41:08 +0200327 data = "<elem xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">another-content</elem>";
328 lyxml_get_element(st->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
329 parse_text_element(st->xml_ctx, &data, &res);
330 assert_string_equal(res, "another-content");
331 lydict_remove(st->ctx, "another-content");
332
333 data = "<elem invalid=\"invalid\">text</elem>";
334 lyxml_get_element(st->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
335 ret = parse_text_element(st->xml_ctx, &data, &res);
336 assert_int_equal(ret, LY_EVALID);
David Sedlák79e50cb2019-06-05 16:33:09 +0200337
338 st->finished_correctly = true;
David Sedlák8f5bce02019-06-03 16:41:08 +0200339}
340
David Sedlákd9d3a312019-06-04 09:47:10 +0200341static void
David Sedlákda63c082019-06-04 13:52:23 +0200342test_yin_parse_import(void **state)
343{
344 struct state *st = *state;
345 const char *prefix = NULL, *name = NULL;
346 size_t prefix_len = 0, name_len = 0;
347 LY_ERR ret = LY_SUCCESS;
348 struct lysp_import *imports = NULL;
349
350 const char *data = "<import module=\"a\">\
351 <prefix value=\"a_mod\"/>\
352 <revision-date date=\"2015-01-01\"/>\
David Sedlákc67dcaa2019-06-04 14:49:05 +0200353 </import>\
354 \
355 <import module=\"a\">\
356 <prefix value=\"a_mod\"/>\
357 <revision-date date=\"2015-01-01\"/>\
David Sedlákda63c082019-06-04 13:52:23 +0200358 </import>";
359
360 lyxml_get_element(st->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
361 ret = yin_parse_import(st->xml_ctx, "b-mod", &data, &imports);
362 assert_int_equal(ret, LY_SUCCESS);
363 assert_string_equal(imports->name, "a");
364 assert_string_equal(imports->prefix, "a_mod");
365 assert_string_equal(imports->rev, "2015-01-01");
366 lydict_remove(st->ctx, imports->name);
367 lydict_remove(st->ctx, imports->prefix);
368 LY_ARRAY_FREE(imports);
David Sedlákda63c082019-06-04 13:52:23 +0200369 imports = NULL;
David Sedlákc67dcaa2019-06-04 14:49:05 +0200370
David Sedlákda63c082019-06-04 13:52:23 +0200371 lyxml_get_element(st->xml_ctx, &data, &prefix, &prefix_len, &name, &name_len);
372 ret = yin_parse_import(st->xml_ctx, "a_mod", &data, &imports);
373 assert_int_equal(ret, LY_EVALID);
David Sedlák79e50cb2019-06-05 16:33:09 +0200374 logbuf_assert("Prefix \"a_mod\" already used as module prefix. Line number 1.");
David Sedlákda63c082019-06-04 13:52:23 +0200375 lydict_remove(st->ctx, imports->name);
376 lydict_remove(st->ctx, imports->prefix);
377 LY_ARRAY_FREE(imports);
David Sedlák79e50cb2019-06-05 16:33:09 +0200378
379 st->finished_correctly = true;
David Sedlákda63c082019-06-04 13:52:23 +0200380}
381
David Sedlák3b4db242018-10-19 16:11:01 +0200382int
383main(void)
384{
385
386 const struct CMUnitTest tests[] = {
David Sedlák392af4f2019-06-04 16:02:42 +0200387 cmocka_unit_test_setup_teardown(test_yin_parse_module, setup_f, teardown_f),
David Sedlák68a1af12019-03-08 13:46:54 +0100388 cmocka_unit_test_setup_teardown(test_meta, setup_f, teardown_f),
David Sedlák8f5bce02019-06-03 16:41:08 +0200389 cmocka_unit_test_setup_teardown(test_parse_text_element, setup_f, teardown_f),
David Sedlákda63c082019-06-04 13:52:23 +0200390 cmocka_unit_test_setup_teardown(test_yin_parse_import, setup_f, teardown_f),
David Sedlák3b4db242018-10-19 16:11:01 +0200391 cmocka_unit_test(test_match_keyword),
David Sedlák872c7b42018-10-26 13:15:20 +0200392 cmocka_unit_test(test_match_argument),
David Sedlák3b4db242018-10-19 16:11:01 +0200393 };
394
395 return cmocka_run_group_tests(tests, NULL, NULL);
396}