[glom] tests: Add: test_selfhosting_new_from_example_float.cc



commit 7fbb9d69d491d40e86e39ad80639e564458fbfd5
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Jan 6 14:40:10 2013 +0100

    tests: Add: test_selfhosting_new_from_example_float.cc
    
            * Makefile_tests.am:
            * tests/test_selfhosting_utils.[h|cc]:
    Add test_check_numeric_value_type().
            * tests/test_selfhosting_new_from_example_float.cc: Add
    this simple test that gets a float value, to check that
    we do not lose precision. It seems to fail with MySQL.
    It also seems to cause a crash or hang with PostgreSQL
    during cleanup.

 tests/test_selfhosting_utils.cc |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_selfhosting_utils.cc b/tests/test_selfhosting_utils.cc
index 1068d94..a09c986 100644
--- a/tests/test_selfhosting_utils.cc
+++ b/tests/test_selfhosting_utils.cc
@@ -560,6 +560,11 @@ bool test_check_numeric_value_type(Glom::Document::HostingMode hosting_mode, con
   {
     if(gtype == G_TYPE_DOUBLE)
       return true;
+  } else if( (hosting_mode == Glom::Document::HOSTING_MODE_MYSQL_CENTRAL) ||
+    (hosting_mode == Glom::Document::HOSTING_MODE_MYSQL_SELF) )
+  {
+    if(gtype == G_TYPE_FLOAT)
+      return true;
   }
 
   //The normal type for PostgreSQL:



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