aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/src/SpecTestsuites
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/SpecTestsuites')
-rw-r--r--tests/src/SpecTestsuites/Core/CallIndirectTest.php2
-rw-r--r--tests/src/SpecTestsuites/Core/CallTest.php2
-rw-r--r--tests/src/SpecTestsuites/Core/FacTest.php1
-rw-r--r--tests/src/SpecTestsuites/Core/SkipStackGuardPageTest.php10
-rw-r--r--tests/src/SpecTestsuites/SpecTestsuiteBase.php11
5 files changed, 25 insertions, 1 deletions
diff --git a/tests/src/SpecTestsuites/Core/CallIndirectTest.php b/tests/src/SpecTestsuites/Core/CallIndirectTest.php
index c99bd23..6dd311a 100644
--- a/tests/src/SpecTestsuites/Core/CallIndirectTest.php
+++ b/tests/src/SpecTestsuites/Core/CallIndirectTest.php
@@ -1068,6 +1068,7 @@ final class CallIndirectTest extends SpecTestsuiteBase
public function testAssertExhaustion96(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'runaway', 'args' => []],
text: 'call stack exhausted',
line: 585,
@@ -1078,6 +1079,7 @@ final class CallIndirectTest extends SpecTestsuiteBase
public function testAssertExhaustion97(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'mutual-runaway', 'args' => []],
text: 'call stack exhausted',
line: 586,
diff --git a/tests/src/SpecTestsuites/Core/CallTest.php b/tests/src/SpecTestsuites/Core/CallTest.php
index e60f8bc..c245572 100644
--- a/tests/src/SpecTestsuites/Core/CallTest.php
+++ b/tests/src/SpecTestsuites/Core/CallTest.php
@@ -474,6 +474,7 @@ final class CallTest extends SpecTestsuiteBase
public function testAssertExhaustion42(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'runaway', 'args' => []],
text: 'call stack exhausted',
line: 337,
@@ -484,6 +485,7 @@ final class CallTest extends SpecTestsuiteBase
public function testAssertExhaustion43(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'mutual-runaway', 'args' => []],
text: 'call stack exhausted',
line: 338,
diff --git a/tests/src/SpecTestsuites/Core/FacTest.php b/tests/src/SpecTestsuites/Core/FacTest.php
index 319bc55..a388d73 100644
--- a/tests/src/SpecTestsuites/Core/FacTest.php
+++ b/tests/src/SpecTestsuites/Core/FacTest.php
@@ -89,6 +89,7 @@ final class FacTest extends SpecTestsuiteBase
public function testAssertExhaustion7(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'fac-rec', 'args' => [['type' => 'i64', 'value' => '1073741824']]],
text: 'call stack exhausted',
line: 109,
diff --git a/tests/src/SpecTestsuites/Core/SkipStackGuardPageTest.php b/tests/src/SpecTestsuites/Core/SkipStackGuardPageTest.php
index 246b92c..889a817 100644
--- a/tests/src/SpecTestsuites/Core/SkipStackGuardPageTest.php
+++ b/tests/src/SpecTestsuites/Core/SkipStackGuardPageTest.php
@@ -23,6 +23,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion1(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '0']]],
text: 'call stack exhausted',
line: 2275,
@@ -33,6 +34,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion2(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '100']]],
text: 'call stack exhausted',
line: 2276,
@@ -43,6 +45,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion3(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '200']]],
text: 'call stack exhausted',
line: 2277,
@@ -53,6 +56,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion4(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '300']]],
text: 'call stack exhausted',
line: 2278,
@@ -63,6 +67,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion5(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '400']]],
text: 'call stack exhausted',
line: 2279,
@@ -73,6 +78,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion6(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '500']]],
text: 'call stack exhausted',
line: 2280,
@@ -83,6 +89,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion7(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '600']]],
text: 'call stack exhausted',
line: 2281,
@@ -93,6 +100,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion8(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '700']]],
text: 'call stack exhausted',
line: 2282,
@@ -103,6 +111,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion9(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '800']]],
text: 'call stack exhausted',
line: 2283,
@@ -113,6 +122,7 @@ final class SkipStackGuardPageTest extends SpecTestsuiteBase
public function testAssertExhaustion10(): void
{
$this->runAssertExhaustionCommand(
+ module: null,
action: ['type' => 'invoke', 'field' => 'test-guard-page-skip', 'args' => [['type' => 'i32', 'value' => '900']]],
text: 'call stack exhausted',
line: 2284,
diff --git a/tests/src/SpecTestsuites/SpecTestsuiteBase.php b/tests/src/SpecTestsuites/SpecTestsuiteBase.php
index cd5da89..eca3b5c 100644
--- a/tests/src/SpecTestsuites/SpecTestsuiteBase.php
+++ b/tests/src/SpecTestsuites/SpecTestsuiteBase.php
@@ -9,6 +9,7 @@ use Nsfisis\Waddiwasi\BinaryFormat\InvalidBinaryFormatException;
use Nsfisis\Waddiwasi\Execution\Ref;
use Nsfisis\Waddiwasi\Execution\Refs\RefExtern;
use Nsfisis\Waddiwasi\Execution\Runtime;
+use Nsfisis\Waddiwasi\Execution\StackOverflowException;
use Nsfisis\Waddiwasi\Execution\Store;
use Nsfisis\Waddiwasi\Execution\TrapException;
use Nsfisis\Waddiwasi\Execution\TrapKind;
@@ -95,11 +96,19 @@ abstract class SpecTestsuiteBase extends TestCase
}
protected function runAssertExhaustionCommand(
+ ?string $module,
array $action,
string $text,
int $line,
): void {
- $this->assertTrue(false, "assert_exhaustion");
+ $exception = null;
+ try {
+ $this->doAction($module, $action);
+ } catch (StackOverflowException $e) {
+ $exception = $e;
+ }
+ $this->assertNotNull($exception, "at $line");
+ // @todo Check $text?
}
protected function runAssertUninstantiableCommand(