Skip to content

Port of changes to test-gen-support to master (7) #1129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c712ced
Get symbol of member expression
dcattaruzza Oct 25, 2016
9713c6a
Auxiliary function to check if the ssa has enough data to build an id…
dcattaruzza Oct 25, 2016
c6f1acd
Bitwise operators for mpinteger
dcattaruzza Oct 25, 2016
f4a468d
Auxiliary function to retrieve tail of trace and added dead command t…
dcattaruzza Oct 25, 2016
8d2615e
Fix arithmetic shift operators
smowton Jan 13, 2017
994e216
Added a new class for handling the internals
Jan 16, 2017
b0dba3e
Adding more symbols that should be excluded
Jan 16, 2017
3f8242e
Autocomplete script for bash
forejtv Jan 20, 2017
b28c418
Support for Java assume
cristina-david Feb 9, 2017
c5c017f
Regression tests for Java assume
cristina-david Feb 9, 2017
6385921
Remove assume as coverage target
cristina-david Sep 20, 2016
6a192f0
output covered lines as CSV in show_properties
Feb 1, 2017
2ae6b60
compress list of lines into line ranges
Feb 13, 2017
242c609
add regression test for coverage lines
Feb 15, 2017
ecd864a
fix problem with missing comma / range fix for reaching end
Feb 17, 2017
1cdbff4
Updated dump-C to use the new class
Jan 16, 2017
b1348d0
update interpreter
Mar 2, 2017
aa3a90f
Preprocessing of goto programs for string refinement
romainbrenguier Dec 31, 2016
0b41e8a
Moving is_java_string_type functions to string_preprocess
romainbrenguier Feb 17, 2017
95f0b6c
Moving refined_string_type to util
romainbrenguier Feb 24, 2017
d1d3251
Removed distinction between c string type and refined string type
romainbrenguier Feb 27, 2017
6278614
Removed mention of c string type
romainbrenguier Feb 27, 2017
0adc109
Making add_string_type more generic
romainbrenguier Feb 7, 2017
846abf4
new identifier for converting char pointer to array
romainbrenguier Mar 9, 2017
fbd797c
Many corrections in preprocessing of strings
romainbrenguier Feb 17, 2017
433daf4
Many corrections in string refinement
romainbrenguier Feb 28, 2017
a31a4eb
Need to assign length before calls since it can be overwritten by fun…
romainbrenguier Mar 22, 2017
fa35841
const refs and clean up
Mar 23, 2017
201e79e
Adding refined_string_type to util Makefile
romainbrenguier Feb 27, 2017
f954a86
Adding string preprocessing of goto-programs to Makefile
romainbrenguier Jan 10, 2017
1eee909
Adding string solver cpp files to Makefile
romainbrenguier Jan 10, 2017
2b34b4e
Adding the string refinement option to the CBMC solvers
romainbrenguier Jan 10, 2017
7ecb16f
Change option name to --refine-strings
Mar 23, 2017
591a8db
Restructuration of tests on strings
Feb 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added regression/cbmc-java/assume1/Assume1.class
Binary file not shown.
10 changes: 10 additions & 0 deletions regression/cbmc-java/assume1/Assume1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.cprover.CProver;

class Assume1
{
static void foo(int x)
{
CProver.assume(x>3);
assert x>0;
}
}
8 changes: 8 additions & 0 deletions regression/cbmc-java/assume1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Assume1.class
--function Assume1.foo
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
Binary file added regression/cbmc-java/assume2/Assume2.class
Binary file not shown.
10 changes: 10 additions & 0 deletions regression/cbmc-java/assume2/Assume2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.cprover.CProver;

class Assume2
{
static void foo(int x)
{
CProver.assume(x>3);
assert x>4;
}
}
8 changes: 8 additions & 0 deletions regression/cbmc-java/assume2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Assume2.class
--function Assume2.foo
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
^warning: ignoring
Binary file added regression/cbmc-java/assume3/Assume3.class
Binary file not shown.
10 changes: 10 additions & 0 deletions regression/cbmc-java/assume3/Assume3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.cprover.CProver;

class Assume3
{
public static void main(String[] args)
{
CProver.assume(false);
assert false;
}
}
8 changes: 8 additions & 0 deletions regression/cbmc-java/assume3/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Assume3.class

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
Binary file added regression/cbmc-java/covered1/covered1.class
Binary file not shown.
37 changes: 37 additions & 0 deletions regression/cbmc-java/covered1/covered1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
public class covered1
{
// this is a variable
int x=1;
//these are two, one line off the first
int y=2;
int z=3;
//this is part of static init
static int z0=0;

//another non-static
int a;
int b;
static boolean odd;

static
{
odd=(z0+1)%2==0;
}

covered1(int a, int b)
{
this.a=a*b;
this.b=a+b;
if(this.a==a)
z0++;
else
odd=!odd;
}
// at the back
int z1=2;
int z2=3;
int z3=4;
//
static int z4=5;
int z5=5;
}
19 changes: 19 additions & 0 deletions regression/cbmc-java/covered1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CORE
covered1.class
--cover location --json-ui --show-properties
^EXIT=0$
^SIGNAL=0$
.*\"coveredLines\": \"22\",$
.*\"coveredLines\": \"4,6,7,23-25,31-33,36\",$
.*\"coveredLines\": \"26\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"29\",$
.*\"coveredLines\": \"9,18\",$
.*\"coveredLines\": \"18\",$
.*\"coveredLines\": \"18\",$
.*\"coveredLines\": \"18,35\",$
--
^warning: ignoring
9 changes: 9 additions & 0 deletions regression/strings-smoke-tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

