summaryrefslogtreecommitdiff
path: root/src/test/honey-test.h
blob: 87eb5e680d8a0e1c08a48957da8ac60258f568cb (plain)
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
#ifndef HONEY_TEST_H
#define HONEY_TEST_H

#include "lily-test.h"

#define MOCK(name) \
	lily_mock_t * name ## _data = NULL; \
	void name

#define mock_enqueue(name, type, data) \
	lily_enqueue(name ## _data->values, type, data)

#define mock_dequeue(name, type, data) \
	lily_dequeue(name ## _data->values, type, data)

#define CLEAN_MOCK(name) \
	do { \
		if (name ## _data != NULL) { \
			lily_mock_destroy(name ## _data); \
			name ## _data = NULL; \
		} \
	} while(0)

#define USE_MOCK(name) \
	do { \
		CLEAN_MOCK(name); \
		name ## _data = lily_mock_create(); \
	} while(0)


void suite_logging();
void suite_gl();
void suite_window();

#define RUN_TESTS() \
	lily_run_suite(suite_logging); \
	lily_run_suite(suite_gl); \

#endif