Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
max_func_local_bytes_tests.cpp File Reference
#include <sysio/vm/backend.hpp>
#include "utils.hpp"
#include <catch2/catch.hpp>
Include dependency graph for max_func_local_bytes_tests.cpp:

Go to the source code of this file.

Functions

 BACKEND_TEST_CASE ("Test max_func_local_bytes default", "[max_func_local_bytes_test]")
 
 BACKEND_TEST_CASE ("Test max_func_local_bytes unlimited", "[max_func_local_bytes_test]")
 
 BACKEND_TEST_CASE ("Test max_func_local_bytes static fail", "[max_func_local_bytes_test]")
 
 BACKEND_TEST_CASE ("Test max_func_local_bytes static pass", "[max_func_local_bytes_test]")
 
 BACKEND_TEST_CASE ("Test max_func_local_bytes dynamic fail", "[max_func_local_bytes_test]")
 
 BACKEND_TEST_CASE ("Test max_func_local_bytes dynamic pass", "[max_func_local_bytes_test]")
 

Variables

wasm_allocator wa
 

Function Documentation

◆ BACKEND_TEST_CASE() [1/6]

BACKEND_TEST_CASE ( "Test max_func_local_bytes default" ,
"" [max_func_local_bytes_test] )

Definition at line 119 of file max_func_local_bytes_tests.cpp.

119 {
121 backend_t backend_unused(unused_type_wasm, &wa);
122 backend_t backend_param(param_16_wasm, &wa);
123 backend_t backend_local(local_16_wasm, &wa);
124 backend_t backend_stack(stack_16_wasm, &wa);
125 backend_t backend_mixed(mixed_16_wasm, &wa);
126}
wasm_allocator wa
Definition main.cpp:10

◆ BACKEND_TEST_CASE() [2/6]

BACKEND_TEST_CASE ( "Test max_func_local_bytes dynamic fail" ,
"" [max_func_local_bytes_test] )

Definition at line 229 of file max_func_local_bytes_tests.cpp.

229 {
230 {
232 CHECK_THROWS_AS(backend_t(param_16_wasm, nullptr, dynamic_options{8, lp}), wasm_parse_exception);
233 CHECK_THROWS_AS(backend_t(param_16_wasm, nullptr, dynamic_options{8, ps}), wasm_parse_exception);
234 CHECK_THROWS_AS(backend_t(local_16_wasm, nullptr, dynamic_options{8, lp}), wasm_parse_exception);
235 CHECK_THROWS_AS(backend_t(local_16_wasm, nullptr, dynamic_options{8, ls}), wasm_parse_exception);
236 CHECK_THROWS_AS(backend_t(stack_16_wasm, nullptr, dynamic_options{8, ls}), wasm_parse_exception);
237 CHECK_THROWS_AS(backend_t(stack_16_wasm, nullptr, dynamic_options{8, ps}), wasm_parse_exception);
238 CHECK_THROWS_AS(backend_t(mixed_16_wasm, nullptr, dynamic_options{8, lp}), wasm_parse_exception);
239 }
240
241 {
243 CHECK_THROWS_AS(backend_t(local_16_wasm, nullptr, dynamic_options_empty_flags{8}), wasm_parse_exception);
244 CHECK_THROWS_AS(backend_t(stack_16_wasm, nullptr, dynamic_options_empty_flags{8}), wasm_parse_exception);
245 }
246}
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203

◆ BACKEND_TEST_CASE() [3/6]

BACKEND_TEST_CASE ( "Test max_func_local_bytes dynamic pass" ,
"" [max_func_local_bytes_test] )

Definition at line 248 of file max_func_local_bytes_tests.cpp.

248 {
249 {
251 backend_t backend_unused(unused_type_wasm, nullptr, dynamic_options{8, lp});
252
253 backend_t backend_param1(param_16_wasm, nullptr, dynamic_options{16, lp});
254 backend_t backend_param2(param_16_wasm, nullptr, dynamic_options{8, ls});
255 backend_t backend_param3(param_16_wasm, nullptr, dynamic_options{16, ps});
256 backend_t backend_local1(local_16_wasm, nullptr, dynamic_options{16, lp});
257 backend_t backend_local2(local_16_wasm, nullptr, dynamic_options{16, ls});
258 backend_t backend_local3(local_16_wasm, nullptr, dynamic_options{8, ps});
259 backend_t backend_stack1(stack_16_wasm, nullptr, dynamic_options{8, lp});
260 backend_t backend_stack3(stack_16_wasm, nullptr, dynamic_options{16, ps});
261
262 backend_t backend_mixed(mixed_16_wasm, nullptr, dynamic_options{16, lp});
263 }
264 {
266 backend_t backend_param2(param_16_wasm, nullptr, dynamic_options_empty_flags{8});
267 backend_t backend_local2(local_16_wasm, nullptr, dynamic_options_empty_flags{16});
268 backend_t backend_stack2(stack_16_wasm, nullptr, dynamic_options_empty_flags{16});
269 }
270}

◆ BACKEND_TEST_CASE() [4/6]

BACKEND_TEST_CASE ( "Test max_func_local_bytes static fail" ,
"" [max_func_local_bytes_test] )

Definition at line 171 of file max_func_local_bytes_tests.cpp.

171 {
172 {
174 backend_t backend_unused(unused_type_wasm, &wa);
175 CHECK_THROWS_AS(backend_t(param_16_wasm, &wa), wasm_parse_exception);
176 CHECK_THROWS_AS(backend_t(local_16_wasm, &wa), wasm_parse_exception);
177 backend_t backend_stack(stack_16_wasm, &wa);
178 CHECK_THROWS_AS(backend_t(mixed_16_wasm, &wa), wasm_parse_exception);
179 }
180 {
182 backend_t backend_param(param_16_wasm, &wa);
183 CHECK_THROWS_AS(backend_t(local_16_wasm, &wa), wasm_parse_exception);
184 CHECK_THROWS_AS(backend_t(stack_16_wasm, &wa), wasm_parse_exception);
185 }
186 {
188 CHECK_THROWS_AS(backend_t(param_16_wasm, &wa), wasm_parse_exception);
189 backend_t backend_local(local_16_wasm, &wa);
190 CHECK_THROWS_AS(backend_t(stack_16_wasm, &wa), wasm_parse_exception);
191 }
192 {
194 backend_t backend_param(param_16_wasm, &wa);
195 CHECK_THROWS_AS(backend_t(local_16_wasm, &wa), wasm_parse_exception);
196 CHECK_THROWS_AS(backend_t(stack_16_wasm, &wa), wasm_parse_exception);
197 }
198}

◆ BACKEND_TEST_CASE() [5/6]

BACKEND_TEST_CASE ( "Test max_func_local_bytes static pass" ,
"" [max_func_local_bytes_test] )

Definition at line 200 of file max_func_local_bytes_tests.cpp.

200 {
201 {
203 backend_t backend_unused(unused_type_wasm, &wa);
204 backend_t backend_param(param_16_wasm, &wa);
205 backend_t backend_local(local_16_wasm, &wa);
206 backend_t backend_stack(stack_16_wasm, &wa);
207 backend_t backend_mixed(mixed_16_wasm, &wa);
208 }
209 {
211 backend_t backend_param(param_16_wasm, &wa);
212 backend_t backend_local(local_16_wasm, &wa);
213 backend_t backend_stack(stack_16_wasm, &wa);
214 }
215 {
217 backend_t backend_param(param_16_wasm, &wa);
218 backend_t backend_local(local_16_wasm, &wa);
219 backend_t backend_stack(stack_16_wasm, &wa);
220 }
221 {
223 backend_t backend_param(param_16_wasm, &wa);
224 backend_t backend_local(local_16_wasm, &wa);
225 backend_t backend_stack(stack_16_wasm, &wa);
226 }
227}

◆ BACKEND_TEST_CASE() [6/6]

BACKEND_TEST_CASE ( "Test max_func_local_bytes unlimited" ,
"" [max_func_local_bytes_test] )

Definition at line 128 of file max_func_local_bytes_tests.cpp.

128 {
129 {
131 backend_t backend_unused(unused_type_wasm, &wa);
132 backend_t backend_param(param_16_wasm, &wa);
133 backend_t backend_local(local_16_wasm, &wa);
134 backend_t backend_stack(stack_16_wasm, &wa);
135 backend_t backend_mixed(mixed_16_wasm, &wa);
136 }
137 {
139 backend_t backend_unused(unused_type_wasm, &wa);
140 backend_t backend_param(param_16_wasm, &wa);
141 backend_t backend_local(local_16_wasm, &wa);
142 backend_t backend_stack(stack_16_wasm, &wa);
143 backend_t backend_mixed(mixed_16_wasm, &wa);
144 }
145 {
147 backend_t backend_unused(unused_type_wasm, &wa);
148 backend_t backend_param(param_16_wasm, &wa);
149 backend_t backend_local(local_16_wasm, &wa);
150 backend_t backend_stack(stack_16_wasm, &wa);
151 backend_t backend_mixed(mixed_16_wasm, &wa);
152 }
153 {
155 backend_t backend_unused(unused_type_wasm, &wa);
156 backend_t backend_param(param_16_wasm, &wa);
157 backend_t backend_local(local_16_wasm, &wa);
158 backend_t backend_stack(stack_16_wasm, &wa);
159 backend_t backend_mixed(mixed_16_wasm, &wa);
160 }
161 {
163 backend_t backend_unused(unused_type_wasm, nullptr, empty_options_dynamic_flags{lps});
164 backend_t backend_param(param_16_wasm, nullptr, empty_options_dynamic_flags{lps});
165 backend_t backend_local(local_16_wasm, nullptr, empty_options_dynamic_flags{lps});
166 backend_t backend_stack(stack_16_wasm, nullptr, empty_options_dynamic_flags{lps});
167 backend_t backend_mixed(mixed_16_wasm, nullptr, empty_options_dynamic_flags{lps});
168 }
169}

Variable Documentation

◆ wa

wasm_allocator wa
extern

Definition at line 10 of file main.cpp.