[glom/glom-1-26] tests: Use double literal values instead of floats.



commit dd08c2ca76f51d9a2e11caf371e5058f14f2433e
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 25 11:14:04 2014 +0200

    tests: Use double literal values instead of floats.
    
    Because libgda seems to have started using more precision.

 ..._python_execute_func_with_record_field_types.cc |    2 +-
 tests/test_conversions.cc                          |    2 +-
 tests/test_field_file_format.cc                    |    2 +-
 tests/test_selfhosting_new_from_example_float.cc   |    2 +-
 tests/test_selfhosting_new_then_lookup.cc          |    2 +-
 tests/test_xml_utils.cc                            |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/tests/python/test_python_execute_func_with_record_field_types.cc 
b/tests/python/test_python_execute_func_with_record_field_types.cc
index 97dedaf..299f2f6 100644
--- a/tests/python/test_python_execute_func_with_record_field_types.cc
+++ b/tests/python/test_python_execute_func_with_record_field_types.cc
@@ -146,7 +146,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
   // Numeric:
   if(!get_field_result(document, gda_connection,
       table_name, primary_key_field, primary_key_value, field_values,
-      "price", Glom::Conversions::parse_value((double)3.50f)))
+      "price", Glom::Conversions::parse_value((double)3.50l)))
   {
     return false;
   }
diff --git a/tests/test_conversions.cc b/tests/test_conversions.cc
index 4a42b17..d8034fb 100644
--- a/tests/test_conversions.cc
+++ b/tests/test_conversions.cc
@@ -83,7 +83,7 @@ int main()
     return EXIT_FAILURE;
   */
 
-  if(!test_numeric_value((double)3.50f))
+  if(!test_numeric_value((double)3.50l))
     return EXIT_FAILURE;
 
 
diff --git a/tests/test_field_file_format.cc b/tests/test_field_file_format.cc
index da930cb..0fe45fa 100644
--- a/tests/test_field_file_format.cc
+++ b/tests/test_field_file_format.cc
@@ -85,7 +85,7 @@ int main()
   if(!test_value(Glom::Field::TYPE_TIME, Gnome::Gda::Value(time)))
     return EXIT_FAILURE;
 
-  if(!test_value(Glom::Field::TYPE_NUMERIC, Glom::Conversions::parse_value((double)3.91f)))
+  if(!test_value(Glom::Field::TYPE_NUMERIC, Glom::Conversions::parse_value((double)3.91l)))
     return EXIT_FAILURE;
 
 
diff --git a/tests/test_selfhosting_new_from_example_float.cc 
b/tests/test_selfhosting_new_from_example_float.cc
index 8e29ae7..1ccae53 100644
--- a/tests/test_selfhosting_new_from_example_float.cc
+++ b/tests/test_selfhosting_new_from_example_float.cc
@@ -90,7 +90,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
     return false;
   }
 
-  if(Glom::Conversions::get_double_for_gda_value_numeric(value) != 3.5f)
+  if(Glom::Conversions::get_double_for_gda_value_numeric(value) != 3.5l)
   {
     std::cerr << G_STRFUNC << ": Failure: The value has an unexpected value: " << value.to_string() << " 
instead of 3.5" << std::endl;
     std::cerr << G_STRFUNC << ":     value as string: " << value.to_string() << std::endl;
diff --git a/tests/test_selfhosting_new_then_lookup.cc b/tests/test_selfhosting_new_then_lookup.cc
index bf9e0ac..1bfadf4 100644
--- a/tests/test_selfhosting_new_then_lookup.cc
+++ b/tests/test_selfhosting_new_then_lookup.cc
@@ -188,7 +188,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
     return false;
   }
 
-  if(Glom::Conversions::get_double_for_gda_value_numeric(value) != 3.5f)
+  if(Glom::Conversions::get_double_for_gda_value_numeric(value) != 3.5l)
   {
     std::cerr << G_STRFUNC << ": Failure: The value has an unexpected value: " << value.to_string() << " 
instead of 3.5" << std::endl;
     std::cerr << G_STRFUNC << ":     value as string: " << value.to_string() << std::endl;
diff --git a/tests/test_xml_utils.cc b/tests/test_xml_utils.cc
index c90f64b..8d745fb 100644
--- a/tests/test_xml_utils.cc
+++ b/tests/test_xml_utils.cc
@@ -67,7 +67,7 @@ int main()
   if(!test_value(Glom::Field::TYPE_TIME, Gnome::Gda::Value(time)))
     return EXIT_FAILURE;
 
-  if(!test_value(Glom::Field::TYPE_NUMERIC, Glom::Conversions::parse_value((double)3.50f)))
+  if(!test_value(Glom::Field::TYPE_NUMERIC, Glom::Conversions::parse_value((double)3.50l)))
     return EXIT_FAILURE;
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]