Skip to content

Tests for constant propagation of append(Object) #5122

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
public class Test
{
public void testSuccess()
{
StringBuffer sb = new StringBuffer("abc");
Integer i = new Integer(3);
sb.append(i);
assert sb.toString().equals("abc3");

sb.append((Object)"xyz");
assert sb.toString().equals("abc3xyz");

sb.append((Object)null);
assert sb.toString().equals("abc3xyznull");
}

public void testNoPropagation(Object obj)
{
StringBuffer sb = new StringBuffer();
assert obj.toString().equals("");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE symex-driven-lazy-loading-expected-failure
Test.class
--function Test.testNoPropagation --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar` --property 'java::Test.testNoPropagation:(Ljava/lang/Object;)V.assertion.1'
^Generated [0-9]+ VCC\(s\), 1 remaining after simplification$
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
Test.class
--function Test.testSuccess --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
--
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
public class Test
{
public void testSuccess()
{
StringBuilder sb = new StringBuilder("abc");
Integer i = new Integer(3);
sb.append(i);
assert sb.toString().equals("abc3");

sb.append((Object)"xyz");
assert sb.toString().equals("abc3xyz");

sb.append((Object)null);
assert sb.toString().equals("abc3xyznull");
}

public void testNoPropagation(Object obj)
{
StringBuilder sb = new StringBuilder();
assert obj.toString().equals("");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE symex-driven-lazy-loading-expected-failure
Test.class
--function Test.testNoPropagation --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar` --property 'java::Test.testNoPropagation:(Ljava/lang/Object;)V.assertion.1'
^Generated [0-9]+ VCC\(s\), 1 remaining after simplification$
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
Test.class
--function Test.testSuccess --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
^Generated [0-9]+ VCC\(s\), 0 remaining after simplification$
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
--