-
Notifications
You must be signed in to change notification settings - Fork 284
Add regression tests for [TG-8284] #4939
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
Merged
danpoe
merged 5 commits into
diffblue:develop
from
yumibagge:yb/jbmc-regression-tg-8284
Jul 26, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0180113
Rename folder name more descriptive
yumibagge c33a1dc
Clang-format original regression tests
yumibagge 09724a8
Add a regression test that uses models-library
yumibagge bb28bf8
Add a regression test with Character type
yumibagge 5352996
Add a test to check verification failure
yumibagge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file renamed
BIN
+846 Bytes
...ngs/IndexOfConstantEvaluation1/Main.class → ...xOfConstantEvaluation01-String/Main.class
Binary file not shown.
14 changes: 14 additions & 0 deletions
14
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation01-String/Main.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| public class Main { | ||
|
|
||
| public void constantIndexOf() { | ||
| String s1 = "abcabc"; | ||
| String s2 = "bc"; | ||
| assert s1.indexOf(s2) == 1; | ||
| assert s1.indexOf(s2, -10) == 1; | ||
| assert s1.indexOf("") == 0; | ||
| assert s1.indexOf(s2, 3) == 4; | ||
| assert s1.indexOf("cd") == -1; | ||
| assert s1.indexOf(s2, 10) == -1; | ||
| assert s1.indexOf("", 10) == -1; | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation01-String/test-models-library.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| CORE symex-driven-lazy-loading-expected-failure | ||
| Main.class | ||
| --function Main.constantIndexOf --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar` | ||
| ^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$ | ||
| ^VERIFICATION SUCCESSFUL$ | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| -- | ||
| -- |
File renamed without changes.
Binary file renamed
BIN
+725 Bytes
...ngs/IndexOfConstantEvaluation2/Main.class → ...dexOfConstantEvaluation02-char/Main.class
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation02-char/Main.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| public class Main { | ||
|
|
||
| public void constantIndexOf() { | ||
| String s1 = "abcabc"; | ||
| assert s1.indexOf('b') == 1; | ||
| assert s1.indexOf('b', -10) == 1; | ||
| assert s1.indexOf('b', 3) == 4; | ||
| assert s1.indexOf('d') == -1; | ||
| assert s1.indexOf('b', 10) == -1; | ||
| } | ||
| } |
File renamed without changes.
Binary file renamed
BIN
+629 Bytes
...ngs/IndexOfConstantEvaluation3/Main.class → ...ntEvaluation03-IndexOutOfRange/Main.class
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation03-IndexOutOfRange/Main.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| public class Main { | ||
|
|
||
| public void constantIndexOf(String arg) { | ||
| String s1 = "abcabc"; | ||
| assert s1.indexOf(arg, 10) == -1; | ||
| } | ||
| } |
File renamed without changes.
Binary file renamed
BIN
+1.03 KB
...ngs/IndexOfConstantEvaluation4/Main.class → ...Evaluation04-NegativeScenarios/Main.class
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation04-NegativeScenarios/Main.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| public class Main { | ||
|
|
||
| public void constantIndexOf(String s, char c, int i) { | ||
|
|
||
| String s1 = "abcabc"; | ||
| String s2 = "bc"; | ||
|
|
||
| assert s1.indexOf(c) == 1; | ||
| assert s1.indexOf(s) == 1; | ||
| assert s1.indexOf(c, 1) == 1; | ||
| assert s1.indexOf(s, 1) == 1; | ||
|
|
||
| assert s.indexOf('a') == 1; | ||
| assert s.indexOf(s1) == 1; | ||
| assert s.indexOf('a', 1) == 1; | ||
| assert s.indexOf(s1, 1) == 1; | ||
|
|
||
| assert s1.indexOf(s, -10) == 1; | ||
| assert s1.indexOf(c, -10) == 1; | ||
|
|
||
| assert s1.indexOf(s2, i) == 1; | ||
| assert s1.indexOf('a', i) == 1; | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+820 Bytes
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation05-Character/Main.class
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation05-Character/Main.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| public class Main { | ||
|
|
||
| public void constantIndexOf() { | ||
| String s1 = "abcabc"; | ||
| Character b = 'b'; | ||
| assert s1.indexOf(b) == 1; | ||
| assert s1.indexOf(b, -10) == 1; | ||
| assert s1.indexOf(b, 3) == 4; | ||
| assert s1.indexOf(b, 10) == -1; | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation05-Character/test-models-library.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| CORE symex-driven-lazy-loading-expected-failure | ||
| Main.class | ||
| --function Main.constantIndexOf --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar` | ||
| ^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$ | ||
| ^VERIFICATION SUCCESSFUL$ | ||
| ^EXIT=0$ | ||
| ^SIGNAL=0$ | ||
| -- | ||
| -- |
Binary file added
BIN
+609 Bytes
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation06-AssertionFailure/Main.class
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation06-AssertionFailure/Main.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| public class Main { | ||
|
|
||
| public void constantIndexOf() { | ||
| String s1 = "abcabc"; | ||
| assert s1.indexOf("") == -1; | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation06-AssertionFailure/test.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| CORE symex-driven-lazy-loading-expected-failure | ||
| Main.class | ||
| --function Main.constantIndexOf --property "java::Main.constantIndexOf:()V.assertion.1" | ||
| ^Generated [0-9]+ VCC\(s\), 1 remaining after simplification$ | ||
| ^VERIFICATION FAILED$ | ||
| ^EXIT=10$ | ||
| ^SIGNAL=0$ | ||
| -- | ||
| -- | ||
13 changes: 0 additions & 13 deletions
13
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation1/Main.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation2/Main.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation3/Main.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
jbmc/regression/jbmc-strings/IndexOfConstantEvaluation4/Main.java
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should specify which assertion you want to fail. It's probably good to use the
--propertyoption too, as you don't want to analyse the assertions that you expect to be successful.Look at the tests in https://github.com/diffblue/cbmc/tree/develop/jbmc/regression/jbmc-strings/CompareToConstantEvaluation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes ... it was pointed out by @danpoe when he explained to me about regression tests. I was just being lazy 😅 property added.