diff options
Diffstat (limited to 'tests/src/SpecTestsuites/Core/LoadTest.php')
| -rw-r--r-- | tests/src/SpecTestsuites/Core/LoadTest.php | 966 |
1 files changed, 966 insertions, 0 deletions
diff --git a/tests/src/SpecTestsuites/Core/LoadTest.php b/tests/src/SpecTestsuites/Core/LoadTest.php new file mode 100644 index 0000000..56c5b12 --- /dev/null +++ b/tests/src/SpecTestsuites/Core/LoadTest.php @@ -0,0 +1,966 @@ +<?php + +declare(strict_types=1); + +namespace Nsfisis\Waddiwasi\Tests\SpecTestsuites\Core; + +use Nsfisis\Waddiwasi\Tests\SpecTestsuites\SpecTestsuiteBase; +use PHPUnit\Framework\Attributes\Depends; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; + +final class LoadTest extends SpecTestsuiteBase +{ + public function testModule0(): void + { + $this->runModuleCommand( + filename: 'load.0.wasm', + name: null, + line: 3, + ); + } + + #[Depends('testModule0')] + public function testAssertReturn1(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-br-value', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 161, + ); + } + + #[Depends('testAssertReturn1')] + public function testAssertReturn2(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-br_if-cond', 'args' => []], + expected: [], + line: 163, + ); + } + + #[Depends('testAssertReturn2')] + public function testAssertReturn3(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-br_if-value', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 164, + ); + } + + #[Depends('testAssertReturn3')] + public function testAssertReturn4(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-br_if-value-cond', 'args' => []], + expected: [['type' => 'i32', 'value' => '7']], + line: 165, + ); + } + + #[Depends('testAssertReturn4')] + public function testAssertReturn5(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-br_table-index', 'args' => []], + expected: [], + line: 167, + ); + } + + #[Depends('testAssertReturn5')] + public function testAssertReturn6(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-br_table-value', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 168, + ); + } + + #[Depends('testAssertReturn6')] + public function testAssertReturn7(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-br_table-value-index', 'args' => []], + expected: [['type' => 'i32', 'value' => '6']], + line: 169, + ); + } + + #[Depends('testAssertReturn7')] + public function testAssertReturn8(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-return-value', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 171, + ); + } + + #[Depends('testAssertReturn8')] + public function testAssertReturn9(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-if-cond', 'args' => []], + expected: [['type' => 'i32', 'value' => '1']], + line: 173, + ); + } + + #[Depends('testAssertReturn9')] + public function testAssertReturn10(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-if-then', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 174, + ); + } + + #[Depends('testAssertReturn10')] + public function testAssertReturn11(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-if-else', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 175, + ); + } + + #[Depends('testAssertReturn11')] + public function testAssertReturn12(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-select-first', 'args' => [['type' => 'i32', 'value' => '0'], ['type' => 'i32', 'value' => '1']]], + expected: [['type' => 'i32', 'value' => '0']], + line: 177, + ); + } + + #[Depends('testAssertReturn12')] + public function testAssertReturn13(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-select-second', 'args' => [['type' => 'i32', 'value' => '0'], ['type' => 'i32', 'value' => '0']]], + expected: [['type' => 'i32', 'value' => '0']], + line: 178, + ); + } + + #[Depends('testAssertReturn13')] + public function testAssertReturn14(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-select-cond', 'args' => []], + expected: [['type' => 'i32', 'value' => '1']], + line: 179, + ); + } + + #[Depends('testAssertReturn14')] + public function testAssertReturn15(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-call-first', 'args' => []], + expected: [['type' => 'i32', 'value' => '4294967295']], + line: 181, + ); + } + + #[Depends('testAssertReturn15')] + public function testAssertReturn16(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-call-mid', 'args' => []], + expected: [['type' => 'i32', 'value' => '4294967295']], + line: 182, + ); + } + + #[Depends('testAssertReturn16')] + public function testAssertReturn17(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-call-last', 'args' => []], + expected: [['type' => 'i32', 'value' => '4294967295']], + line: 183, + ); + } + + #[Depends('testAssertReturn17')] + public function testAssertReturn18(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-call_indirect-first', 'args' => []], + expected: [['type' => 'i32', 'value' => '4294967295']], + line: 185, + ); + } + + #[Depends('testAssertReturn18')] + public function testAssertReturn19(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-call_indirect-mid', 'args' => []], + expected: [['type' => 'i32', 'value' => '4294967295']], + line: 186, + ); + } + + #[Depends('testAssertReturn19')] + public function testAssertReturn20(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-call_indirect-last', 'args' => []], + expected: [['type' => 'i32', 'value' => '4294967295']], + line: 187, + ); + } + + #[Depends('testAssertReturn20')] + public function testAssertReturn21(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-call_indirect-index', 'args' => []], + expected: [['type' => 'i32', 'value' => '4294967295']], + line: 188, + ); + } + + #[Depends('testAssertReturn21')] + public function testAssertReturn22(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-local.set-value', 'args' => []], + expected: [], + line: 190, + ); + } + + #[Depends('testAssertReturn22')] + public function testAssertReturn23(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-local.tee-value', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 191, + ); + } + + #[Depends('testAssertReturn23')] + public function testAssertReturn24(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-global.set-value', 'args' => []], + expected: [], + line: 192, + ); + } + + #[Depends('testAssertReturn24')] + public function testAssertReturn25(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-load-address', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 194, + ); + } + + #[Depends('testAssertReturn25')] + public function testAssertReturn26(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-loadN-address', 'args' => []], + expected: [['type' => 'i32', 'value' => '0']], + line: 195, + ); + } + + #[Depends('testAssertReturn26')] + public function testAssertReturn27(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-store-address', 'args' => []], + expected: [], + line: 196, + ); + } + + #[Depends('testAssertReturn27')] + public function testAssertReturn28(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-store-value', 'args' => []], + expected: [], + line: 197, + ); + } + + #[Depends('testAssertReturn28')] + public function testAssertReturn29(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-storeN-address', 'args' => []], + expected: [], + line: 198, + ); + } + + #[Depends('testAssertReturn29')] + public function testAssertReturn30(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-storeN-value', 'args' => []], + expected: [], + line: 199, + ); + } + + #[Depends('testAssertReturn30')] + public function testAssertReturn31(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-unary-operand', 'args' => []], + expected: [['type' => 'i32', 'value' => '32']], + line: 201, + ); + } + + #[Depends('testAssertReturn31')] + public function testAssertReturn32(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-binary-left', 'args' => []], + expected: [['type' => 'i32', 'value' => '10']], + line: 203, + ); + } + + #[Depends('testAssertReturn32')] + public function testAssertReturn33(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-binary-right', 'args' => []], + expected: [['type' => 'i32', 'value' => '10']], + line: 204, + ); + } + + #[Depends('testAssertReturn33')] + public function testAssertReturn34(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-test-operand', 'args' => []], + expected: [['type' => 'i32', 'value' => '1']], + line: 206, + ); + } + + #[Depends('testAssertReturn34')] + public function testAssertReturn35(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-compare-left', 'args' => []], + expected: [['type' => 'i32', 'value' => '1']], + line: 208, + ); + } + + #[Depends('testAssertReturn35')] + public function testAssertReturn36(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-compare-right', 'args' => []], + expected: [['type' => 'i32', 'value' => '1']], + line: 209, + ); + } + + #[Depends('testAssertReturn36')] + public function testAssertReturn37(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'as-memory.grow-size', 'args' => []], + expected: [['type' => 'i32', 'value' => '1']], + line: 211, + ); + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertReturn37')] + public function testAssertMalformed38(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed38')] + public function testAssertMalformed39(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed39')] + public function testAssertMalformed40(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed40')] + public function testAssertMalformed41(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed41')] + public function testAssertMalformed42(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed42')] + public function testAssertMalformed43(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed43')] + public function testAssertMalformed44(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed44')] + public function testAssertMalformed45(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed45')] + public function testAssertMalformed46(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed46')] + public function testAssertMalformed47(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed47')] + public function testAssertMalformed48(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed48')] + public function testAssertMalformed49(): void + { + } + + #[DoesNotPerformAssertions] + #[Depends('testAssertMalformed49')] + public function testAssertMalformed50(): void + { + } + + #[Depends('testAssertMalformed50')] + public function testAssertInvalid51(): void + { + $this->runAssertInvalidCommand( + filename: 'load.14.wasm', + text: 'type mismatch', + line: 312, + ); + } + + #[Depends('testAssertInvalid51')] + public function testAssertInvalid52(): void + { + $this->runAssertInvalidCommand( + filename: 'load.15.wasm', + text: 'type mismatch', + line: 316, + ); + } + + #[Depends('testAssertInvalid52')] + public function testAssertInvalid53(): void + { + $this->runAssertInvalidCommand( + filename: 'load.16.wasm', + text: 'type mismatch', + line: 320, + ); + } + + #[Depends('testAssertInvalid53')] + public function testAssertInvalid54(): void + { + $this->runAssertInvalidCommand( + filename: 'load.17.wasm', + text: 'type mismatch', + line: 324, + ); + } + + #[Depends('testAssertInvalid54')] + public function testAssertInvalid55(): void + { + $this->runAssertInvalidCommand( + filename: 'load.18.wasm', + text: 'type mismatch', + line: 328, + ); + } + + #[Depends('testAssertInvalid55')] + public function testAssertInvalid56(): void + { + $this->runAssertInvalidCommand( + filename: 'load.19.wasm', + text: 'type mismatch', + line: 332, + ); + } + + #[Depends('testAssertInvalid56')] + public function testAssertInvalid57(): void + { + $this->runAssertInvalidCommand( + filename: 'load.20.wasm', + text: 'type mismatch', + line: 336, + ); + } + + #[Depends('testAssertInvalid57')] + public function testAssertInvalid58(): void + { + $this->runAssertInvalidCommand( + filename: 'load.21.wasm', + text: 'type mismatch', + line: 340, + ); + } + + #[Depends('testAssertInvalid58')] + public function testAssertInvalid59(): void + { + $this->runAssertInvalidCommand( + filename: 'load.22.wasm', + text: 'type mismatch', + line: 344, + ); + } + + #[Depends('testAssertInvalid59')] + public function testAssertInvalid60(): void + { + $this->runAssertInvalidCommand( + filename: 'load.23.wasm', + text: 'type mismatch', + line: 348, + ); + } + + #[Depends('testAssertInvalid60')] + public function testAssertInvalid61(): void + { + $this->runAssertInvalidCommand( + filename: 'load.24.wasm', + text: 'type mismatch', + line: 352, + ); + } + + #[Depends('testAssertInvalid61')] + public function testAssertInvalid62(): void + { + $this->runAssertInvalidCommand( + filename: 'load.25.wasm', + text: 'type mismatch', + line: 356, + ); + } + + #[Depends('testAssertInvalid62')] + public function testAssertInvalid63(): void + { + $this->runAssertInvalidCommand( + filename: 'load.26.wasm', + text: 'type mismatch', + line: 360, + ); + } + + #[Depends('testAssertInvalid63')] + public function testAssertInvalid64(): void + { + $this->runAssertInvalidCommand( + filename: 'load.27.wasm', + text: 'type mismatch', + line: 364, + ); + } + + #[Depends('testAssertInvalid64')] + public function testAssertInvalid65(): void + { + $this->runAssertInvalidCommand( + filename: 'load.28.wasm', + text: 'type mismatch', + line: 371, + ); + } + + #[Depends('testAssertInvalid65')] + public function testAssertInvalid66(): void + { + $this->runAssertInvalidCommand( + filename: 'load.29.wasm', + text: 'type mismatch', + line: 372, + ); + } + + #[Depends('testAssertInvalid66')] + public function testAssertInvalid67(): void + { + $this->runAssertInvalidCommand( + filename: 'load.30.wasm', + text: 'type mismatch', + line: 373, + ); + } + + #[Depends('testAssertInvalid67')] + public function testAssertInvalid68(): void + { + $this->runAssertInvalidCommand( + filename: 'load.31.wasm', + text: 'type mismatch', + line: 374, + ); + } + + #[Depends('testAssertInvalid68')] + public function testAssertInvalid69(): void + { + $this->runAssertInvalidCommand( + filename: 'load.32.wasm', + text: 'type mismatch', + line: 375, + ); + } + + #[Depends('testAssertInvalid69')] + public function testAssertInvalid70(): void + { + $this->runAssertInvalidCommand( + filename: 'load.33.wasm', + text: 'type mismatch', + line: 376, + ); + } + + #[Depends('testAssertInvalid70')] + public function testAssertInvalid71(): void + { + $this->runAssertInvalidCommand( + filename: 'load.34.wasm', + text: 'type mismatch', + line: 377, + ); + } + + #[Depends('testAssertInvalid71')] + public function testAssertInvalid72(): void + { + $this->runAssertInvalidCommand( + filename: 'load.35.wasm', + text: 'type mismatch', + line: 378, + ); + } + + #[Depends('testAssertInvalid72')] + public function testAssertInvalid73(): void + { + $this->runAssertInvalidCommand( + filename: 'load.36.wasm', + text: 'type mismatch', + line: 379, + ); + } + + #[Depends('testAssertInvalid73')] + public function testAssertInvalid74(): void + { + $this->runAssertInvalidCommand( + filename: 'load.37.wasm', + text: 'type mismatch', + line: 380, + ); + } + + #[Depends('testAssertInvalid74')] + public function testAssertInvalid75(): void + { + $this->runAssertInvalidCommand( + filename: 'load.38.wasm', + text: 'type mismatch', + line: 381, + ); + } + + #[Depends('testAssertInvalid75')] + public function testAssertInvalid76(): void + { + $this->runAssertInvalidCommand( + filename: 'load.39.wasm', + text: 'type mismatch', + line: 382, + ); + } + + #[Depends('testAssertInvalid76')] + public function testAssertInvalid77(): void + { + $this->runAssertInvalidCommand( + filename: 'load.40.wasm', + text: 'type mismatch', + line: 383, + ); + } + + #[Depends('testAssertInvalid77')] + public function testAssertInvalid78(): void + { + $this->runAssertInvalidCommand( + filename: 'load.41.wasm', + text: 'type mismatch', + line: 384, + ); + } + + #[Depends('testAssertInvalid78')] + public function testAssertInvalid79(): void + { + $this->runAssertInvalidCommand( + filename: 'load.42.wasm', + text: 'type mismatch', + line: 388, + ); + } + + #[Depends('testAssertInvalid79')] + public function testAssertInvalid80(): void + { + $this->runAssertInvalidCommand( + filename: 'load.43.wasm', + text: 'type mismatch', + line: 397, + ); + } + + #[Depends('testAssertInvalid80')] + public function testAssertInvalid81(): void + { + $this->runAssertInvalidCommand( + filename: 'load.44.wasm', + text: 'type mismatch', + line: 407, + ); + } + + #[Depends('testAssertInvalid81')] + public function testAssertInvalid82(): void + { + $this->runAssertInvalidCommand( + filename: 'load.45.wasm', + text: 'type mismatch', + line: 417, + ); + } + + #[Depends('testAssertInvalid82')] + public function testAssertInvalid83(): void + { + $this->runAssertInvalidCommand( + filename: 'load.46.wasm', + text: 'type mismatch', + line: 427, + ); + } + + #[Depends('testAssertInvalid83')] + public function testAssertInvalid84(): void + { + $this->runAssertInvalidCommand( + filename: 'load.47.wasm', + text: 'type mismatch', + line: 437, + ); + } + + #[Depends('testAssertInvalid84')] + public function testAssertInvalid85(): void + { + $this->runAssertInvalidCommand( + filename: 'load.48.wasm', + text: 'type mismatch', + line: 447, + ); + } + + #[Depends('testAssertInvalid85')] + public function testAssertInvalid86(): void + { + $this->runAssertInvalidCommand( + filename: 'load.49.wasm', + text: 'type mismatch', + line: 457, + ); + } + + #[Depends('testAssertInvalid86')] + public function testAssertInvalid87(): void + { + $this->runAssertInvalidCommand( + filename: 'load.50.wasm', + text: 'type mismatch', + line: 467, + ); + } + + #[Depends('testAssertInvalid87')] + public function testAssertInvalid88(): void + { + $this->runAssertInvalidCommand( + filename: 'load.51.wasm', + text: 'type mismatch', + line: 476, + ); + } + + #[Depends('testAssertInvalid88')] + public function testAssertInvalid89(): void + { + $this->runAssertInvalidCommand( + filename: 'load.52.wasm', + text: 'type mismatch', + line: 485, + ); + } + + #[Depends('testAssertInvalid89')] + public function testAssertInvalid90(): void + { + $this->runAssertInvalidCommand( + filename: 'load.53.wasm', + text: 'type mismatch', + line: 495, + ); + } + + #[Depends('testAssertInvalid90')] + public function testAssertInvalid91(): void + { + $this->runAssertInvalidCommand( + filename: 'load.54.wasm', + text: 'type mismatch', + line: 512, + ); + } + + #[Depends('testAssertInvalid91')] + public function testAssertInvalid92(): void + { + $this->runAssertInvalidCommand( + filename: 'load.55.wasm', + text: 'type mismatch', + line: 522, + ); + } + + #[Depends('testAssertInvalid92')] + public function testAssertInvalid93(): void + { + $this->runAssertInvalidCommand( + filename: 'load.56.wasm', + text: 'type mismatch', + line: 532, + ); + } + + #[Depends('testAssertInvalid93')] + public function testAssertInvalid94(): void + { + $this->runAssertInvalidCommand( + filename: 'load.57.wasm', + text: 'type mismatch', + line: 542, + ); + } + + #[Depends('testAssertInvalid94')] + public function testAssertInvalid95(): void + { + $this->runAssertInvalidCommand( + filename: 'load.58.wasm', + text: 'type mismatch', + line: 551, + ); + } + + #[Depends('testAssertInvalid95')] + public function testAssertInvalid96(): void + { + $this->runAssertInvalidCommand( + filename: 'load.59.wasm', + text: 'type mismatch', + line: 560, + ); + } +} |
