Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
e_locals_tests.cpp File Reference
#include <algorithm>
#include <vector>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdlib>
#include <catch2/catch.hpp>
#include <utils.hpp>
#include <wasm_config.hpp>
#include <sysio/vm/backend.hpp>
Include dependency graph for e_locals_tests.cpp:

Go to the source code of this file.

Functions

 BACKEND_TEST_CASE ("Testing wasm <e_locals_0_wasm>", "[e_locals_0_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <e_locals_1_wasm>", "[e_locals_1_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <e_locals_2_wasm>", "[e_locals_2_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <e_locals_3_wasm>", "[e_locals_3_wasm_tests]")
 

Variables

wasm_allocator wa
 

Function Documentation

◆ BACKEND_TEST_CASE() [1/4]

BACKEND_TEST_CASE ( "Testing wasm <e_locals_0_wasm>" ,
"" [e_locals_0_wasm_tests] )

Definition at line 18 of file e_locals_tests.cpp.

18 {
20 auto code = read_wasm( std::string(wasm_directory) + "e_locals.0.wasm");
21 backend_t bkend( code, &wa );
22
23 CHECK(bkend.call_with_return("env", "local-zero-init")->to_ui64() == UINT32_C(0));
24}
auto call_with_return(host_t &host, const std::string_view &mod, const std::string_view &func, Args... args)
Definition backend.hpp:178
wasm_allocator wa
Definition main.cpp:10
#define CHECK(cond)
Definition util.h:80
backend_t bkend(hello_wasm, ehm, &wa)
std::vector< uint8_t > read_wasm(const std::string &fname)
Definition utils.hpp:30
#define UINT32_C(val)
Definition stdint.h:283
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [2/4]

BACKEND_TEST_CASE ( "Testing wasm <e_locals_1_wasm>" ,
"" [e_locals_1_wasm_tests] )

Definition at line 26 of file e_locals_tests.cpp.

26 {
28 auto code = read_wasm( std::string(wasm_directory) + "e_locals.1.wasm");
29 backend_t bkend( code, &wa );
30
31}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [3/4]

BACKEND_TEST_CASE ( "Testing wasm <e_locals_2_wasm>" ,
"" [e_locals_2_wasm_tests] )

Definition at line 33 of file e_locals_tests.cpp.

33 {
35 auto code = read_wasm( std::string(wasm_directory) + "e_locals.2.wasm");
36 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
37}
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [4/4]

BACKEND_TEST_CASE ( "Testing wasm <e_locals_3_wasm>" ,
"" [e_locals_3_wasm_tests] )

Definition at line 39 of file e_locals_tests.cpp.

39 {
41 auto code = read_wasm( std::string(wasm_directory) + "e_locals.3.wasm");
42 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
43}
Here is the call graph for this function:

Variable Documentation

◆ wa

wasm_allocator wa
extern

Definition at line 10 of file main.cpp.