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:
Glen Stampoultzis 2002-04-22 10:20:04 +00:00
parent a9ae23d284
commit 0eaa163e10
2 changed files with 22 additions and 1 deletions

View File

@ -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;
}

View 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);
}
}