mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Enable tests because SpiderMonkey supports bigint<->i64 now.
This commit is contained in:
parent
0d92b32162
commit
5c3536ffd3
@ -548,7 +548,7 @@ public class WasmRule extends TemporaryFolder {
|
||||
compiler.setProperty( JWebAssembly.WASM_USE_GC, null );
|
||||
System.clearProperty( "SpiderMonkey" );
|
||||
}
|
||||
ProcessBuilder process = new ProcessBuilder( spiderMonkey.getCommand(), /*"--wasm-bigint",*/ script.getAbsolutePath() );
|
||||
ProcessBuilder process = new ProcessBuilder( spiderMonkey.getCommand(), "--wasm-bigint", script.getAbsolutePath() );
|
||||
if( gc ) {
|
||||
process.command().add( 1, "--wasm-gc" );
|
||||
}
|
||||
|
@ -67,8 +67,6 @@ public class ArrayOperations extends AbstractBaseTest {
|
||||
@Test
|
||||
@Override
|
||||
public void test() {
|
||||
Assume.assumeFalse( (getScriptEngine().name().startsWith( "SpiderMonkey" ) )
|
||||
&& "loopLong".equals( getMethod() ) ); // TODO SpiderMonkey https://bugzilla.mozilla.org/show_bug.cgi?id=1511958
|
||||
Assume.assumeFalse( getScriptEngine().name().endsWith( "GC" ) );
|
||||
super.test();
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ public class DynamicValues {
|
||||
|
||||
@Test
|
||||
public void currentTimeMillis() {
|
||||
assumeFalse( script == ScriptEngine.SpiderMonkey || script == ScriptEngine.SpiderMonkeyWat );
|
||||
long before = System.currentTimeMillis();
|
||||
String result = rule.evalWasm( script, "currentTimeMillis" );
|
||||
long after = System.currentTimeMillis();
|
||||
|
@ -235,15 +235,13 @@ public class MathAPI extends AbstractBaseTest {
|
||||
}
|
||||
|
||||
@Export
|
||||
static int roundD3_8() {
|
||||
// SpiderMonkey does not support BigInt currently
|
||||
return (int)Math.round( 3.8 );
|
||||
static long roundD3_8() {
|
||||
return Math.round( 3.8 );
|
||||
}
|
||||
|
||||
@Export
|
||||
static int roundD_3_8() {
|
||||
// SpiderMonkey does not support BigInt currently
|
||||
return (int)Math.round( -3.8 );
|
||||
static long roundD_3_8() {
|
||||
return Math.round( -3.8 );
|
||||
}
|
||||
|
||||
@Export
|
||||
|
@ -15,15 +15,12 @@
|
||||
*/
|
||||
package de.inetsoftware.jwebassembly.runtime;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@ -41,9 +38,6 @@ import de.inetsoftware.jwebassembly.api.annotation.Import;
|
||||
@RunWith( Parameterized.class )
|
||||
public class RuntimeErrors {
|
||||
|
||||
@ClassRule
|
||||
public static WasmRule rule = new WasmRule( TestClass.class );
|
||||
|
||||
private final ScriptEngine script;
|
||||
|
||||
public RuntimeErrors( ScriptEngine script ) {
|
||||
@ -55,26 +49,6 @@ public class RuntimeErrors {
|
||||
return ScriptEngine.testParams();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void longReturn() {
|
||||
assumeTrue( script == ScriptEngine.SpiderMonkey || script == ScriptEngine.SpiderMonkeyWat );
|
||||
String error = rule.evalWasm( script, "longReturn" );
|
||||
int newlineIdx = error.indexOf( '\n' );
|
||||
if( newlineIdx > 0 ) {
|
||||
error = error.substring( 0, newlineIdx );
|
||||
}
|
||||
String expected = "TypeError: cannot pass i64 to or from JS";
|
||||
assertEquals( expected, error );
|
||||
}
|
||||
|
||||
static class TestClass {
|
||||
|
||||
@Export
|
||||
static long longReturn() {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
private void compileErrorTest( String expectedMessge, Class<?> classes ) throws IOException {
|
||||
WasmRule wasm = new WasmRule( classes );
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user