Skip to content

Commit cc201f7

Browse files
Test for char array expressions containing if_expr in VCC
The added test are failing with versions of the string solver that would not take into account if expressions.
1 parent b84d9d5 commit cc201f7

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
914 Bytes
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
test.class
3+
--refine-strings --string-max-length 100
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[.*assertion.1\].* line 12.* SUCCESS$
7+
^\[.*assertion.2\].* line 13.* FAILURE$
8+
--
9+
$ignoring\s*char\s*array
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
public class test
2+
{
3+
public static String main()
4+
{
5+
Object t[] = new Object[5];
6+
t[0] = "world!";
7+
StringBuilder s = new StringBuilder("Hello ");
8+
if(t[0] instanceof String)
9+
{
10+
s.append((String) t[0]);
11+
}
12+
assert(s.toString().equals("Hello world!"));
13+
assert(!s.toString().equals("Hello world!"));
14+
return s.toString();
15+
}
16+
}

0 commit comments

Comments
 (0)