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

Go to the source code of this file.

Functions

 BACKEND_TEST_CASE ("Test max_linear_memory_init default", "[max_linear_memory_init_test]")
 
 BACKEND_TEST_CASE ("Test max_linear_memory_init static", "[max_linear_memory_init_test]")
 
 BACKEND_TEST_CASE ("Test max_linear_memory_init unlimited", "[max_linear_memory_init_test]")
 
 BACKEND_TEST_CASE ("Test max_linear_memory_init dynamic", "[max_linear_memory_init_test]")
 

Variables

wasm_allocator wa
 

Function Documentation

◆ BACKEND_TEST_CASE() [1/4]

BACKEND_TEST_CASE ( "Test max_linear_memory_init default" ,
"" [max_linear_memory_init_test] )

Definition at line 95 of file max_linear_memory_init_tests.cpp.

95 {
97 backend_t backendfull12(full_12_data_wasm, &wa);
98 backend_t backendempty12(empty_12_data_wasm, &wa);
99 backend_t backendempty13(empty_13_data_wasm, &wa);
100 backend_t backendone11(one_11_data_wasm, &wa);
101 backend_t backendone12(one_12_data_wasm, &wa);
102 // This is well formed but should fail linking
103 CHECK_THROWS_AS(backend_t(wrap_data_wasm, &wa), wasm_memory_exception);
104}
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203
wasm_allocator wa
Definition main.cpp:10

◆ BACKEND_TEST_CASE() [2/4]

BACKEND_TEST_CASE ( "Test max_linear_memory_init dynamic" ,
"" [max_linear_memory_init_test] )

Definition at line 126 of file max_linear_memory_init_tests.cpp.

126 {
128 backend_t backendfull12(full_12_data_wasm, nullptr, dynamic_options{12});
129 backend_t backendempty12(empty_12_data_wasm, nullptr, dynamic_options{12});
130 CHECK_THROWS_AS(backend_t(empty_13_data_wasm, nullptr, dynamic_options{12}), wasm_parse_exception);
131 backend_t backendone11(one_11_data_wasm, nullptr, dynamic_options{12});
132 CHECK_THROWS_AS(backend_t(one_12_data_wasm, nullptr, dynamic_options{12}), wasm_parse_exception);
133 CHECK_THROWS_AS(backend_t(wrap_data_wasm, nullptr, dynamic_options{12}), wasm_parse_exception);
134}

◆ BACKEND_TEST_CASE() [3/4]

BACKEND_TEST_CASE ( "Test max_linear_memory_init static" ,
"" [max_linear_memory_init_test] )

Definition at line 106 of file max_linear_memory_init_tests.cpp.

106 {
108 backend_t backendfull12(full_12_data_wasm, &wa);
109 backend_t backendempty12(empty_12_data_wasm, &wa);
110 CHECK_THROWS_AS(backend_t(empty_13_data_wasm, &wa), wasm_parse_exception);
111 backend_t backendone11(one_11_data_wasm, &wa);
112 CHECK_THROWS_AS(backend_t(one_12_data_wasm, &wa), wasm_parse_exception);
113 CHECK_THROWS_AS(backend_t(wrap_data_wasm, &wa), wasm_parse_exception);
114}

◆ BACKEND_TEST_CASE() [4/4]

BACKEND_TEST_CASE ( "Test max_linear_memory_init unlimited" ,
"" [max_linear_memory_init_test] )

Definition at line 116 of file max_linear_memory_init_tests.cpp.

116 {
118 backend_t backendfull12(full_12_data_wasm, &wa);
119 backend_t backendempty12(empty_12_data_wasm, &wa);
120 backend_t backendempty13(empty_13_data_wasm, &wa);
121 backend_t backendone11(one_11_data_wasm, &wa);
122 backend_t backendone12(one_12_data_wasm, &wa);
123 CHECK_THROWS_AS(backend_t(wrap_data_wasm, &wa), wasm_memory_exception);
124}

Variable Documentation

◆ wa

wasm_allocator wa
extern

Definition at line 10 of file main.cpp.