vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java
branchjavap
changeset 181 f426de5dc7f6
parent 178 28143312edb5
child 185 d441042e6c11
     1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java	Sun Nov 18 08:41:08 2012 +0100
     1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java	Sun Nov 18 10:00:23 2012 +0100
     1.3 @@ -64,6 +64,26 @@
     1.4              Double.valueOf(3.0), 303, 10
     1.5          );
     1.6      }
     1.7 +    
     1.8 +    @Test public void deserializeInt() throws Exception {
     1.9 +        int exp = Numbers.deserInt();
    1.10 +        assertExec("Should be the same", "org_apidesign_vm4brwsr_Numbers_deserIntI", 
    1.11 +            Double.valueOf(exp)
    1.12 +        );
    1.13 +    }
    1.14 +    
    1.15 +    @Test public void deserializeFloatInJava() throws Exception {
    1.16 +        float f = 54324.32423f;
    1.17 +        float r = Numbers.deserFloat();
    1.18 +        assertEquals(r, f, "Floats are the same");
    1.19 +    }
    1.20 +    
    1.21 +    @Test public void deserializeFloatInJS() throws Exception {
    1.22 +        float f = 54324.32423f;
    1.23 +        assertExec("Should be the same", "org_apidesign_vm4brwsr_Numbers_deserFloatF", 
    1.24 +            Double.valueOf(f)
    1.25 +        );
    1.26 +    }
    1.27  
    1.28      
    1.29      private static CharSequence codeSeq;