summaryrefslogtreecommitdiff
path: root/src/tests/eet/eet_test_common.h
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2016-02-04 14:29:22 +0100
committerTom Hacohen <tom@stosb.com>2016-02-16 12:41:06 +0000
commit8cc995cca849033e00d0f51dff0a0d6cba46b717 (patch)
tree4b518399a60c60bd2309d8bcb2dac35de941ccb6 /src/tests/eet/eet_test_common.h
parent885a1d2f7db673d1103f180cc517f4874067bd55 (diff)
Test rework #6: Eet
This one is big: I had to split the huge eet_suite.c into separate test files and it needs more review
Diffstat (limited to 'src/tests/eet/eet_test_common.h')
-rw-r--r--src/tests/eet/eet_test_common.h139
1 files changed, 139 insertions, 0 deletions
diff --git a/src/tests/eet/eet_test_common.h b/src/tests/eet/eet_test_common.h
new file mode 100644
index 0000000000..e95b7e5b01
--- /dev/null
+++ b/src/tests/eet/eet_test_common.h
@@ -0,0 +1,139 @@
1#ifndef EET_TEST_COMMON_H
2#define EET_TEST_COMMON_H
3
4#define EET_TEST_CHAR 0x42
5#define EET_TEST_SHORT 0x4224
6#define EET_TEST_INT 0x42211224
7#define EET_TEST_LONG_LONG 0x84CB42211224BC48
8#define EET_TEST_STRING "my little test with escape \\\""
9#define EET_TEST_KEY1 "key1"
10#define EET_TEST_KEY2 "key2"
11#define EET_TEST_FLOAT 123.45689
12#define EET_TEST_FLOAT2 1.0
13#define EET_TEST_FLOAT3 0.25
14#define EET_TEST_FLOAT4 0.0001234
15#define EET_TEST_DOUBLE 123456789.9876543210
16#define EET_TEST_DOUBLE2 1.0
17#define EET_TEST_DOUBLE3 0.25
18#define EET_TEST_FILE_KEY1 "keys/data/1"
19#define EET_TEST_FILE_KEY2 "keys/data/2"
20#define EET_TEST_FILE_IMAGE "keys/images/"
21
22typedef struct _Eet_Test_Basic_Type Eet_Test_Basic_Type;
23struct _Eet_Test_Basic_Type
24{
25 char c;
26 short s;
27 int i;
28 long long l;
29 char *str;
30 char *istr;
31 float f1;
32 float f2;
33 double d;
34 unsigned char uc;
35 unsigned short us;
36 unsigned int ui;
37 unsigned long long ul;
38 Eina_Value *vp;
39 Eet_Test_Basic_Type *empty;
40 Eet_Test_Basic_Type *with;
41};
42
43typedef struct _Eet_Test_Ex_Type Eet_Test_Ex_Type;
44struct _Eet_Test_Ex_Type
45{
46 char c;
47 short s;
48 int i;
49 unsigned long long l;
50 char *str;
51 char *istr;
52 float f1;
53 float f2;
54 float f3;
55 float f4;
56 double d1;
57 double d2;
58 double d3;
59 double d4;
60 Eina_List *list;
61 Eina_Hash *hash;
62 Eina_List *ilist;
63 Eina_List *slist;
64 Eina_Hash *ihash;
65 Eina_Hash *shash;
66 Eet_Test_Basic_Type sarray1[10];
67 unsigned int sarray2[5];
68 unsigned int varray1_count;
69 unsigned int *varray1;
70 unsigned int varray2_count;
71 Eet_Test_Basic_Type *varray2;
72 unsigned char uc;
73 unsigned short us;
74 unsigned int ui;
75 unsigned long long ul;
76 char *charray[10];
77};
78
79typedef struct _Eet_5FP Eet_5FP;
80struct _Eet_5FP
81{
82 Eina_F32p32 fp32;
83 Eina_F16p16 fp16;
84 Eina_F8p24 fp8;
85 Eina_F32p32 f1;
86 Eina_F32p32 f0;
87};
88
89typedef struct _Eet_5DBL Eet_5DBL;
90struct _Eet_5DBL
91{
92 double fp32;
93 double fp16;
94 float fp8;
95 double f1;
96 double f0;
97};
98
99extern char argv0[PATH_MAX];
100extern int i42;
101extern int i7;
102extern Eina_Bool _dump_call;
103
104void append_string(void *data,
105 const char *str);
106
107void append_strbuf_string(void *data, const char *string);
108
109Eina_Bool func(EINA_UNUSED const Eina_Hash *hash,
110 const void *key,
111 void *data,
112 void *fdata);
113
114Eina_Bool func7(EINA_UNUSED const Eina_Hash *hash,
115 EINA_UNUSED const void *key,
116 void *data,
117 void *fdata);
118
119void eet_test_setup_eddc(Eet_Data_Descriptor_Class *eddc);
120
121void eet_build_basic_descriptor(Eet_Data_Descriptor *edd);
122
123void eet_test_basic_check(Eet_Test_Basic_Type *result,
124 int i,
125 Eina_Bool dumper);
126
127void eet_build_ex_descriptor(Eet_Data_Descriptor *edd, Eina_Bool stream);
128
129Eet_Test_Ex_Type *eet_test_ex_set(Eet_Test_Ex_Type *res,
130 int offset);
131
132int eet_test_ex_check(Eet_Test_Ex_Type *stuff,
133 int offset,
134 Eina_Bool dumper);
135
136void eet_test_basic_set(Eet_Test_Basic_Type *res,
137 int i);
138
139#endif