proper bool support

This commit is contained in:
Aleksandar Fabijanic
2007-09-22 01:20:20 +00:00
parent 40c0f41fa0
commit 228d48ad14
24 changed files with 442 additions and 29 deletions

View File

@@ -1070,6 +1070,21 @@ void ODBCSQLServerTest::testRowIterator()
}
void ODBCSQLServerTest::testStdVectorBool()
{
if (!_pSession) fail ("Test not available.");
for (int i = 0; i < 8;)
{
recreateBoolTable();
_pSession->setFeature("autoBind", bindValues[i]);
_pSession->setFeature("autoExtract", bindValues[i+1]);
_pExecutor->stdVectorBool();
i += 2;
}
}
void ODBCSQLServerTest::dropObject(const std::string& type, const std::string& name)
{
try
@@ -1190,6 +1205,14 @@ void ODBCSQLServerTest::recreateNullsTable(const std::string& notNull)
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateNullsTable()"); }
}
void ODBCSQLServerTest::recreateBoolTable()
{
dropObject("TABLE", "BoolTest");
try { *_pSession << "CREATE TABLE BoolTest (b BIT)", now; }
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateBoolTable()"); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateBoolTable()"); }
}
bool ODBCSQLServerTest::canConnect(const std::string& driver, const std::string& dsn)
{
@@ -1338,6 +1361,7 @@ CppUnit::Test* ODBCSQLServerTest::suite()
CppUnit_addTest(pSuite, ODBCSQLServerTest, testInternalStorageType);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testNull);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testRowIterator);
CppUnit_addTest(pSuite, ODBCSQLServerTest, testStdVectorBool);
return pSuite;
}