From 326273f20c2d7dfe3d866eb720d1bb914570e3a3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 11 Jul 2024 02:48:53 +0900 Subject: fix: test code --- tests/src/SpecTestsuites/SpecTestsuiteBase.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/src/SpecTestsuites/SpecTestsuiteBase.php b/tests/src/SpecTestsuites/SpecTestsuiteBase.php index 2e6234c..49ee7c0 100644 --- a/tests/src/SpecTestsuites/SpecTestsuiteBase.php +++ b/tests/src/SpecTestsuites/SpecTestsuiteBase.php @@ -19,6 +19,7 @@ use Nsfisis\Waddiwasi\Execution\Store; use Nsfisis\Waddiwasi\Execution\TableInst; use Nsfisis\Waddiwasi\Execution\TrapException; use Nsfisis\Waddiwasi\Execution\TrapKind; +use Nsfisis\Waddiwasi\Stream\FileStream; use Nsfisis\Waddiwasi\Structure\Types\GlobalType; use Nsfisis\Waddiwasi\Structure\Types\Limits; use Nsfisis\Waddiwasi\Structure\Types\MemType; @@ -46,8 +47,8 @@ abstract class SpecTestsuiteBase extends TestCase ): void { $moduleName = $name ?? '_'; $filePath = __DIR__ . "/../../fixtures/spec_testsuites/core/$filename"; - $wasmBinary = file_get_contents($filePath); - $module = (new Decoder($wasmBinary))->decode(); + $wasmBinaryStream = new FileStream($filePath); + $module = (new Decoder($wasmBinaryStream))->decode(); self::$modules[$moduleName] = $module; $importObj = [ 'spectest' => [ @@ -121,10 +122,10 @@ abstract class SpecTestsuiteBase extends TestCase int $line, ): void { $filePath = __DIR__ . "/../../fixtures/spec_testsuites/core/$filename"; - $wasmBinary = file_get_contents($filePath); + $wasmBinaryStream = new FileStream($filePath); $exception = null; try { - (new Decoder($wasmBinary))->decode(); + (new Decoder($wasmBinaryStream))->decode(); } catch (InvalidBinaryFormatException $e) { $exception = $e; } -- cgit v1.2.3-70-g09d2