mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
test NPE
This commit is contained in:
parent
a9554930f3
commit
209d72faec
@ -18,6 +18,7 @@ package de.inetsoftware.jwebassembly;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
@ -88,6 +89,20 @@ public class SampleCompileTest {
|
||||
assertArrayEquals( expected, actual );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void npe() throws Exception {
|
||||
JWebAssembly webAsm = new JWebAssembly();
|
||||
webAsm.addFile( classFile );
|
||||
try {
|
||||
webAsm.compileToBinary( (OutputStream)null );
|
||||
fail();
|
||||
} catch( WasmException ex ) {
|
||||
// expected
|
||||
assertTrue( "" + ex.getCause(), ex.getCause() instanceof NullPointerException );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// @Test
|
||||
// public void compileToBinary() throws Exception {
|
||||
// URL url = SampleCompileTest.class.getResource( "samples/" + testName + ".wasm" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user