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

Go to the source code of this file.

Functions

 BACKEND_TEST_CASE ("Test max_memory_offset default", "[max_memory_offset_test]")
 
 BACKEND_TEST_CASE ("Test max_memory_offset unlimited", "[max_memory_offset_test]")
 
 BACKEND_TEST_CASE ("Test max_memory_offset static fail", "[max_memory_offset_test]")
 
 BACKEND_TEST_CASE ("Test max_memory_offset static pass", "[max_memory_offset_test]")
 
 BACKEND_TEST_CASE ("Test max_memory_offset dynamic fail", "[max_memory_offset_test]")
 
 BACKEND_TEST_CASE ("Test max_memory_offset dynamic pass", "[max_memory_offset_test]")
 

Variables

wasm_allocator wa
 

Function Documentation

◆ BACKEND_TEST_CASE() [1/6]

BACKEND_TEST_CASE ( "Test max_memory_offset default" ,
"" [max_memory_offset_test] )

Definition at line 75 of file max_memory_offset_tests.cpp.

75 {
77 backend_t backend_load_max(max_load_offset_wasm, &wa);
78 backend_t backend_store_max(max_store_offset_wasm, &wa);
79 backend_t backend_load_2(load_offset_2_wasm, &wa);
80 backend_t backend_store_2(load_offset_2_wasm, &wa);
81}
wasm_allocator wa
Definition main.cpp:10

◆ BACKEND_TEST_CASE() [2/6]

BACKEND_TEST_CASE ( "Test max_memory_offset dynamic fail" ,
"" [max_memory_offset_test] )

Definition at line 107 of file max_memory_offset_tests.cpp.

107 {
109 CHECK_THROWS_AS(backend_t(max_load_offset_wasm, nullptr, dynamic_options{1}), wasm_parse_exception);
110 CHECK_THROWS_AS(backend_t(max_store_offset_wasm, nullptr, dynamic_options{1}), wasm_parse_exception);
111 CHECK_THROWS_AS(backend_t(load_offset_2_wasm, nullptr, dynamic_options{1}), wasm_parse_exception);
112 CHECK_THROWS_AS(backend_t(store_offset_2_wasm, nullptr, dynamic_options{1}), wasm_parse_exception);
113}
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_memory_offset dynamic pass" ,
"" [max_memory_offset_test] )

Definition at line 115 of file max_memory_offset_tests.cpp.

115 {
117 CHECK_THROWS_AS(backend_t(max_load_offset_wasm, nullptr, dynamic_options{2}), wasm_parse_exception);
118 CHECK_THROWS_AS(backend_t(max_store_offset_wasm, nullptr, dynamic_options{2}), wasm_parse_exception);
119 backend_t backend_load_2(load_offset_2_wasm, nullptr, dynamic_options{2});
120 backend_t backend_store_2(store_offset_2_wasm, nullptr, dynamic_options{2});
121}

◆ BACKEND_TEST_CASE() [4/6]

BACKEND_TEST_CASE ( "Test max_memory_offset static fail" ,
"" [max_memory_offset_test] )

Definition at line 91 of file max_memory_offset_tests.cpp.

91 {
93 CHECK_THROWS_AS(backend_t(max_load_offset_wasm, &wa), wasm_parse_exception);
94 CHECK_THROWS_AS(backend_t(max_store_offset_wasm, &wa), wasm_parse_exception);
95 CHECK_THROWS_AS(backend_t(load_offset_2_wasm, &wa), wasm_parse_exception);
96 CHECK_THROWS_AS(backend_t(store_offset_2_wasm, &wa), wasm_parse_exception);
97}

◆ BACKEND_TEST_CASE() [5/6]

BACKEND_TEST_CASE ( "Test max_memory_offset static pass" ,
"" [max_memory_offset_test] )

Definition at line 99 of file max_memory_offset_tests.cpp.

99 {
101 CHECK_THROWS_AS(backend_t(max_load_offset_wasm, &wa), wasm_parse_exception);
102 CHECK_THROWS_AS(backend_t(max_store_offset_wasm, &wa), wasm_parse_exception);
103 backend_t backend_load_2(load_offset_2_wasm, &wa);
104 backend_t backend_store_2(store_offset_2_wasm, &wa);
105}

◆ BACKEND_TEST_CASE() [6/6]

BACKEND_TEST_CASE ( "Test max_memory_offset unlimited" ,
"" [max_memory_offset_test] )

Definition at line 83 of file max_memory_offset_tests.cpp.

83 {
85 backend_t backend_load_max(max_load_offset_wasm, &wa);
86 backend_t backend_store_max(max_store_offset_wasm, &wa);
87 backend_t backend_load_2(load_offset_2_wasm, &wa);
88 backend_t backend_store_2(load_offset_2_wasm, &wa);
89}

Variable Documentation

◆ wa

wasm_allocator wa
extern

Definition at line 10 of file main.cpp.