Skip to content

Commit e3f2fe5

Browse files
committed
readFully tested
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@140536 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3115876 commit e3f2fe5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/test/org/apache/commons/io/input/SwappedDataInputStreamTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,20 @@
2929
* effectively tests the underlying EndianUtils Stream methods.
3030
*
3131
* @author Henri Yandell (bayard at apache dot org)
32-
* @version $Revision: 1.8 $ $Date: 2004/02/29 21:58:47 $
32+
* @version $Revision: 1.9 $ $Date: 2004/02/29 22:03:45 $
3333
*/
3434

3535
public class SwappedDataInputStreamTest extends TestCase {
3636

3737
private SwappedDataInputStream sdis;
38+
private byte[] bytes;
3839

3940
public SwappedDataInputStreamTest(String name) {
4041
super(name);
4142
}
4243

4344
public void setUp() {
44-
byte[] bytes = new byte[] {
45+
bytes = new byte[] {
4546
0x01,
4647
0x02,
4748
0x03,
@@ -79,10 +80,13 @@ public void testReadFloat() throws IOException {
7980
assertEquals( Float.intBitsToFloat(0x04030201), this.sdis.readFloat(), 0 );
8081
}
8182

82-
/*
8383
public void testReadFully() throws IOException {
84+
byte[] bytesIn = new byte[8];
85+
this.sdis.readFully(bytesIn);
86+
for( int i=0; i<8; i++) {
87+
assertEquals( bytes[i], bytesIn[i] );
88+
}
8489
}
85-
*/
8690

8791
public void testReadInt() throws IOException {
8892
assertEquals( (int) 0x04030201, this.sdis.readInt() );

0 commit comments

Comments
 (0)