summaryrefslogtreecommitdiffstats
path: root/test/003-omnibus-opcodes
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-02-03 17:48:41 -0800
committerMathieu Chartier <mathieuc@google.com>2014-02-04 13:38:57 -0800
commit7befd0e35bbed32b90bc0c8b6d3fa8bd612f5506 (patch)
treee6ec21b97eb4c68ecbf1056a6767f233c241eceb /test/003-omnibus-opcodes
parent9e64cabda36bd7b30f2fd873750fdc17e5931358 (diff)
downloadart-7befd0e35bbed32b90bc0c8b6d3fa8bd612f5506.zip
art-7befd0e35bbed32b90bc0c8b6d3fa8bd612f5506.tar.gz
art-7befd0e35bbed32b90bc0c8b6d3fa8bd612f5506.tar.bz2
Update ART tests to handle new System.gc behavior
Changed calls from System.gc to Runtime.getRuntime.gc where it was necessary. Required for: https://android-review.googlesource.com/#/c/80253/ Change-Id: I2b0622585da54229a6248e95d40134b6d18598a9
Diffstat (limited to 'test/003-omnibus-opcodes')
-rw-r--r--test/003-omnibus-opcodes/src/InternedString.java6
-rw-r--r--test/003-omnibus-opcodes/src/Main.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/test/003-omnibus-opcodes/src/InternedString.java b/test/003-omnibus-opcodes/src/InternedString.java
index 804564b..35812e6 100644
--- a/test/003-omnibus-opcodes/src/InternedString.java
+++ b/test/003-omnibus-opcodes/src/InternedString.java
@@ -34,14 +34,14 @@ public class InternedString {
private static void testDeadInternedString() {
WeakReference<String> strRef = makeWeakString();
- System.gc();
+ Runtime.getRuntime().gc();
// "blahblah" should disappear from the intern list
Main.assertTrue(strRef.get() == null);
}
private static void testImmortalInternedString() {
WeakReference strRef = new WeakReference<String>(CONST.intern());
- System.gc();
+ Runtime.getRuntime().gc();
// Class constant string should be entered to the interned table when
// loaded
Main.assertTrue(CONST == CONST.intern());
@@ -53,7 +53,7 @@ public class InternedString {
strRef = new WeakReference<String>(s.intern());
// Kill s, otherwise the string object is still accessible from root set
s = "";
- System.gc();
+ Runtime.getRuntime().gc();
Main.assertTrue(strRef.get() == CONST);
}
}
diff --git a/test/003-omnibus-opcodes/src/Main.java b/test/003-omnibus-opcodes/src/Main.java
index 5dcc79c..25050df 100644
--- a/test/003-omnibus-opcodes/src/Main.java
+++ b/test/003-omnibus-opcodes/src/Main.java
@@ -26,7 +26,7 @@ public class Main {
main.run();
/* run through the heap to see if we trashed something */
- System.gc();
+ Runtime.getRuntime().gc();
System.out.println("Done!");
}