forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for NullPointerException
The new test is similar to NullPointerException2. It checks that a NullPointerException is correctly caught if the catch block specifies one of its superclasses.
- Loading branch information
1 parent
41d77f4
commit 379e415
Showing
8 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class A { | ||
int i; | ||
} | ||
|
||
public class Test { | ||
public static void main(String args[]) { | ||
A a=null; | ||
try { | ||
a.i=0; | ||
} | ||
catch (Exception exc) { | ||
assert false; | ||
} | ||
} | ||
} |
Binary file added
BIN
+234 Bytes
regression/cbmc-java/NullPointerException4/java/lang/NullPointerException.class
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
regression/cbmc-java/NullPointerException4/java/lang/NullPointerException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package java.lang; | ||
|
||
public class NullPointerException extends RuntimeException { | ||
} |
Binary file added
BIN
+219 Bytes
regression/cbmc-java/NullPointerException4/java/lang/RuntimeException.class
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
regression/cbmc-java/NullPointerException4/java/lang/RuntimeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package java.lang; | ||
|
||
public class RuntimeException extends Exception { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CORE | ||
Test.class | ||
--java-throw-runtime-exceptions | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^.*assertion at file Test.java line 12 function.*: FAILURE$ | ||
^VERIFICATION FAILED$ | ||
-- | ||
^warning: ignoring |