Testcase for RKUtil
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352462 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c35a378148
commit
2c17d2c64a
@ -87,7 +87,7 @@ public class RKUtil
|
||||
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 @@ public class RKUtil
|
||||
// hall, especially if it's the city of Redmond
|
||||
rvalue /= 100;
|
||||
}
|
||||
|
||||
return rvalue;
|
||||
}
|
||||
|
||||
|
20
src/testcases/org/apache/poi/hssf/util/TestRKUtil.java
Normal file
20
src/testcases/org/apache/poi/hssf/util/TestRKUtil.java
Normal file
@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user