diff options
Diffstat (limited to 'project2/sql/unittests/testmysql.cpp')
-rw-r--r-- | project2/sql/unittests/testmysql.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/project2/sql/unittests/testmysql.cpp b/project2/sql/unittests/testmysql.cpp index 4debd35..6cbc440 100644 --- a/project2/sql/unittests/testmysql.cpp +++ b/project2/sql/unittests/testmysql.cpp @@ -46,12 +46,13 @@ BOOST_AUTO_TEST_CASE( bindAndSend ) RdbmsDataSource * ds = CommonObjects::dataSource<RdbmsDataSource>("mysqlmock"); auto rw = ds->getWritable(); - auto mod = rw->newModifyCommand("INSERT INTO test VALUES(?, ?, ?, ?, ?)"); + auto mod = rw->newModifyCommand("INSERT INTO test VALUES(?, ?, ?, ?, ?, ?)"); mod->bindParamI(0, testInt); mod->bindParamF(1, testDouble); mod->bindParamS(2, testString); - mod->bindParamT(3, testDateTime); - mod->bindParamT(4, testInterval); + mod->bindParamB(3, testBool); + mod->bindParamT(4, testDateTime); + mod->bindParamT(5, testInterval); mod->execute(); delete mod; ds->commit(); @@ -80,8 +81,9 @@ BOOST_AUTO_TEST_CASE( bindAndSelect ) assertColumnValueHelper(*select, 0, testInt); assertColumnValueHelper(*select, 1, testDouble); assertColumnValueHelper(*select, 2, testString); - assertColumnValueHelper(*select, 3, testDateTime); - assertColumnValueHelper(*select, 4, testInterval); + assertColumnValueHelper(*select, 3, testBool); + assertColumnValueHelper(*select, 4, testDateTime); + assertColumnValueHelper(*select, 5, testInterval); rows += 1; } delete select; @@ -102,8 +104,9 @@ BOOST_AUTO_TEST_CASE( bindAndSelectOther ) assertColumnValueHelper(*select, 0, 4); assertColumnValueHelper(*select, 1, 123.45); assertColumnValueHelper(*select, 2, std::string("some text")); - assertColumnValueHelper(*select, 3, boost::posix_time::ptime_from_tm({ 3, 6, 23, 27, 3, 115, 0, 0, 0, 0, 0})); - assertColumnValueHelper(*select, 4, boost::posix_time::time_duration(38, 13, 12)); + assertColumnValueHelper(*select, 3, true); + assertColumnValueHelper(*select, 4, boost::posix_time::ptime_from_tm({ 3, 6, 23, 27, 3, 115, 0, 0, 0, 0, 0})); + assertColumnValueHelper(*select, 5, boost::posix_time::time_duration(38, 13, 12)); rows += 1; } delete select; |