Date: Thursday, January 11, 2007 @ 23:30:59
Author: marc
Path: /cvsroot/carob/carob/test/40-Parameter-PreparedStatement
Modified: TestIEEE754.cpp (1.18 -> 1.19) TestIEEE754.hpp (1.4 -> 1.5)
Added testSimpleReceiveOnly()
-----------------+
TestIEEE754.cpp | 31 +++++++++++++++++++++++++++++++
TestIEEE754.hpp | 2 +-
2 files changed, 32 insertions(+), 1 deletion(-)
Index: carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp
diff -u carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp:1.18
carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp:1.19
--- carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp:1.18 Thu Jan
11 23:19:52 2007
+++ carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp Thu Jan 11
23:30:59 2007
@@ -138,6 +138,34 @@
} // unnamed namespace
+// send inline string to avoid setFloat()
+void
+TestIEEE754::testSimpleReceiveOnly()
+{
+ createOrReplaceTable(connectionPtr, TABLE_NAME, TABLE_TYPE);
+
+ // warning: it must be possible to write these in binary without any
rounding!
+ fd_t basicdata[] =
+ { { 0.0, 1.0 },
+ { 0, 0 } // END OF DATA
+ };
+
+ ParameterStatement *
+ insert(connectionPtr->
+ createParameterStatement(INSERT_STMT));
+
+ insert->setInt(1, 0);
+ // manual setString() to avoid setFloat()
+ insert->setString(2, std::wstring(L"0.0"));
+ insert->setString(3, std::wstring(L"1.0"));
+ int uc = insert->executeUpdate();
+ CPPUNIT_ASSERT(1 == uc);
+
+
+ read_compare(connectionPtr, basicdata);
+
+}
+
void
TestIEEE754::testBasic()
@@ -204,6 +232,9 @@
// TODO: check why mysql throws errors
#ifndef CAROB_TEST_USE_MYSQL
suiteOfTests->addTest(new CppUnit::TestCaller<TestIEEE754>(
+ "TestIEEE754::testSimpleReceiveOnly",
+ &TestIEEE754::testSimpleReceiveOnly));
+ suiteOfTests->addTest(new CppUnit::TestCaller<TestIEEE754>(
"TestIEEE754::testBasic",
&TestIEEE754::testBasic));
suiteOfTests->addTest(new CppUnit::TestCaller<TestIEEE754>(
Index: carob/test/40-Parameter-PreparedStatement/TestIEEE754.hpp
diff -u carob/test/40-Parameter-PreparedStatement/TestIEEE754.hpp:1.4
carob/test/40-Parameter-PreparedStatement/TestIEEE754.hpp:1.5
--- carob/test/40-Parameter-PreparedStatement/TestIEEE754.hpp:1.4 Thu Jul
27 17:10:53 2006
+++ carob/test/40-Parameter-PreparedStatement/TestIEEE754.hpp Thu Jan 11
23:30:59 2007
@@ -34,6 +34,7 @@
/** Suite of tests to be run */
static CppUnit::Test* suite();
+ void testSimpleReceiveOnly();
/**
* Write/read basic numbers such as types boundaries
*/
@@ -44,7 +45,6 @@
*/
void testInfNaN();
-
// void testInfinityNaN();
};
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits