Re-implemented Float#to_eet_chunks in C.
[ruby-eet.git] / test / test_basic.rb
index 73a30bcf024d9c38e6b992577cddd98f223ded89..017cdf63c3e4f9e1eef0d575acc254002e98d6c0 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: test_basic.rb 1 2005-03-26 01:45:38Z tilman $
+# $Id: test_basic.rb 59 2005-06-08 16:13:15Z tilman $
 
 require "eet"
 require "test/unit"
@@ -11,8 +11,7 @@ class BasicTestData
                @int = 1024
                @long_long = (2 << 63) - 1
                @flag = true
-               @float = 1234.0
-               @double = 12341234.0
+               @float = 1234.12424213138
        end
 
        private
@@ -27,7 +26,7 @@ class BasicTestData
                 "i64" => [@long_long, :long_long],
                 "flag" => [@flag],
                 "f32" => [@float],
-                "f64" => [@double, :double]}
+                "f64" => [@float, :double]}
        end
 end
 
@@ -54,8 +53,8 @@ class BasicTest < Test::Unit::TestCase
                values = {"name" => "moo\0",
                          "i16" => "\0\2", "i32" => "\0\4\0\0",
                          "i64" => "\377" * 8, "flag" => "\1",
-                         "f32" => "1234." + ("0" * 16) + "\0",
-                         "f64" => "12341234." + ("0" * 32) + "\0"}
+                         "f32" => "0x1.3487f4p+10\0",
+                         "f64" => "0x1.3487f39544c4p+10\0"}
                values.each do |k, v|
                        found = stream.find { |c| c.tag == k }
                        assert_not_nil(found, "chunk not found - #{k}")