Skip to content

Commit dd28355

Browse files
Test for null String argument of builtin function
Builtin functions should exclude the cases when one of the string arguments can be null.
1 parent 966d810 commit dd28355

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Binary file not shown.

jbmc/regression/jbmc-strings/StringSubstring/Test.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ public void testFail(int i) {
4444
if(i == 4)
4545
assert !s[4].equals("foo");
4646
}
47+
48+
public void testNull(String s, int start, int end) {
49+
// Check that the CProverString version excludes the null case
50+
String sub = org.cprover.CProverString.substring(s, start, end);
51+
}
52+
4753
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
Test.class
3+
--function Test.testNull
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
VERIFICATION SUCCESSFUL
7+
--
8+
Null pointer check: FAILURE
9+
--
10+
Builtin function exclude the cases where one of the string arguments is null

0 commit comments

Comments
 (0)