glens       02/04/22 03:20:04

  Modified:    src/java/org/apache/poi/hssf/util RKUtil.java
  Added:       src/testcases/org/apache/poi/hssf/util TestRKUtil.java
  Log:
  Testcase for RKUtil
  
  Revision  Changes    Path
  1.2       +2 -1      jakarta-poi/src/java/org/apache/poi/hssf/util/RKUtil.java
  
  Index: RKUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/util/RKUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RKUtil.java       22 Apr 2002 07:13:09 -0000      1.1
  +++ RKUtil.java       22 Apr 2002 10:20:04 -0000      1.2
  @@ -87,7 +87,7 @@
           if ((number & 0x02) == 0x02)
           {
               // ok, it's just a plain ol' int; we can handle this
  -            // trivially by right-shifting and casting
  +            // trivially by casting
               rvalue = ( double ) (raw_number);
           }
           else
  @@ -106,6 +106,7 @@
               // hall, especially if it's the city of Redmond
               rvalue /= 100;
           }
  +
           return rvalue;
       }
   
  
  
  
  1.1                  
jakarta-poi/src/testcases/org/apache/poi/hssf/util/TestRKUtil.java
  
  Index: TestRKUtil.java
  ===================================================================
  package org.apache.poi.hssf.util;
  
  import junit.framework.TestCase;
  
  public class TestRKUtil
          extends TestCase
  {
      public TestRKUtil(String s)
      {
          super(s);
      }
  
      public void testDecode()
              throws Exception
      {
          assertEquals(3.0, RKUtil.decodeNumber(1074266112), 0.0000001);
          assertEquals(3.3, RKUtil.decodeNumber(1081384961), 0.0000001);
          assertEquals(3.33, RKUtil.decodeNumber(1081397249), 0.0000001);
      }
  }
  
  
  


Reply via email to