Skip to content

Commit d7f2bf9

Browse files
Test for the string-non-empty option
1 parent 62b5536 commit d7f2bf9

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
public class Test {
2+
3+
static void checkMinLength(String arg1, String arg2, int nondet) {
4+
// Filter
5+
if (arg1 == null || arg2 == null)
6+
return;
7+
8+
// The validity of the following assertion depends on
9+
// whether --string-non-empty is used
10+
if(nondet == 0) {
11+
assert arg1.length() > 0;
12+
} else if(nondet == 1) {
13+
assert arg2.length() > 0;
14+
} else if(nondet == 2) {
15+
assert arg1.length() + arg2.length() > 1;
16+
} else {
17+
assert arg1.length() > 1;
18+
}
19+
}
20+
}
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.checkMinLength
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
assertion.* line 11 function java::Test.checkMinLength.*: FAILURE
7+
assertion.* line 13 function java::Test.checkMinLength.*: FAILURE
8+
assertion.* line 15 function java::Test.checkMinLength.*: FAILURE
9+
assertion.* line 17 function java::Test.checkMinLength.*: FAILURE
10+
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.checkMinLength --string-non-empty
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
assertion.* line 11 function java::Test.checkMinLength.*: SUCCESS
7+
assertion.* line 13 function java::Test.checkMinLength.*: SUCCESS
8+
assertion.* line 15 function java::Test.checkMinLength.*: SUCCESS
9+
assertion.* line 17 function java::Test.checkMinLength.*: FAILURE
10+

0 commit comments

Comments
 (0)