move python/src/a/*.pxi to python/src/a.pyx
[liba.git] / test / operator.h
blob5615c73039fa1c178b37c737b644635e47494299
1 #define MAIN_(x) A_CAST_2(x, _operator)
2 #include "test.h"
3 #include "a/operator.h"
5 static void test(void)
8 int x = 1;
9 printf("inc(%i) ", x);
10 printf("= %i\n", a_inc(x));
13 int x = 1;
14 printf("dec(%i) ", x);
15 printf("= %i\n", a_dec(x));
18 int x = a_pos(1);
19 printf("pos(1) = %+i\n", x);
22 int x = a_neg(1);
23 printf("neg(1) = %+i\n", x);
26 int x = a_not(1);
27 printf("not(1) = %i\n", x);
30 int x = a_compl(1);
31 printf("compl(1) = %i\n", x);
34 int a = 2;
35 int b = 2;
36 printf("mul(%i, %i) = %i\n", a, b, a_mul(a, b));
39 int a = 2;
40 int b = 2;
41 printf("div(%i, %i) = %i\n", a, b, a_div(a, b));
44 int a = 2;
45 int b = 2;
46 printf("mod(%i, %i) = %i\n", a, b, a_mod(a, b));
49 int a = 2;
50 int b = 2;
51 printf("add(%i, %i) = %i\n", a, b, a_add(a, b));
54 int a = 2;
55 int b = 2;
56 printf("sub(%i, %i) = %i\n", a, b, a_sub(a, b));
59 int a = 2;
60 int b = 1;
61 printf("lshift(%i, %i) = %i\n", a, b, a_lshift(a, b));
64 int a = 2;
65 int b = 1;
66 printf("rshift(%i, %i) = %i\n", a, b, a_rshift(a, b));
69 int a = 2;
70 int b = 2;
71 printf("eq(%i, %i) = %i\n", a, b, a_eq(a, b));
74 int a = 2;
75 int b = 2;
76 printf("ne(%i, %i) = %i\n", a, b, a_ne(a, b));
79 int a = 1;
80 int b = 2;
81 printf("lt(%i, %i) = %i\n", a, b, a_lt(a, b));
84 int a = 2;
85 int b = 1;
86 printf("gt(%i, %i) = %i\n", a, b, a_gt(a, b));
89 int a = 1;
90 int b = 2;
91 printf("le(%i, %i) = %i\n", a, b, a_le(a, b));
94 int a = 2;
95 int b = 1;
96 printf("ge(%i, %i) = %i\n", a, b, a_ge(a, b));
99 int a = 2;
100 int b = 0;
101 printf("bitand(%i, %i) = %i\n", a, b, a_bitand(a, b));
104 int a = 2;
105 int b = 0;
106 printf("bitxor(%i, %i) = %i\n", a, b, a_bitxor(a, b));
109 int a = 9;
110 int b = 2;
111 printf("bitor(%i, %i) = %i\n", a, b, a_bitor(a, b));
114 int a = 2;
115 int b = 0;
116 printf("and(%i, %i) = %i\n", a, b, a_and(a, b));
119 int a = 0;
120 int b = 2;
121 printf("or(%i, %i) = %i\n", a, b, a_or(a, b));
124 int a = 1;
125 int b = 1;
126 int c = a;
127 a_add_eq(c, b);
128 printf("add_eq(%i, %i) = %i\n", a, b, c);
131 int a = 1;
132 int b = 1;
133 int c = a;
134 a_sub_eq(c, b);
135 printf("sub_eq(%i, %i) = %i\n", a, b, c);
138 int a = 2;
139 int b = 2;
140 int c = a;
141 a_mul_eq(c, b);
142 printf("mul_eq(%i, %i) = %i\n", a, b, c);
145 int a = 2;
146 int b = 2;
147 int c = a;
148 a_div_eq(c, b);
149 printf("div_eq(%i, %i) = %i\n", a, b, c);
152 int a = 3;
153 int b = 2;
154 int c = a;
155 a_mod_eq(c, b);
156 printf("mod_eq(%i, %i) = %i\n", a, b, c);
159 int a = 2;
160 int b = 1;
161 int c = a;
162 a_shl_eq(c, b);
163 printf("shl_eq(%i, %i) = %i\n", a, b, c);
166 int a = 2;
167 int b = 1;
168 int c = a;
169 a_shr_eq(c, b);
170 printf("shr_eq(%i, %i) = %i\n", a, b, c);
173 int a = 2;
174 int b = 2;
175 int c = a;
176 a_and_eq(c, b);
177 printf("and_eq(%i, %i) = %i\n", a, b, c);
180 int a = 9;
181 int b = 2;
182 int c = a;
183 a_xor_eq(c, b);
184 printf("xor_eq(%i, %i) = %i\n", a, b, c);
187 int a = 2;
188 int b = 0;
189 int c = a;
190 a_or_eq(c, b);
191 printf("or_eq(%i, %i) = %i\n", a, b, c);
195 int MAIN(int argc, char *argv[]) // NOLINT(misc-definitions-in-headers)
197 (void)(argc);
198 (void)(argv);
199 printf("%s\n", A_FUNC);
200 test();
201 return 0;