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

Go to the source code of this file.

Functions

 BACKEND_TEST_CASE ("Test allow_code_after_function_end default", "[allow_code_after_function_end_test]")
 
 BACKEND_TEST_CASE ("Test allow_code_after_function_end unlimited", "[allow_code_after_function_end_test]")
 
 BACKEND_TEST_CASE ("Test allow_code_after_function_end static fail", "[allow_code_after_function_end_test]")
 
 BACKEND_TEST_CASE ("Test allow_code_after_function_end static pass", "[allow_code_after_function_end_test]")
 
 BACKEND_TEST_CASE ("Test allow_code_after_function_end dynamic fail", "[allow_code_after_function_end_test]")
 
 BACKEND_TEST_CASE ("Test allow_code_after_function_end dynamic pass", "[allow_code_after_function_end_test]")
 

Variables

wasm_allocator wa
 

Function Documentation

◆ BACKEND_TEST_CASE() [1/6]

BACKEND_TEST_CASE ( "Test allow_code_after_function_end default" ,
"" [allow_code_after_function_end_test] )

Definition at line 102 of file allow_code_after_function_end_tests.cpp.

102 {
104 CHECK_THROWS_AS(backend_t(code_after_end_wasm, &wa), wasm_parse_exception);
105}
wasm_allocator wa
Definition main.cpp:10
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203

◆ BACKEND_TEST_CASE() [2/6]

BACKEND_TEST_CASE ( "Test allow_code_after_function_end dynamic fail" ,
"" [allow_code_after_function_end_test] )

Definition at line 125 of file allow_code_after_function_end_tests.cpp.

125 {
127 CHECK_THROWS_AS(backend_t(code_after_end_wasm, nullptr, dynamic_options{false}), wasm_parse_exception);
128}

◆ BACKEND_TEST_CASE() [3/6]

BACKEND_TEST_CASE ( "Test allow_code_after_function_end dynamic pass" ,
"" [allow_code_after_function_end_test] )

Definition at line 130 of file allow_code_after_function_end_tests.cpp.

130 {
132 backend_t backend(code_after_end_wasm, nullptr, dynamic_options{true});
133 for(auto wasm : fail_wasms) {
134 CHECK_THROWS_AS(backend_t(wasm, nullptr, dynamic_options{true}), wasm_parse_exception);
135 }
136}

◆ BACKEND_TEST_CASE() [4/6]

BACKEND_TEST_CASE ( "Test allow_code_after_function_end static fail" ,
"" [allow_code_after_function_end_test] )

Definition at line 112 of file allow_code_after_function_end_tests.cpp.

112 {
114 CHECK_THROWS_AS(backend_t(code_after_end_wasm, &wa), wasm_parse_exception);
115}

◆ BACKEND_TEST_CASE() [5/6]

BACKEND_TEST_CASE ( "Test allow_code_after_function_end static pass" ,
"" [allow_code_after_function_end_test] )

Definition at line 117 of file allow_code_after_function_end_tests.cpp.

117 {
119 backend_t backend(code_after_end_wasm, &wa);
120 for(auto wasm : fail_wasms) {
121 CHECK_THROWS_AS(backend_t(wasm, &wa), wasm_parse_exception);
122 }
123}

◆ BACKEND_TEST_CASE() [6/6]

BACKEND_TEST_CASE ( "Test allow_code_after_function_end unlimited" ,
"" [allow_code_after_function_end_test] )

Definition at line 107 of file allow_code_after_function_end_tests.cpp.

107 {
109 CHECK_THROWS_AS(backend_t(code_after_end_wasm, &wa), wasm_parse_exception);
110}

Variable Documentation

◆ wa

wasm_allocator wa
extern

Definition at line 10 of file main.cpp.