test:
@../test.pl -c ../../../src/cbmc/cbmc

testfuture:
@../test.pl -c ../../../src/cbmc/cbmc -CF

testall:
@../test.pl -c ../../../src/cbmc/cbmc -CFTK
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_append_char/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_append_char.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
public class test_append_char
{
public static void main(/*String[] args*/)
{
char[] diff = {'d', 'i', 'f', 'f'};
char[] blue = {'b', 'l', 'u', 'e'};

StringBuilder buffer = new StringBuilder();

buffer.append(diff)
.append(blue);

String tmp=buffer.toString();
System.out.println(tmp);
assert tmp.equals("diffblue");
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_append_int/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_append_int.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class test_append_int
{
public static void main(/*String[] args*/)
{
StringBuilder diffblue = new StringBuilder();
diffblue.append("d");
diffblue.append(4);
String s = diffblue.toString();
assert s.equals("d4");
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_append_object/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_append_object.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
public class test_append_object
{
public static void main(/*String[] args*/)
{
Object diff = "diff";
Object blue = "blue";

StringBuilder buffer = new StringBuilder();

buffer.append(diff)
.append(blue);

String tmp=buffer.toString();
System.out.println(tmp);
assert tmp.equals("diffblue");
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_append_string/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_append_string.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
public class test_append_string
{
public static void main(/*String[] args*/)
{
String di = new String("di");
StringBuilder diff = new StringBuilder();
diff.append(di);
diff.append("ff");
System.out.println(diff);
String s = diff.toString();
System.out.println(s);
assert s.equals("diff");
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_case/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_case.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
12 changes: 12 additions & 0 deletions regression/strings-smoke-tests/java_case/test_case.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class test_case
{
public static void main(/*String[] argv*/)
{
String s = new String("Ab");
String l = s.toLowerCase();
String u = s.toUpperCase();
assert(l.equals("ab"));
assert(u.equals("AB"));
assert(s.equalsIgnoreCase("aB"));
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_char_array/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_char_array.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public class test_char_array
{
public static void main(/*String[] argv*/)
{
String s = "abc";
char [] str = s.toCharArray();
char c = str[2];
char a = s.charAt(0);
assert(str.length == 3);
assert(a == 'a');
assert(c == 'c');
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_char_array_init/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_init.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
21 changes: 21 additions & 0 deletions regression/strings-smoke-tests/java_char_array_init/test_init.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
public class test_init {

public static void main(/*String[] argv*/)
{
char [] str = new char[10];
str[0] = 'H';
str[1] = 'e';
str[2] = 'l';
str[3] = 'l';
str[4] = 'o';
String s = new String(str);
String t = new String(str,1,2);

System.out.println(s.length());
assert(s.length() == 10);
System.out.println(s);
System.out.println(t);
assert(t.equals("el"));
assert(s.startsWith("Hello"));
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_char_at/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_char_at.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_char_at/test_char_at.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class test_char_at {

public static void main(/*String[] argv*/) {
String s = new String("abc");
assert(s.charAt(2)=='c');
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_code_point/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_code_point.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
public class test_code_point
{
public static void main(/*String[] argv*/)
{
String s = "!𐤇𐤄𐤋𐤋𐤅";
assert(s.codePointAt(1) == 67847);
assert(s.codePointBefore(3) == 67847);
assert(s.codePointCount(1,5) >= 2);
assert(s.offsetByCodePoints(1,2) >= 3);
StringBuilder sb = new StringBuilder();
sb.appendCodePoint(0x10907);
assert(s.charAt(1) == sb.charAt(0));
}
}
7 changes: 7 additions & 0 deletions regression/strings-smoke-tests/java_compare/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUTURE
test_compare.class
--refine-strings
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
Binary file not shown.
9 changes: 9 additions & 0 deletions regression/strings-smoke-tests/java_compare/test_compare.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
public class test_compare
{
public static void main(/*String[] argv*/)
{
String s1 = "ab";
String s2 = "aa";
assert(s1.compareTo(s2) == 1);
}
}
8 changes: 8 additions & 0 deletions regression/strings-smoke-tests/java_concat/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FUTURE
test_concat.class
--refine-strings
^EXIT=10$
^SIGNAL=0$
^\[.*assertion.1\].* line 10.* SUCCESS$
^\[.*assertion.2\].* line 11.* FAILURE$
--
Binary file not shown.
13 changes: 13 additions & 0 deletions regression/strings-smoke-tests/java_concat/test_concat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public class test_concat
{
public static void main(/*String[] argv*/)
{
String s = new String("pi");
int i = s.length();
String t = new String("ppo");
String u = s.concat(t);
char c = u.charAt(i);
assert(c == 'p');
assert(c == 'o');
}
}
8 changes: 8 additions & 0 deletions regression/strings-smoke-tests/java_contains/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FUTURE
test_contains.class
--refine-strings
^EXIT=10$
^SIGNAL=0$
^\[.*assertion.1\].* line 8.* SUCCESS$
^\[.*assertion.2\].* line 9.* FAILURE$
--
Binary file not shown.
11 changes: 11 additions & 0 deletions regression/strings-smoke-tests/java_contains/test_contains.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class test_contains
{
public static void main(/*String[] argv*/)
{
String s = new String("Abc");
String u = "bc";
String t = "ab";
assert(s.contains(u));
assert(s.contains(t));
}
}
Loading