From f5a168f5841db6c0946e52a1a6c955187a3ad2d6 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Wed, 28 Dec 2011 23:58:33 -0700 Subject: [PATCH] Fixed tests for floatToIntBits. Probably want to add more comprehensive tests tomorrow (or today... as of 2 minutes) --- test/Floats.java | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/test/Floats.java b/test/Floats.java index e27e703d40..2494088b01 100644 --- a/test/Floats.java +++ b/test/Floats.java @@ -212,31 +212,26 @@ public class Floats { expect(d == 12345.0); } - { - int NaN = 0x7F800001; + { + int orig = 0x7f800001; + float NaN = Float.intBitsToFloat(orig); int result = Float.floatToIntBits(NaN); int expected = 0x7fc00000; - System.out.println("NaN integer is: " + result + " and we were expecting it to be: " + expected); expect(result == expected); } { - int number = 0x00800001; + int orig = 0x00800001; + float number = Float.intBitsToFloat(orig); int result = Float.floatToIntBits(number); - System.out.println("Number1 is: " + result); - - expect(result == number); - - + expect(result == orig); } { - int number = 0x80800003; + int orig = 0x80800003; + float number = Float.intBitsToFloat(orig); int result = Float.floatToIntBits(number); - System.out.println("Number2 is: " + result); - expect(result == number); - - + expect(result == orig); } } }