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

Go to the source code of this file.

Functions

 BACKEND_TEST_CASE ("Test max_table_elements default", "[max_table_elements_test]")
 
 BACKEND_TEST_CASE ("Test max_table_elements static", "[max_table_elements_test]")
 
 BACKEND_TEST_CASE ("Test max_table_elements unlimited", "[max_table_elements_test]")
 
 BACKEND_TEST_CASE ("Test max_table_elements dynamic", "[max_table_elements_test]")
 

Variables

wasm_allocator wa
 

Function Documentation

◆ BACKEND_TEST_CASE() [1/4]

BACKEND_TEST_CASE ( "Test max_table_elements default" ,
"" [max_table_elements_test] )

Definition at line 43 of file max_table_elements_tests.cpp.

43 {
45 backend_t backend1024(_1024_elements_wasm, &wa);
46 backend_t backend1025(_1025_elements_wasm, &wa);
47}
wasm_allocator wa
Definition main.cpp:10

◆ BACKEND_TEST_CASE() [2/4]

BACKEND_TEST_CASE ( "Test max_table_elements dynamic" ,
"" [max_table_elements_test] )

Definition at line 61 of file max_table_elements_tests.cpp.

61 {
63 backend_t backend1024(_1024_elements_wasm, nullptr, dynamic_options{1024});
64 CHECK_THROWS_AS(backend_t(_1025_elements_wasm, nullptr, dynamic_options{1024}), wasm_parse_exception);
65 backend_t backend1025(_1025_elements_wasm, nullptr, dynamic_options{1025});
66}
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203

◆ BACKEND_TEST_CASE() [3/4]

BACKEND_TEST_CASE ( "Test max_table_elements static" ,
"" [max_table_elements_test] )

Definition at line 49 of file max_table_elements_tests.cpp.

49 {
51 backend_t backend(_1024_elements_wasm, &wa);
52 CHECK_THROWS_AS(backend_t(_1025_elements_wasm, &wa), wasm_parse_exception);
53}

◆ BACKEND_TEST_CASE() [4/4]

BACKEND_TEST_CASE ( "Test max_table_elements unlimited" ,
"" [max_table_elements_test] )

Definition at line 55 of file max_table_elements_tests.cpp.

55 {
57 backend_t backend1024(_1024_elements_wasm, &wa);
58 backend_t backend1025(_1025_elements_wasm, &wa);
59}

Variable Documentation

◆ wa

wasm_allocator wa
extern

Definition at line 10 of file main.cpp.