summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-05-02 02:43:59 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-05-02 02:43:59 +0100
commita725c0b29f56bd25c5c0b836858604c3a002d6cb (patch)
treecbd5eda841dbf6bb87cb22d39fc94149655f7112
parentRemove the untested boolean column (diff)
downloadproject2-a725c0b29f56bd25c5c0b836858604c3a002d6cb.tar.bz2
project2-a725c0b29f56bd25c5c0b836858604c3a002d6cb.tar.xz
project2-a725c0b29f56bd25c5c0b836858604c3a002d6cb.zip
Assert the row in the init script
-rw-r--r--project2/sql/unittests/testpq.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/project2/sql/unittests/testpq.cpp b/project2/sql/unittests/testpq.cpp
index 03ae252..9d2367e 100644
--- a/project2/sql/unittests/testpq.cpp
+++ b/project2/sql/unittests/testpq.cpp
@@ -89,5 +89,27 @@ BOOST_AUTO_TEST_CASE( bindAndSelect )
ds->close();
}
+BOOST_AUTO_TEST_CASE( bindAndSelectOther )
+{
+ RdbmsDataSource * ds = CommonObjects::dataSource<RdbmsDataSource>("pqmock");
+ auto ro = ds->getReadonly();
+
+ auto select = ro->newSelectCommand("SELECT * FROM test WHERE id != ?");
+ select->bindParamI(0, testInt);
+ select->execute();
+ int rows = 0;
+ while (select->fetch()) {
+ 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));
+ rows += 1;
+ }
+ delete select;
+ BOOST_REQUIRE_EQUAL(1, rows);
+ ds->close();
+}
+
BOOST_AUTO_TEST_SUITE_END();