summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-02-07 13:28:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-02-07 13:28:12 +0000
commitbe8f188d3da3feea104f67209d0e0434272d8d18 (patch)
treeeddd03a129c256b04d0ec08a772cb94327a7c4e8 /luni
parent26ac40d47785183b601a83b70b24e77f5abf0edc (diff)
parent0bb999c4d83b41e9d65735c417cae212bfab7d61 (diff)
downloadlibcore-be8f188d3da3feea104f67209d0e0434272d8d18.zip
libcore-be8f188d3da3feea104f67209d0e0434272d8d18.tar.gz
libcore-be8f188d3da3feea104f67209d0e0434272d8d18.tar.bz2
Merge "Making SelectorTest.testInterrupted() clearer."
Diffstat (limited to 'luni')
-rw-r--r--luni/src/test/java/libcore/java/nio/channels/SelectorTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/luni/src/test/java/libcore/java/nio/channels/SelectorTest.java b/luni/src/test/java/libcore/java/nio/channels/SelectorTest.java
index 8e5d38e..24751c2 100644
--- a/luni/src/test/java/libcore/java/nio/channels/SelectorTest.java
+++ b/luni/src/test/java/libcore/java/nio/channels/SelectorTest.java
@@ -93,15 +93,16 @@ public class SelectorTest extends TestCase {
// http://code.google.com/p/android/issues/detail?id=15388
public void testInterrupted() throws IOException {
Selector selector = Selector.open();
+ Thread.currentThread().interrupt();
try {
- Thread.currentThread().interrupt();
int count = selector.select();
assertEquals(0, count);
assertTrue(Thread.currentThread().isInterrupted());
} finally {
+ // Clear the interrupted thread state so that it does not interfere with later tests.
+ Thread.interrupted();
+
selector.close();
- // Clear the interrupted thread state so it does not interfere with later tests.
- assertTrue(Thread.interrupted());
}
}