aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/SpecTestsuites/SpecTestsuiteBase.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/src/SpecTestsuites/SpecTestsuiteBase.php b/tests/src/SpecTestsuites/SpecTestsuiteBase.php
index b215a16..285ce12 100644
--- a/tests/src/SpecTestsuites/SpecTestsuiteBase.php
+++ b/tests/src/SpecTestsuites/SpecTestsuiteBase.php
@@ -194,7 +194,21 @@ abstract class SpecTestsuiteBase extends TestCase
for ($i = 0; $i < count($expectedResults); $i++) {
$expectedResult = $expectedResults[$i];
$actualResult = $actualResults[$i];
- if ($expectedResult['type'] === 'f32') {
+ if ($expectedResult['type'] === 'i32') {
+ $expectedValue = unpack('l', pack('l', (int)$expectedResult['value']))[1];
+ $this->assertSame(
+ $expectedValue,
+ $actualResult,
+ "result $i mismatch" . $message,
+ );
+ } elseif ($expectedResult['type'] === 'i64') {
+ $expectedValue = unpack('q', pack('q', (int)$expectedResult['value']))[1];
+ $this->assertSame(
+ $expectedValue,
+ $actualResult,
+ "result $i mismatch" . $message,
+ );
+ } elseif ($expectedResult['type'] === 'f32') {
$expectedValue = unpack('g', pack('l', (int)$expectedResult['value']))[1];
if (is_nan($expectedValue)) {
// @todo check NaN bit pattern.
@@ -225,12 +239,7 @@ abstract class SpecTestsuiteBase extends TestCase
);
}
} else {
- $expectedValue = (int)$expectedResult['value'];
- $this->assertSame(
- $expectedValue,
- $actualResult,
- "result $i mismatch" . $message,
- );
+ $this->assertTrue(false, "unknown result type: {$expectedResult['type']}");
}
}
}