Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
if_tests.cpp
Go to the documentation of this file.
1// Generated by spec_test_generator. DO NOT MODIFY THIS FILE.
2
3#include <algorithm>
4#include <vector>
5#include <iostream>
6#include <iterator>
7#include <cmath>
8#include <cstdlib>
9#include <catch2/catch.hpp>
10#include <utils.hpp>
11#include <wasm_config.hpp>
12#include <sysio/vm/backend.hpp>
13
14using namespace sysio;
15using namespace sysio::vm;
16extern wasm_allocator wa;
17
18BACKEND_TEST_CASE( "Testing wasm <if_0_wasm>", "[if_0_wasm_tests]" ) {
20 auto code = read_wasm( std::string(wasm_directory) + "if.0.wasm");
21 backend_t bkend( code, &wa );
22
23 CHECK(!bkend.call_with_return("env", "empty", UINT32_C(0)));
24 CHECK(!bkend.call_with_return("env", "empty", UINT32_C(1)));
25 CHECK(!bkend.call_with_return("env", "empty", UINT32_C(100)));
26 CHECK(!bkend.call_with_return("env", "empty", UINT32_C(4294967294)));
27 CHECK(bkend.call_with_return("env", "singular", UINT32_C(0))->to_ui32() == UINT32_C(8));
28 CHECK(bkend.call_with_return("env", "singular", UINT32_C(1))->to_ui32() == UINT32_C(7));
29 CHECK(bkend.call_with_return("env", "singular", UINT32_C(10))->to_ui32() == UINT32_C(7));
30 CHECK(bkend.call_with_return("env", "singular", UINT32_C(4294967286))->to_ui32() == UINT32_C(7));
31 CHECK(bkend.call_with_return("env", "multi", UINT32_C(0))->to_ui32() == UINT32_C(9));
32 CHECK(bkend.call_with_return("env", "multi", UINT32_C(1))->to_ui32() == UINT32_C(8));
33 CHECK(bkend.call_with_return("env", "multi", UINT32_C(13))->to_ui32() == UINT32_C(8));
34 CHECK(bkend.call_with_return("env", "multi", UINT32_C(4294967291))->to_ui32() == UINT32_C(8));
35 CHECK(bkend.call_with_return("env", "nested", UINT32_C(0), UINT32_C(0))->to_ui32() == UINT32_C(11));
36 CHECK(bkend.call_with_return("env", "nested", UINT32_C(1), UINT32_C(0))->to_ui32() == UINT32_C(10));
37 CHECK(bkend.call_with_return("env", "nested", UINT32_C(0), UINT32_C(1))->to_ui32() == UINT32_C(10));
38 CHECK(bkend.call_with_return("env", "nested", UINT32_C(3), UINT32_C(2))->to_ui32() == UINT32_C(9));
39 CHECK(bkend.call_with_return("env", "nested", UINT32_C(0), UINT32_C(4294967196))->to_ui32() == UINT32_C(10));
40 CHECK(bkend.call_with_return("env", "nested", UINT32_C(10), UINT32_C(10))->to_ui32() == UINT32_C(9));
41 CHECK(bkend.call_with_return("env", "nested", UINT32_C(0), UINT32_C(4294967295))->to_ui32() == UINT32_C(10));
42 CHECK(bkend.call_with_return("env", "nested", UINT32_C(4294967185), UINT32_C(4294967294))->to_ui32() == UINT32_C(9));
43 CHECK(bkend.call_with_return("env", "as-select-first", UINT32_C(0))->to_ui32() == UINT32_C(0));
44 CHECK(bkend.call_with_return("env", "as-select-first", UINT32_C(1))->to_ui32() == UINT32_C(1));
45 CHECK(bkend.call_with_return("env", "as-select-mid", UINT32_C(0))->to_ui32() == UINT32_C(2));
46 CHECK(bkend.call_with_return("env", "as-select-mid", UINT32_C(1))->to_ui32() == UINT32_C(2));
47 CHECK(bkend.call_with_return("env", "as-select-last", UINT32_C(0))->to_ui32() == UINT32_C(3));
48 CHECK(bkend.call_with_return("env", "as-select-last", UINT32_C(1))->to_ui32() == UINT32_C(2));
49 CHECK(bkend.call_with_return("env", "as-loop-first", UINT32_C(0))->to_ui32() == UINT32_C(0));
50 CHECK(bkend.call_with_return("env", "as-loop-first", UINT32_C(1))->to_ui32() == UINT32_C(1));
51 CHECK(bkend.call_with_return("env", "as-loop-mid", UINT32_C(0))->to_ui32() == UINT32_C(0));
52 CHECK(bkend.call_with_return("env", "as-loop-mid", UINT32_C(1))->to_ui32() == UINT32_C(1));
53 CHECK(bkend.call_with_return("env", "as-loop-last", UINT32_C(0))->to_ui32() == UINT32_C(0));
54 CHECK(bkend.call_with_return("env", "as-loop-last", UINT32_C(1))->to_ui32() == UINT32_C(1));
55 CHECK(bkend.call_with_return("env", "as-if-condition", UINT32_C(0))->to_ui32() == UINT32_C(3));
56 CHECK(bkend.call_with_return("env", "as-if-condition", UINT32_C(1))->to_ui32() == UINT32_C(2));
57 CHECK(bkend.call_with_return("env", "as-br_if-first", UINT32_C(0))->to_ui32() == UINT32_C(0));
58 CHECK(bkend.call_with_return("env", "as-br_if-first", UINT32_C(1))->to_ui32() == UINT32_C(1));
59 CHECK(bkend.call_with_return("env", "as-br_if-last", UINT32_C(0))->to_ui32() == UINT32_C(3));
60 CHECK(bkend.call_with_return("env", "as-br_if-last", UINT32_C(1))->to_ui32() == UINT32_C(2));
61 CHECK(bkend.call_with_return("env", "as-br_table-first", UINT32_C(0))->to_ui32() == UINT32_C(0));
62 CHECK(bkend.call_with_return("env", "as-br_table-first", UINT32_C(1))->to_ui32() == UINT32_C(1));
63 CHECK(bkend.call_with_return("env", "as-br_table-last", UINT32_C(0))->to_ui32() == UINT32_C(2));
64 CHECK(bkend.call_with_return("env", "as-br_table-last", UINT32_C(1))->to_ui32() == UINT32_C(2));
65 CHECK(bkend.call_with_return("env", "as-call_indirect-first", UINT32_C(0))->to_ui32() == UINT32_C(0));
66 CHECK(bkend.call_with_return("env", "as-call_indirect-first", UINT32_C(1))->to_ui32() == UINT32_C(1));
67 CHECK(bkend.call_with_return("env", "as-call_indirect-mid", UINT32_C(0))->to_ui32() == UINT32_C(2));
68 CHECK(bkend.call_with_return("env", "as-call_indirect-mid", UINT32_C(1))->to_ui32() == UINT32_C(2));
69 CHECK(bkend.call_with_return("env", "as-call_indirect-last", UINT32_C(0))->to_ui32() == UINT32_C(2));
70 CHECK_THROWS_AS(bkend("env", "as-call_indirect-last", UINT32_C(1)), std::exception);
71 CHECK(!bkend.call_with_return("env", "as-store-first", UINT32_C(0)));
72 CHECK(!bkend.call_with_return("env", "as-store-first", UINT32_C(1)));
73 CHECK(!bkend.call_with_return("env", "as-store-last", UINT32_C(0)));
74 CHECK(!bkend.call_with_return("env", "as-store-last", UINT32_C(1)));
75 CHECK(bkend.call_with_return("env", "as-memory.grow-value", UINT32_C(0))->to_ui32() == UINT32_C(1));
76 CHECK(bkend.call_with_return("env", "as-memory.grow-value", UINT32_C(1))->to_ui32() == UINT32_C(1));
77 CHECK(bkend.call_with_return("env", "as-call-value", UINT32_C(0))->to_ui32() == UINT32_C(0));
78 CHECK(bkend.call_with_return("env", "as-call-value", UINT32_C(1))->to_ui32() == UINT32_C(1));
79 CHECK(bkend.call_with_return("env", "as-return-value", UINT32_C(0))->to_ui32() == UINT32_C(0));
80 CHECK(bkend.call_with_return("env", "as-return-value", UINT32_C(1))->to_ui32() == UINT32_C(1));
81 CHECK(!bkend.call_with_return("env", "as-drop-operand", UINT32_C(0)));
82 CHECK(!bkend.call_with_return("env", "as-drop-operand", UINT32_C(1)));
83 CHECK(bkend.call_with_return("env", "as-br-value", UINT32_C(0))->to_ui32() == UINT32_C(0));
84 CHECK(bkend.call_with_return("env", "as-br-value", UINT32_C(1))->to_ui32() == UINT32_C(1));
85 CHECK(bkend.call_with_return("env", "as-local.set-value", UINT32_C(0))->to_ui32() == UINT32_C(0));
86 CHECK(bkend.call_with_return("env", "as-local.set-value", UINT32_C(1))->to_ui32() == UINT32_C(1));
87 CHECK(bkend.call_with_return("env", "as-local.tee-value", UINT32_C(0))->to_ui32() == UINT32_C(0));
88 CHECK(bkend.call_with_return("env", "as-local.tee-value", UINT32_C(1))->to_ui32() == UINT32_C(1));
89 CHECK(bkend.call_with_return("env", "as-global.set-value", UINT32_C(0))->to_ui32() == UINT32_C(0));
90 CHECK(bkend.call_with_return("env", "as-global.set-value", UINT32_C(1))->to_ui32() == UINT32_C(1));
91 CHECK(bkend.call_with_return("env", "as-load-operand", UINT32_C(0))->to_ui32() == UINT32_C(0));
92 CHECK(bkend.call_with_return("env", "as-load-operand", UINT32_C(1))->to_ui32() == UINT32_C(0));
93 CHECK(bkend.call_with_return("env", "as-unary-operand", UINT32_C(0))->to_ui32() == UINT32_C(0));
94 CHECK(bkend.call_with_return("env", "as-unary-operand", UINT32_C(1))->to_ui32() == UINT32_C(0));
95 CHECK(bkend.call_with_return("env", "as-unary-operand", UINT32_C(4294967295))->to_ui32() == UINT32_C(0));
96 CHECK(bkend.call_with_return("env", "as-binary-operand", UINT32_C(0), UINT32_C(0))->to_ui32() == UINT32_C(15));
97 CHECK(bkend.call_with_return("env", "as-binary-operand", UINT32_C(0), UINT32_C(1))->to_ui32() == UINT32_C(4294967284));
98 CHECK(bkend.call_with_return("env", "as-binary-operand", UINT32_C(1), UINT32_C(0))->to_ui32() == UINT32_C(4294967281));
99 CHECK(bkend.call_with_return("env", "as-binary-operand", UINT32_C(1), UINT32_C(1))->to_ui32() == UINT32_C(12));
100 CHECK(bkend.call_with_return("env", "as-test-operand", UINT32_C(0))->to_ui32() == UINT32_C(1));
101 CHECK(bkend.call_with_return("env", "as-test-operand", UINT32_C(1))->to_ui32() == UINT32_C(0));
102 CHECK(bkend.call_with_return("env", "as-compare-operand", UINT32_C(0), UINT32_C(0))->to_ui32() == UINT32_C(1));
103 CHECK(bkend.call_with_return("env", "as-compare-operand", UINT32_C(0), UINT32_C(1))->to_ui32() == UINT32_C(0));
104 CHECK(bkend.call_with_return("env", "as-compare-operand", UINT32_C(1), UINT32_C(0))->to_ui32() == UINT32_C(1));
105 CHECK(bkend.call_with_return("env", "as-compare-operand", UINT32_C(1), UINT32_C(1))->to_ui32() == UINT32_C(0));
106 CHECK(bkend.call_with_return("env", "break-bare")->to_ui32() == UINT32_C(19));
107 CHECK(bkend.call_with_return("env", "break-value", UINT32_C(1))->to_ui32() == UINT32_C(18));
108 CHECK(bkend.call_with_return("env", "break-value", UINT32_C(0))->to_ui32() == UINT32_C(21));
109 CHECK(bkend.call_with_return("env", "effects", UINT32_C(1))->to_ui32() == UINT32_C(4294967282));
110 CHECK(bkend.call_with_return("env", "effects", UINT32_C(0))->to_ui32() == UINT32_C(4294967290));
111}
112
113BACKEND_TEST_CASE( "Testing wasm <if_1_wasm>", "[if_1_wasm_tests]" ) {
115 auto code = read_wasm( std::string(wasm_directory) + "if.1.wasm");
116 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
117}
118
119BACKEND_TEST_CASE( "Testing wasm <if_10_wasm>", "[if_10_wasm_tests]" ) {
121 auto code = read_wasm( std::string(wasm_directory) + "if.10.wasm");
122 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
123}
124
125BACKEND_TEST_CASE( "Testing wasm <if_11_wasm>", "[if_11_wasm_tests]" ) {
127 auto code = read_wasm( std::string(wasm_directory) + "if.11.wasm");
128 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
129}
130
131BACKEND_TEST_CASE( "Testing wasm <if_12_wasm>", "[if_12_wasm_tests]" ) {
133 auto code = read_wasm( std::string(wasm_directory) + "if.12.wasm");
134 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
135}
136
137BACKEND_TEST_CASE( "Testing wasm <if_13_wasm>", "[if_13_wasm_tests]" ) {
139 auto code = read_wasm( std::string(wasm_directory) + "if.13.wasm");
140 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
141}
142
143BACKEND_TEST_CASE( "Testing wasm <if_14_wasm>", "[if_14_wasm_tests]" ) {
145 auto code = read_wasm( std::string(wasm_directory) + "if.14.wasm");
146 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
147}
148
149BACKEND_TEST_CASE( "Testing wasm <if_15_wasm>", "[if_15_wasm_tests]" ) {
151 auto code = read_wasm( std::string(wasm_directory) + "if.15.wasm");
152 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
153}
154
155BACKEND_TEST_CASE( "Testing wasm <if_16_wasm>", "[if_16_wasm_tests]" ) {
157 auto code = read_wasm( std::string(wasm_directory) + "if.16.wasm");
158 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
159}
160
161BACKEND_TEST_CASE( "Testing wasm <if_17_wasm>", "[if_17_wasm_tests]" ) {
163 auto code = read_wasm( std::string(wasm_directory) + "if.17.wasm");
164 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
165}
166
167BACKEND_TEST_CASE( "Testing wasm <if_18_wasm>", "[if_18_wasm_tests]" ) {
169 auto code = read_wasm( std::string(wasm_directory) + "if.18.wasm");
170 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
171}
172
173BACKEND_TEST_CASE( "Testing wasm <if_19_wasm>", "[if_19_wasm_tests]" ) {
175 auto code = read_wasm( std::string(wasm_directory) + "if.19.wasm");
176 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
177}
178
179BACKEND_TEST_CASE( "Testing wasm <if_2_wasm>", "[if_2_wasm_tests]" ) {
181 auto code = read_wasm( std::string(wasm_directory) + "if.2.wasm");
182 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
183}
184
185BACKEND_TEST_CASE( "Testing wasm <if_20_wasm>", "[if_20_wasm_tests]" ) {
187 auto code = read_wasm( std::string(wasm_directory) + "if.20.wasm");
188 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
189}
190
191BACKEND_TEST_CASE( "Testing wasm <if_21_wasm>", "[if_21_wasm_tests]" ) {
193 auto code = read_wasm( std::string(wasm_directory) + "if.21.wasm");
194 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
195}
196
197BACKEND_TEST_CASE( "Testing wasm <if_22_wasm>", "[if_22_wasm_tests]" ) {
199 auto code = read_wasm( std::string(wasm_directory) + "if.22.wasm");
200 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
201}
202
203BACKEND_TEST_CASE( "Testing wasm <if_23_wasm>", "[if_23_wasm_tests]" ) {
205 auto code = read_wasm( std::string(wasm_directory) + "if.23.wasm");
206 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
207}
208
209BACKEND_TEST_CASE( "Testing wasm <if_24_wasm>", "[if_24_wasm_tests]" ) {
211 auto code = read_wasm( std::string(wasm_directory) + "if.24.wasm");
212 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
213}
214
215BACKEND_TEST_CASE( "Testing wasm <if_25_wasm>", "[if_25_wasm_tests]" ) {
217 auto code = read_wasm( std::string(wasm_directory) + "if.25.wasm");
218 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
219}
220
221BACKEND_TEST_CASE( "Testing wasm <if_26_wasm>", "[if_26_wasm_tests]" ) {
223 auto code = read_wasm( std::string(wasm_directory) + "if.26.wasm");
224 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
225}
226
227BACKEND_TEST_CASE( "Testing wasm <if_27_wasm>", "[if_27_wasm_tests]" ) {
229 auto code = read_wasm( std::string(wasm_directory) + "if.27.wasm");
230 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
231}
232
233BACKEND_TEST_CASE( "Testing wasm <if_28_wasm>", "[if_28_wasm_tests]" ) {
235 auto code = read_wasm( std::string(wasm_directory) + "if.28.wasm");
236 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
237}
238
239BACKEND_TEST_CASE( "Testing wasm <if_29_wasm>", "[if_29_wasm_tests]" ) {
241 auto code = read_wasm( std::string(wasm_directory) + "if.29.wasm");
242 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
243}
244
245BACKEND_TEST_CASE( "Testing wasm <if_3_wasm>", "[if_3_wasm_tests]" ) {
247 auto code = read_wasm( std::string(wasm_directory) + "if.3.wasm");
248 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
249}
250
251BACKEND_TEST_CASE( "Testing wasm <if_30_wasm>", "[if_30_wasm_tests]" ) {
253 auto code = read_wasm( std::string(wasm_directory) + "if.30.wasm");
254 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
255}
256
257BACKEND_TEST_CASE( "Testing wasm <if_31_wasm>", "[if_31_wasm_tests]" ) {
259 auto code = read_wasm( std::string(wasm_directory) + "if.31.wasm");
260 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
261}
262
263BACKEND_TEST_CASE( "Testing wasm <if_32_wasm>", "[if_32_wasm_tests]" ) {
265 auto code = read_wasm( std::string(wasm_directory) + "if.32.wasm");
266 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
267}
268
269BACKEND_TEST_CASE( "Testing wasm <if_33_wasm>", "[if_33_wasm_tests]" ) {
271 auto code = read_wasm( std::string(wasm_directory) + "if.33.wasm");
272 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
273}
274
275BACKEND_TEST_CASE( "Testing wasm <if_34_wasm>", "[if_34_wasm_tests]" ) {
277 auto code = read_wasm( std::string(wasm_directory) + "if.34.wasm");
278 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
279}
280
281BACKEND_TEST_CASE( "Testing wasm <if_35_wasm>", "[if_35_wasm_tests]" ) {
283 auto code = read_wasm( std::string(wasm_directory) + "if.35.wasm");
284 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
285}
286
287BACKEND_TEST_CASE( "Testing wasm <if_36_wasm>", "[if_36_wasm_tests]" ) {
289 auto code = read_wasm( std::string(wasm_directory) + "if.36.wasm");
290 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
291}
292
293BACKEND_TEST_CASE( "Testing wasm <if_37_wasm>", "[if_37_wasm_tests]" ) {
295 auto code = read_wasm( std::string(wasm_directory) + "if.37.wasm");
296 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
297}
298
299BACKEND_TEST_CASE( "Testing wasm <if_38_wasm>", "[if_38_wasm_tests]" ) {
301 auto code = read_wasm( std::string(wasm_directory) + "if.38.wasm");
302 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
303}
304
305BACKEND_TEST_CASE( "Testing wasm <if_39_wasm>", "[if_39_wasm_tests]" ) {
307 auto code = read_wasm( std::string(wasm_directory) + "if.39.wasm");
308 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
309}
310
311BACKEND_TEST_CASE( "Testing wasm <if_4_wasm>", "[if_4_wasm_tests]" ) {
313 auto code = read_wasm( std::string(wasm_directory) + "if.4.wasm");
314 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
315}
316
317BACKEND_TEST_CASE( "Testing wasm <if_40_wasm>", "[if_40_wasm_tests]" ) {
319 auto code = read_wasm( std::string(wasm_directory) + "if.40.wasm");
320 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
321}
322
323BACKEND_TEST_CASE( "Testing wasm <if_41_wasm>", "[if_41_wasm_tests]" ) {
325 auto code = read_wasm( std::string(wasm_directory) + "if.41.wasm");
326 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
327}
328
329BACKEND_TEST_CASE( "Testing wasm <if_42_wasm>", "[if_42_wasm_tests]" ) {
331 auto code = read_wasm( std::string(wasm_directory) + "if.42.wasm");
332 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
333}
334
335BACKEND_TEST_CASE( "Testing wasm <if_43_wasm>", "[if_43_wasm_tests]" ) {
337 auto code = read_wasm( std::string(wasm_directory) + "if.43.wasm");
338 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
339}
340
341BACKEND_TEST_CASE( "Testing wasm <if_44_wasm>", "[if_44_wasm_tests]" ) {
343 auto code = read_wasm( std::string(wasm_directory) + "if.44.wasm");
344 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
345}
346
347BACKEND_TEST_CASE( "Testing wasm <if_45_wasm>", "[if_45_wasm_tests]" ) {
349 auto code = read_wasm( std::string(wasm_directory) + "if.45.wasm");
350 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
351}
352
353BACKEND_TEST_CASE( "Testing wasm <if_46_wasm>", "[if_46_wasm_tests]" ) {
355 auto code = read_wasm( std::string(wasm_directory) + "if.46.wasm");
356 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
357}
358
359BACKEND_TEST_CASE( "Testing wasm <if_47_wasm>", "[if_47_wasm_tests]" ) {
361 auto code = read_wasm( std::string(wasm_directory) + "if.47.wasm");
362 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
363}
364
365BACKEND_TEST_CASE( "Testing wasm <if_48_wasm>", "[if_48_wasm_tests]" ) {
367 auto code = read_wasm( std::string(wasm_directory) + "if.48.wasm");
368 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
369}
370
371BACKEND_TEST_CASE( "Testing wasm <if_49_wasm>", "[if_49_wasm_tests]" ) {
373 auto code = read_wasm( std::string(wasm_directory) + "if.49.wasm");
374 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
375}
376
377BACKEND_TEST_CASE( "Testing wasm <if_5_wasm>", "[if_5_wasm_tests]" ) {
379 auto code = read_wasm( std::string(wasm_directory) + "if.5.wasm");
380 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
381}
382
383BACKEND_TEST_CASE( "Testing wasm <if_50_wasm>", "[if_50_wasm_tests]" ) {
385 auto code = read_wasm( std::string(wasm_directory) + "if.50.wasm");
386 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
387}
388
389BACKEND_TEST_CASE( "Testing wasm <if_51_wasm>", "[if_51_wasm_tests]" ) {
391 auto code = read_wasm( std::string(wasm_directory) + "if.51.wasm");
392 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
393}
394
395BACKEND_TEST_CASE( "Testing wasm <if_52_wasm>", "[if_52_wasm_tests]" ) {
397 auto code = read_wasm( std::string(wasm_directory) + "if.52.wasm");
398 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
399}
400
401BACKEND_TEST_CASE( "Testing wasm <if_6_wasm>", "[if_6_wasm_tests]" ) {
403 auto code = read_wasm( std::string(wasm_directory) + "if.6.wasm");
404 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
405}
406
407BACKEND_TEST_CASE( "Testing wasm <if_7_wasm>", "[if_7_wasm_tests]" ) {
409 auto code = read_wasm( std::string(wasm_directory) + "if.7.wasm");
410 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
411}
412
413BACKEND_TEST_CASE( "Testing wasm <if_8_wasm>", "[if_8_wasm_tests]" ) {
415 auto code = read_wasm( std::string(wasm_directory) + "if.8.wasm");
416 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
417}
418
419BACKEND_TEST_CASE( "Testing wasm <if_9_wasm>", "[if_9_wasm_tests]" ) {
421 auto code = read_wasm( std::string(wasm_directory) + "if.9.wasm");
422 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
423}
424
auto call_with_return(host_t &host, const std::string_view &mod, const std::string_view &func, Args... args)
Definition backend.hpp:178
#define CHECK(cond)
Definition util.h:80
backend_t bkend(hello_wasm, ehm, &wa)
sysio::vm::backend< rhf_t > backend_t
wasm_allocator wa
Definition main.cpp:10
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203
std::vector< uint8_t > read_wasm(const std::string &fname)
Definition utils.hpp:30
#define UINT32_C(val)
Definition stdint.h:283
#define BACKEND_TEST_CASE(name, tags)
Definition utils.hpp:59