summaryrefslogtreecommitdiffstats
path: root/harmony-tests
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-05-12 15:00:57 +0100
committerNarayan Kamath <narayan@google.com>2014-05-13 11:03:05 +0000
commit5e303c68fd65e388d74f37bc6554713d07e559ac (patch)
tree962759c182caac40035b7dd5da829581edb0a69f /harmony-tests
parentc03fdbdeda2f1885039f51c7eb1527eac7078a2c (diff)
downloadlibcore-5e303c68fd65e388d74f37bc6554713d07e559ac.zip
libcore-5e303c68fd65e388d74f37bc6554713d07e559ac.tar.gz
libcore-5e303c68fd65e388d74f37bc6554713d07e559ac.tar.bz2
Fix tests that relied on ReferenceQueue ordering semantics.
Commit eb3e5888d4b3 changed ReferenceQueue from LIFO to FIFO. Fix tests that were expecting it to be LIFO. Change-Id: I222513ddb091755fb27294939beb6565b661dd3d
Diffstat (limited to 'harmony-tests')
-rw-r--r--harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/ReferenceQueueTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/ReferenceQueueTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/ReferenceQueueTest.java
index ba28541..75a5218 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/ReferenceQueueTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ref/ReferenceQueueTest.java
@@ -76,7 +76,8 @@ public class ReferenceQueueTest extends junit.framework.TestCase {
pr.enqueue();
try {
- assertNull("Remove failed.", rq.poll().get());
+ assertTrue("Remove failed.", ((Boolean) rq.poll().get())
+ .booleanValue());
} catch (Exception e) {
fail("Exception during the test : " + e.getMessage());
}
@@ -88,11 +89,11 @@ public class ReferenceQueueTest extends junit.framework.TestCase {
}
try {
- assertTrue("Remove failed.", ((Boolean) rq.poll().get())
- .booleanValue());
+ assertNull("Remove failed.", rq.poll().get());
} catch (Exception e) {
fail("Exception during the test : " + e.getMessage());
}
+
assertNull(rq.poll());
sr.enqueue();
@@ -182,11 +183,11 @@ public class ReferenceQueueTest extends junit.framework.TestCase {
try {
Reference result = rq.remove(1L);
- assertTrue((Boolean)result.get());
+ assertNull(result.get());
result = rq.remove(1L);
assertEquals(obj, result.get());
result = rq.remove(1L);
- assertNull(result.get());
+ assertTrue((Boolean)result.get());
} catch (IllegalArgumentException e1) {
fail("IllegalArgumentException was thrown.");
} catch (InterruptedException e1) {