Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
forward_tests.cpp
Go to the documentation of this file.
1
// Generated by spec_test_generator. DO NOT MODIFY THIS FILE.
2
3
#include <algorithm>
4
#include <vector>
5
#include <iostream>
6
#include <iterator>
7
#include <cmath>
8
#include <cstdlib>
9
#include <
catch2/catch.hpp
>
10
#include <utils.hpp>
11
#include <
wasm_config.hpp
>
12
#include <sysio/vm/backend.hpp>
13
14
using namespace
sysio
;
15
using namespace
sysio::vm
;
16
extern
wasm_allocator
wa
;
17
18
BACKEND_TEST_CASE
(
"Testing wasm <forward_0_wasm>"
,
"[forward_0_wasm_tests]"
) {
19
using
backend_t
=
backend<standalone_function_t, TestType>
;
20
auto
code =
read_wasm
( std::string(wasm_directory) +
"forward.0.wasm"
);
21
backend_t
bkend
( code, &
wa
);
22
23
CHECK
(
bkend
.
call_with_return
(
"env"
,
"even"
,
UINT32_C
(13))->to_ui32() ==
UINT32_C
(0));
24
CHECK
(
bkend
.
call_with_return
(
"env"
,
"even"
,
UINT32_C
(20))->to_ui32() ==
UINT32_C
(1));
25
CHECK
(
bkend
.
call_with_return
(
"env"
,
"odd"
,
UINT32_C
(13))->to_ui32() ==
UINT32_C
(1));
26
CHECK
(
bkend
.
call_with_return
(
"env"
,
"odd"
,
UINT32_C
(20))->to_ui32() ==
UINT32_C
(0));
27
}
28
sysio::vm::backend
Definition
backend.hpp:62
sysio::vm::backend::call_with_return
auto call_with_return(host_t &host, const std::string_view &mod, const std::string_view &func, Args... args)
Definition
backend.hpp:178
sysio::vm::wasm_allocator
Definition
allocator.hpp:409
CHECK
#define CHECK(cond)
Definition
util.h:80
wa
wasm_allocator wa
Definition
main.cpp:10
bkend
backend_t bkend(hello_wasm, ehm, &wa)
sysio::vm
Definition
controller.hpp:23
sysio::vm::read_wasm
std::vector< uint8_t > read_wasm(const std::string &fname)
Definition
utils.hpp:30
sysio
Definition
abi_serializer.cpp:8
catch.hpp
UINT32_C
#define UINT32_C(val)
Definition
stdint.h:283
BACKEND_TEST_CASE
#define BACKEND_TEST_CASE(name, tags)
Definition
utils.hpp:59
wasm_config.hpp
libraries
sys-vm
tests
spec
forward_tests.cpp
Generated by
1.12.0