Wire Sysio Wire Sysion 1.0.0
|
#include <algorithm>
#include <vector>
#include <iterator>
#include <cstdlib>
#include <fstream>
#include <string>
#include <catch2/catch.hpp>
#include <sysio/vm/backend.hpp>
#include "wasm_config.hpp"
#include "utils.hpp"
#include "host_functions_tests_0.wasm.hpp"
#include "host_functions_tests_1.wasm.hpp"
Go to the source code of this file.
Classes | |
struct | state_t |
struct | init_backend< Functions, Host, Impl > |
struct | my_host_functions |
struct | has_stateful_conversion |
struct | stateful_conversion |
struct | host_functions_stateful_converter |
struct | stateful_cnv |
struct | test_exception |
struct | host_functions_throw |
struct | host_functions_exit< Impl > |
Functions | |
void | c_style_host_function_0 () |
void | c_style_host_function_1 (int s) |
void | c_style_host_function_2 (int a, int b) |
void | c_style_host_function_3 (int a, float b) |
void | c_style_host_function_4 (const state_t &ss) |
int | next_ptr_offset () |
template<typename T , typename B > | |
void | check_put (B &bkend, const std::string &name) |
template<typename T , typename B > | |
void | check_put_ptr (B &bkend, const std::string &name) |
template<typename T , typename B > | |
void | check_put_ref (B &bkend, const std::string &name) |
template<typename T , typename B , typename F > | |
void | check_get (B &bkend, const std::string &name, F getter) |
template<typename T , typename B > | |
void | check_get_ptr (B &bkend, const std::string &name) |
template<typename T , typename B > | |
void | check_get_ref (B &bkend, const std::string &name) |
template<class Backend > | |
void | test_parameters (Backend &&bkend) |
BACKEND_TEST_CASE ("Test host function parameters", "[host_functions_parameters]") | |
template<class Backend > | |
void | test_results (Backend &&bkend) |
BACKEND_TEST_CASE ("Test host function results", "[host_functions_results]") | |
BACKEND_TEST_CASE ("Test C-style host function system", "[C-style_host_functions_tests]") | |
BACKEND_TEST_CASE ("Testing host functions", "[host_functions_test]") | |
BACKEND_TEST_CASE ("Testing stateful ", "[host_functions_stateful_converter]") | |
BACKEND_TEST_CASE ("Testing throwing host functions", "[host_functions_throw_test]") | |
BACKEND_TEST_CASE ("Testing exiting host functions", "[host_functions_exit_test]") | |
Variables | |
int | c_style_host_function_state = 0 |
wasm_code | host_functions_tests_1_code |
const std::vector< std::string > | fun_prefixes = { "", "call.", "call_indirect." } |
template<typename T > | |
std::vector< T > | test_values = { 0, 1, std::numeric_limits<T>::min(), std::numeric_limits<T>::max() } |
template<> | |
std::vector< bool > | test_values< bool > = { true, false } |
wasm_allocator | wa |
BACKEND_TEST_CASE | ( | "Test C-style host function system" | , |
"" | [C-style_host_functions_tests] ) |
Definition at line 350 of file host_functions_tests.cpp.
BACKEND_TEST_CASE | ( | "Test host function parameters" | , |
"" | [host_functions_parameters] ) |
Definition at line 313 of file host_functions_tests.cpp.
BACKEND_TEST_CASE | ( | "Test host function results" | , |
"" | [host_functions_results] ) |
Definition at line 344 of file host_functions_tests.cpp.
BACKEND_TEST_CASE | ( | "Testing exiting host functions" | , |
"" | [host_functions_exit_test] ) |
Definition at line 540 of file host_functions_tests.cpp.
BACKEND_TEST_CASE | ( | "Testing host functions" | , |
"" | [host_functions_test] ) |
Definition at line 386 of file host_functions_tests.cpp.
BACKEND_TEST_CASE | ( | "Testing stateful " | , |
"" | [host_functions_stateful_converter] ) |
Definition at line 430 of file host_functions_tests.cpp.
BACKEND_TEST_CASE | ( | "Testing throwing host functions" | , |
"" | [host_functions_throw_test] ) |
Definition at line 520 of file host_functions_tests.cpp.
void c_style_host_function_0 | ( | ) |
Definition at line 57 of file host_functions_tests.cpp.
void c_style_host_function_1 | ( | int | s | ) |
Definition at line 60 of file host_functions_tests.cpp.
void c_style_host_function_2 | ( | int | a, |
int | b ) |
Definition at line 63 of file host_functions_tests.cpp.
void c_style_host_function_3 | ( | int | a, |
float | b ) |
Definition at line 66 of file host_functions_tests.cpp.
void c_style_host_function_4 | ( | const state_t & | ss | ) |
Definition at line 69 of file host_functions_tests.cpp.
void check_get | ( | B & | bkend, |
const std::string & | name, | ||
F | getter ) |
Definition at line 252 of file host_functions_tests.cpp.
void check_get_ptr | ( | B & | bkend, |
const std::string & | name ) |
Definition at line 263 of file host_functions_tests.cpp.
void check_get_ref | ( | B & | bkend, |
const std::string & | name ) |
Definition at line 273 of file host_functions_tests.cpp.
void check_put | ( | B & | bkend, |
const std::string & | name ) |
Definition at line 219 of file host_functions_tests.cpp.
void check_put_ptr | ( | B & | bkend, |
const std::string & | name ) |
Definition at line 230 of file host_functions_tests.cpp.
void check_put_ref | ( | B & | bkend, |
const std::string & | name ) |
Definition at line 241 of file host_functions_tests.cpp.
int next_ptr_offset | ( | ) |
Definition at line 213 of file host_functions_tests.cpp.
void test_parameters | ( | Backend && | bkend | ) |
Definition at line 283 of file host_functions_tests.cpp.
void test_results | ( | Backend && | bkend | ) |
Definition at line 320 of file host_functions_tests.cpp.
int c_style_host_function_state = 0 |
Definition at line 52 of file host_functions_tests.cpp.
const std::vector<std::string> fun_prefixes = { "", "call.", "call_indirect." } |
Definition at line 205 of file host_functions_tests.cpp.
wasm_code host_functions_tests_1_code |
Definition at line 146 of file host_functions_tests.cpp.
std::vector<T> test_values = { 0, 1, std::numeric_limits<T>::min(), std::numeric_limits<T>::max() } |
Definition at line 208 of file host_functions_tests.cpp.
std::vector<bool> test_values< bool > = { true, false } |
Definition at line 208 of file host_functions_tests.cpp.