Skip to content

Commit 6a60c3a

Browse files
committed
Improve code coverage.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1021989 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8698ec2 commit 6a60c3a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/EndianUtilsTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.ByteArrayInputStream;
2020
import java.io.ByteArrayOutputStream;
21+
import java.io.EOFException;
2122
import java.io.IOException;
2223

2324
import junit.framework.TestCase;
@@ -31,6 +32,21 @@ public EndianUtilsTest(String name) {
3132
super(name);
3233
}
3334

35+
public void testCtor() throws IOException {
36+
new EndianUtils();
37+
// Constructor does not blow up.
38+
}
39+
40+
public void testEOFException() throws IOException {
41+
ByteArrayInputStream input = new ByteArrayInputStream(new byte[] {});
42+
try {
43+
EndianUtils.readSwappedDouble(input);
44+
fail("Expected EOFException");
45+
} catch (EOFException e) {
46+
// expected
47+
}
48+
}
49+
3450
public void testSwapShort() {
3551
assertEquals( (short) 0, EndianUtils.swapShort( (short) 0 ) );
3652
assertEquals( (short) 0x0201, EndianUtils.swapShort( (short) 0x0102 ) );

0 commit comments

Comments
 (0)