Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <libubus.h>
#include <libubox/blobmsg_json.h>
#include <libubox/blobmsg.h>
#include <json-validator.h>
#include <json-c/json.h>
#include <json-editor.h>
#include <json-c/json_tokener.h>
#include <easy/easy.h>
#include <qos.h>
#include "qosmngr.h"
struct test_ctx {
FILE *fp;
};
int qosmngr_event_main(const char *evmap_file);
static int group_setup(void **state)
{
struct test_ctx *ctx = calloc(1, sizeof(struct test_ctx));
if (!ctx)
return -1;
remove("/tmp/test.log");
*state = ctx;
return 0;
}
static int group_teardown(void **state)
{
struct test_ctx *ctx = (struct test_ctx *) *state;
free(ctx);
remove("/tmp/test.log");
/* TODO: fix event poll file */
//if (ctx->fp)
//fclose(ctx->fp);
return 0;
}
int main(void)
{
const struct CMUnitTest tests[] = { };
return cmocka_run_group_tests(tests, group_setup, group_teardown);
}