Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
parse_tests.cpp File Reference
#include <algorithm>
#include <vector>
#include <iterator>
#include <cstdlib>
#include <fstream>
#include <string>
#include "utils.hpp"
#include <sysio/vm/backend.hpp>
Include dependency graph for parse_tests.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("small parse test", "[small_parse_test]")
 

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "small parse test" ,
"" [small_parse_test] )

Definition at line 15 of file parse_tests.cpp.

15 {
16 module mod;
17 binary_parser bp{mod.allocator};
18 wasm_code error = { 0x01, 0x61, 0x73, 0x6D, 0x01, 0x00, 0x00, 0x00 };
19 wasm_code_ptr error_ptr( error.data(), 4 );
20 auto n = bp.parse_magic( error_ptr );
21 CHECK(n != constants::magic);
22 wasm_code correct = { 0x00, 0x61, 0x73, 0x6D, 0x01, 0x00, 0x00, 0x00 };
23 wasm_code_ptr correct_ptr( correct.data(), 4 );
24 n = bp.parse_magic( correct_ptr );
25 CHECKL(n == constants::magic);
26}
#define CHECK(cond)
Definition util.h:80
static const Reg16 bp(Operand::BP)
std::vector< uint8_t > wasm_code
Definition types.hpp:147