summaryrefslogtreecommitdiff
path: root/libpqpp/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'libpqpp/unittests')
-rw-r--r--libpqpp/unittests/testpq.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libpqpp/unittests/testpq.cpp b/libpqpp/unittests/testpq.cpp
index ed6c4bc..c49fa34 100644
--- a/libpqpp/unittests/testpq.cpp
+++ b/libpqpp/unittests/testpq.cpp
@@ -80,6 +80,25 @@ BOOST_AUTO_TEST_CASE( bindAndSelect )
delete ro;
}
+BOOST_AUTO_TEST_CASE( selectInTx )
+{
+ auto db = DB::MockDatabase::openConnectionTo("pqmock");
+
+ auto select = db->newSelectCommand("SELECT * FROM test");
+ while (select->fetch()) { }
+ delete select;
+ db->finish();
+
+ db->beginTx();
+ select = db->newSelectCommand("SELECT * FROM test");
+ while (select->fetch()) { }
+ delete select;
+ db->commitTx();
+ db->finish();
+
+ delete db;
+}
+
BOOST_AUTO_TEST_CASE( bindAndSelectOther )
{
auto ro = DB::MockDatabase::openConnectionTo("pqmock");