patch: binary-test patched to use builtin types
This commit is contained in:
1 parent
7cc4459dfd
commit
6794c52a77
5 files changed
+18
-15
No files matched your search
@@ -18,12 +18,12 @@ procedure run;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
types, console, wasm.types, wasm.types.stack,
|
wasm.types.builtin, console, wasm.types, wasm.types.stack,
|
||||||
wasm.parser, wasm.vm, wasm.test.framework;
|
wasm.parser, wasm.vm, wasm.test.framework;
|
||||||
|
|
||||||
const
|
const
|
||||||
BINARY_SIZE = 41;
|
BINARY_SIZE = 41;
|
||||||
BINARY : Array[$00..$28] of uint8 = (
|
BINARY : Array[$00..$28] of TWASMUInt8 = (
|
||||||
$00, $61, $73, $6D, { magic }
|
$00, $61, $73, $6D, { magic }
|
||||||
$01, $00, $00, $00, { version 1 }
|
$01, $00, $00, $00, { version 1 }
|
||||||
$01, $05, $01, $60, { type section: 1 func type }
|
$01, $05, $01, $60, { type section: 1 func type }
|
||||||
@@ -46,7 +46,7 @@ var
|
|||||||
begin
|
begin
|
||||||
test_begin('binary.addnums');
|
test_begin('binary.addnums');
|
||||||
|
|
||||||
ctx := wasm.parser.parse(@BINARY[0], puint8(@BINARY[0] + BINARY_SIZE));
|
ctx := wasm.parser.parse(@BINARY[0], TWASMPUInt8(@BINARY[0] + BINARY_SIZE));
|
||||||
assert_true('valid binary', ctx^.ValidBinary);
|
assert_true('valid binary', ctx^.ValidBinary);
|
||||||
|
|
||||||
ctx^.ExecutionState.Running := true;
|
ctx^.ExecutionState.Running := true;
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ procedure run;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
types, console, wasm.types, wasm.types.stack,
|
wasm.types.builtin, console, wasm.types, wasm.types.stack,
|
||||||
wasm.parser, wasm.vm, wasm.test.framework;
|
wasm.parser, wasm.vm, wasm.test.framework;
|
||||||
|
|
||||||
const
|
const
|
||||||
BINARY_SIZE = 44;
|
BINARY_SIZE = 44;
|
||||||
BINARY : Array[$00..$2B] of uint8 = (
|
BINARY : Array[$00..$2B] of TWASMUInt8 = (
|
||||||
$00, $61, $73, $6D, { magic }
|
$00, $61, $73, $6D, { magic }
|
||||||
$01, $00, $00, $00, { version 1 }
|
$01, $00, $00, $00, { version 1 }
|
||||||
$01, $05, $01, $60, { type section: 1 func type }
|
$01, $05, $01, $60, { type section: 1 func type }
|
||||||
@@ -50,7 +50,7 @@ var
|
|||||||
begin
|
begin
|
||||||
test_begin('binary.arithmetic');
|
test_begin('binary.arithmetic');
|
||||||
|
|
||||||
ctx := wasm.parser.parse(@BINARY[0], puint8(@BINARY[0] + BINARY_SIZE));
|
ctx := wasm.parser.parse(@BINARY[0], TWASMPUInt8(@BINARY[0] + BINARY_SIZE));
|
||||||
assert_true('valid binary', ctx^.ValidBinary);
|
assert_true('valid binary', ctx^.ValidBinary);
|
||||||
|
|
||||||
ctx^.ExecutionState.Running := true;
|
ctx^.ExecutionState.Running := true;
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ procedure run;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
types, console, wasm.types, wasm.types.stack,
|
wasm.types.builtin, console, wasm.types, wasm.types.stack,
|
||||||
wasm.parser, wasm.vm, wasm.test.framework;
|
wasm.parser, wasm.vm, wasm.test.framework;
|
||||||
|
|
||||||
const
|
const
|
||||||
BINARY_SIZE = 51;
|
BINARY_SIZE = 51;
|
||||||
BINARY : Array[$00..$32] of uint8 = (
|
BINARY : Array[$00..$32] of TWASMUInt8 = (
|
||||||
$00, $61, $73, $6D, { magic }
|
$00, $61, $73, $6D, { magic }
|
||||||
$01, $00, $00, $00, { version 1 }
|
$01, $00, $00, $00, { version 1 }
|
||||||
$01, $05, $01, $60, { type section: 1 func type }
|
$01, $05, $01, $60, { type section: 1 func type }
|
||||||
@@ -55,7 +55,7 @@ var
|
|||||||
begin
|
begin
|
||||||
test_begin('binary.locals');
|
test_begin('binary.locals');
|
||||||
|
|
||||||
ctx := wasm.parser.parse(@BINARY[0], puint8(@BINARY[0] + BINARY_SIZE));
|
ctx := wasm.parser.parse(@BINARY[0], TWASMPUInt8(@BINARY[0] + BINARY_SIZE));
|
||||||
assert_true('valid binary', ctx^.ValidBinary);
|
assert_true('valid binary', ctx^.ValidBinary);
|
||||||
|
|
||||||
{ Set up locals from the parsed code entry for the single function }
|
{ Set up locals from the parsed code entry for the single function }
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ procedure run;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
types, console, wasm.types, wasm.types.stack,
|
wasm.types.builtin, console, wasm.types, wasm.types.stack,
|
||||||
wasm.parser, wasm.vm, wasm.test.framework;
|
wasm.parser, wasm.vm, wasm.test.framework;
|
||||||
|
|
||||||
const
|
const
|
||||||
BINARY_SIZE = 53;
|
BINARY_SIZE = 53;
|
||||||
BINARY : Array[$00..$34] of uint8 = (
|
BINARY : Array[$00..$34] of TWASMUInt8 = (
|
||||||
$00, $61, $73, $6D, { magic }
|
$00, $61, $73, $6D, { magic }
|
||||||
$01, $00, $00, $00, { version 1 }
|
$01, $00, $00, $00, { version 1 }
|
||||||
$01, $05, $01, $60, { type section: 1 func type }
|
$01, $05, $01, $60, { type section: 1 func type }
|
||||||
@@ -52,7 +52,7 @@ var
|
|||||||
begin
|
begin
|
||||||
test_begin('binary.memroundtrip');
|
test_begin('binary.memroundtrip');
|
||||||
|
|
||||||
ctx := wasm.parser.parse(@BINARY[0], puint8(@BINARY[0] + BINARY_SIZE));
|
ctx := wasm.parser.parse(@BINARY[0], TWASMPUInt8(@BINARY[0] + BINARY_SIZE));
|
||||||
assert_true('valid binary', ctx^.ValidBinary);
|
assert_true('valid binary', ctx^.ValidBinary);
|
||||||
|
|
||||||
ctx^.ExecutionState.Running := true;
|
ctx^.ExecutionState.Running := true;
|
||||||
|
|||||||
@@ -11,9 +11,12 @@ unit wasm.test.binary.return42;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
wasm.types.builtin;
|
||||||
|
|
||||||
const
|
const
|
||||||
BINARY_SIZE = $26;
|
BINARY_SIZE = $26;
|
||||||
BINARY : Array[$0..$25] of uint8 = (
|
BINARY : Array[$0..$25] of TWASMUInt8 = (
|
||||||
$00, $61, $73, $6D, { magic }
|
$00, $61, $73, $6D, { magic }
|
||||||
$01, $00, $00, $00, { version 1 }
|
$01, $00, $00, $00, { version 1 }
|
||||||
$01, $05, $01, $60, { type section: 1 func type }
|
$01, $05, $01, $60, { type section: 1 func type }
|
||||||
@@ -32,7 +35,7 @@ procedure run;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
types, console, wasm.types, wasm.types.stack,
|
console, wasm.types, wasm.types.stack,
|
||||||
wasm.parser, wasm.vm, wasm.test.framework;
|
wasm.parser, wasm.vm, wasm.test.framework;
|
||||||
|
|
||||||
procedure run;
|
procedure run;
|
||||||
@@ -41,7 +44,7 @@ var
|
|||||||
begin
|
begin
|
||||||
test_begin('binary.return42');
|
test_begin('binary.return42');
|
||||||
|
|
||||||
ctx := wasm.parser.parse(@BINARY[0], puint8(@BINARY[0] + BINARY_SIZE));
|
ctx := wasm.parser.parse(@BINARY[0], TWASMPUInt8(@BINARY[0] + BINARY_SIZE));
|
||||||
assert_true('valid binary', ctx^.ValidBinary);
|
assert_true('valid binary', ctx^.ValidBinary);
|
||||||
assert_u32('version=1', ctx^.Version, 1);
|
assert_u32('version=1', ctx^.Version, 1);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user