From b45e81e87895b62d1c1f6e3acfa9e3f57176a346 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Nov 2015 02:31:42 +0000 Subject: Add boolean column to util test --- libdbpp/unittests/testUtils.cpp | 7 ++++--- libdbpp/unittests/util.sql | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libdbpp/unittests/testUtils.cpp b/libdbpp/unittests/testUtils.cpp index a2ac444..ba09580 100644 --- a/libdbpp/unittests/testUtils.cpp +++ b/libdbpp/unittests/testUtils.cpp @@ -21,14 +21,15 @@ BOOST_GLOBAL_FIXTURE( StandardMockDatabase ); BOOST_AUTO_TEST_CASE( forEachRow ) { auto db = DB::ConnectionPtr(DB::MockDatabase::openConnectionTo("pqmock")); - auto sel = DB::SelectCommandPtr(db->newSelectCommand("SELECT a, b, c, d, e FROM forEachRow ORDER BY a LIMIT 1")); - sel->forEachRow( - [](auto a, auto b, auto c, auto d, auto e) { + auto sel = DB::SelectCommandPtr(db->newSelectCommand("SELECT a, b, c, d, e, f FROM forEachRow ORDER BY a LIMIT 1")); + sel->forEachRow( + [](auto a, auto b, auto c, auto d, auto e, auto f) { BOOST_REQUIRE_EQUAL(1, a); BOOST_REQUIRE_EQUAL(2.3, b); BOOST_REQUIRE_EQUAL("Some text", c); BOOST_REQUIRE_EQUAL(boost::posix_time::ptime_from_tm({ 17, 39, 13, 7, 10, 115, 0, 0, 0, 0, 0}), d); BOOST_REQUIRE_EQUAL(boost::posix_time::time_duration(4, 3, 2), e); + BOOST_REQUIRE_EQUAL(true, f); }); } diff --git a/libdbpp/unittests/util.sql b/libdbpp/unittests/util.sql index a3c5ac8..fe98fc9 100644 --- a/libdbpp/unittests/util.sql +++ b/libdbpp/unittests/util.sql @@ -3,6 +3,7 @@ CREATE TABLE foreachrow ( b numeric(4,2), c text, d timestamp without time zone, - e interval); -INSERT INTO foreachrow(a, b, c, d, e) VALUES(1, 2.3, 'Some text', '2015-11-07 13:39:17', '04:03:02'); + e interval, + f boolean); +INSERT INTO foreachrow(a, b, c, d, e, f) VALUES(1, 2.3, 'Some text', '2015-11-07 13:39:17', '04:03:02', true); -- cgit v1.2.3