File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919import java .io .ByteArrayInputStream ;
2020import java .io .ByteArrayOutputStream ;
21+ import java .io .EOFException ;
2122import java .io .IOException ;
2223
2324import 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 ) );
You can’t perform that action at this time.
0 commit comments