summaryrefslogtreecommitdiffstats
path: root/luni/src/test/java/tests
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2013-11-15 10:24:17 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-11-15 10:24:18 +0000
commitfdcf091526352022bd3d7314f2bbc90656be0d9c (patch)
treea962bd5e3075286b5582135845aa2a6b47bdc445 /luni/src/test/java/tests
parentd7613be956eb5b004df64cdb99ba05c78f4ff1de (diff)
parentc1da67ccdcb017d0bb3e09ee309cbb9497c96e23 (diff)
downloadlibcore-fdcf091526352022bd3d7314f2bbc90656be0d9c.tar.gz
libcore-fdcf091526352022bd3d7314f2bbc90656be0d9c.tar.bz2
libcore-fdcf091526352022bd3d7314f2bbc90656be0d9c.zip
Merge "Fix FileInputStreamTest"
Diffstat (limited to 'luni/src/test/java/tests')
-rw-r--r--luni/src/test/java/tests/api/java/io/FileInputStreamTest.java21
1 files changed, 4 insertions, 17 deletions
diff --git a/luni/src/test/java/tests/api/java/io/FileInputStreamTest.java b/luni/src/test/java/tests/api/java/io/FileInputStreamTest.java
index 0b9036ec1..031cd393f 100644
--- a/luni/src/test/java/tests/api/java/io/FileInputStreamTest.java
+++ b/luni/src/test/java/tests/api/java/io/FileInputStreamTest.java
@@ -17,18 +17,15 @@
package tests.api.java.io;
+import junit.framework.TestCase;
+import tests.support.Support_PlatformFile;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
-import java.io.FilePermission;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.security.Permission;
-
-import junit.framework.TestCase;
-import tests.support.Support_PlatformFile;
public class FileInputStreamTest extends TestCase {
@@ -123,27 +120,17 @@ public class FileInputStreamTest extends TestCase {
// Regression test for HARMONY-6642
FileInputStream fis1 = new FileInputStream(fileName);
FileInputStream fis2 = new FileInputStream(fis1.getFD());
+
try {
fis2.close();
+ // Should not throw, since the FD is owned by fis1.
fis1.read();
- fail("fd sharing error");
- } catch (IOException expected) {
} finally {
try {
fis1.close();
} catch (IOException e) {
}
}
-
- // TODO: how does this differ from the test above?
- FileInputStream stdin = new FileInputStream(FileDescriptor.in);
- stdin.close();
- stdin = new FileInputStream(FileDescriptor.in);
- try {
- stdin.read();
- fail();
- } catch (IOException expected) {
- }
}
/**