commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io EndianUtilsTest.java
Date Fri, 02 Jan 2004 06:44:27 GMT
bayard      2004/01/01 22:44:26

  Modified:    io/src/test/org/apache/commons/io EndianUtilsTest.java
  Log:
  Implemented tests for the unsigned methods and removed the todo comments
  
  Revision  Changes    Path
  1.8       +13 -8     jakarta-commons-sandbox/io/src/test/org/apache/commons/io/EndianUtilsTest.java
  
  Index: EndianUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/EndianUtilsTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EndianUtilsTest.java	30 Dec 2003 15:26:59 -0000	1.7
  +++ EndianUtilsTest.java	2 Jan 2004 06:44:26 -0000	1.8
  @@ -136,6 +136,11 @@
           assertEquals( 0x01, bytes[1] );
       }
   
  +    public void testReadSwappedUnsignedShort() {
  +        byte[] bytes = new byte[] { 0x02, 0x01 };
  +        assertEquals( 0x00000102, EndianUtils.readSwappedUnsignedShort( bytes, 0 ) );
  +    }
  +
       public void testReadSwappedInteger() {
           byte[] bytes = new byte[] { 0x04, 0x03, 0x02, 0x01 };
           int ln = EndianUtils.readSwappedInteger( bytes, 0 );
  @@ -151,7 +156,10 @@
           assertEquals( 0x01, bytes[3] );
       }
   
  -    // TODO: public void testWriteUnsignedInteger
  +    public void testReadSwappedUnsignedInteger() {
  +        byte[] bytes = new byte[] { 0x04, 0x03, 0x02, 0x01 };
  +        assertEquals( 0x0000000001020304L, EndianUtils.readSwappedUnsignedInteger( bytes,
0 ) );
  +    }
   
       public void testReadSwappedLong() {
           byte[] bytes = new byte[] { 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01 };
  @@ -211,9 +219,6 @@
   
       /*
       // TODO:
  -
  -    // All readSwappedXxxx(byte[], int)
  -    // All writeSwappedXxxx(byte[], int, xxxx)
       // All readSwappedXxxx(InputStream)
       // All writeSwappedXxxx(OutputStream, xxxx)
       */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message