-
Notifications
You must be signed in to change notification settings - Fork 273
Corrects integer/long conversion to string and add tests for StringBuilder.append(long) #1033
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
romainbrenguier
merged 8 commits into
diffblue:test-gen-support
from
romainbrenguier:feature/string-builder-appendJ#447
Jun 30, 2017
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
70d0cb0
Forgotten premise in add_axioms_from_int
romainbrenguier 8a80310
Correcting when to do overflow check in add_axioms_from_int
romainbrenguier 15e88e7
Making tests for int to string conversion more precise
romainbrenguier 7fa229b
Update comments in add_axioms_from_int to reflect changes in the code
romainbrenguier fb3ab81
Using PRECONDITION instead of assert
romainbrenguier eaad100
Comment on the bound for overflow in int to string conversion
romainbrenguier 4440343
Adding tests for String.valueOf(long)
romainbrenguier 20f3951
Correction of line numbers in valueOf(long) test
romainbrenguier 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
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
CORE | ||
test_int.class | ||
--refine-strings | ||
^EXIT=0$ | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
assertion.* file test_int.java line 6 .* SUCCESS$ | ||
assertion.* file test_int.java line 9 .* SUCCESS$ | ||
assertion.* file test_int.java line 11 .* FAILURE$ | ||
assertion.* file test_int.java line 13 .* FAILURE$ | ||
-- |
Binary file modified
BIN
+215 Bytes
(130%)
regression/strings-smoke-tests/java_int_to_string/test_int.class
Binary file not shown.
6 changes: 5 additions & 1 deletion
6
regression/strings-smoke-tests/java_int_to_string/test_int.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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
public class test_int | ||
{ | ||
public static void main(/*String[] argv*/) | ||
public static void main(int i) | ||
{ | ||
String s = Integer.toString(12); | ||
assert(s.equals("12")); | ||
String t = Integer.toString(-23); | ||
System.out.println(t); | ||
assert(t.equals("-23")); | ||
if(i==1) | ||
assert(!s.equals("12")); | ||
else if(i==2) | ||
assert(!t.equals("-23")); | ||
} | ||
} |
Binary file not shown.
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,8 @@ | ||
CORE | ||
test.class | ||
--refine-strings | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
assertion.* file test.java line 9 .* SUCCESS$ | ||
assertion.* file test.java line 14 .* FAILURE$ | ||
-- |
17 changes: 17 additions & 0 deletions
17
regression/strings-smoke-tests/java_value_of_long/test.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,17 @@ | ||
public class test | ||
{ | ||
public static void main(int i) | ||
{ | ||
long l1=12345678901234L; | ||
if(i == 0) | ||
{ | ||
String s = String.valueOf(l1); | ||
assert(s.equals("12345678901234")); | ||
} | ||
else | ||
{ | ||
String s = String.valueOf(-l1); | ||
assert(!s.equals("-12345678901234")); | ||
} | ||
} | ||
} |
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
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.
Same question as above
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.
There are already assertions which are supposed to pass above.