Skip to content

Commit 1613290

Browse files
author
Joel Allred
committed
Update smoke tests for String.length
Update test description of java_length smoke test Now detected if the assertion is missing from the verification. Add new smoke test java_length2
1 parent 72b611a commit 1613290

File tree

6 files changed

+27
-2
lines changed

6 files changed

+27
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
CORE
22
test_length.class
33
--refine-strings
4-
^EXIT=0$
4+
^EXIT=10$
55
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
6+
^VERIFICATION FAILED$
7+
[.*assertion.1] .* line 7 .*: SUCCESS
8+
[.*assertion.2] .* line 8 .*: FAILURE
79
--
Binary file not shown.

regression/strings-smoke-tests/java_length/test_length.java

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ public static void main(/*String[] argv*/)
55
String s = new String("Abc");
66
int l = s.length();
77
assert(l == 3);
8+
assert(l != 3);
89
}
910
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FUTURE
2+
test.class
3+
--refine-strings --function test.check
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
This test currently fails because we do not handle the case where the argument
9+
's' is null. This should be handled in the String model.
10+
The issue number for that is: diffblue/test-gen#500
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class test
2+
{
3+
public static int check(String s)
4+
{
5+
if(s.equals("abc")){
6+
assert s.length() == 3;
7+
return 0;
8+
}
9+
return 1;
10+
}
11+
}
12+

0 commit comments

Comments
 (0)