diff options
Diffstat (limited to 'libmysqlpp')
-rw-r--r-- | libmysqlpp/unittests/testmysql.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libmysqlpp/unittests/testmysql.cpp b/libmysqlpp/unittests/testmysql.cpp index 4691a28..04e7212 100644 --- a/libmysqlpp/unittests/testmysql.cpp +++ b/libmysqlpp/unittests/testmysql.cpp @@ -131,15 +131,14 @@ BOOST_AUTO_TEST_CASE( insertId ) { auto ro = DB::MockDatabase::openConnectionTo("mysqlmock"); auto ins = ro->modify("INSERT INTO inserts(num) VALUES(?)"); - ins->bindParamI(0, 4); - ins->execute(); - BOOST_REQUIRE_EQUAL(1, ro->insertId()); - ins->bindParamI(0, 40); - ins->execute(); - BOOST_REQUIRE_EQUAL(2, ro->insertId()); - ins->bindParamI(0, -4); - ins->execute(); - BOOST_REQUIRE_EQUAL(3, ro->insertId()); + int prevId = 0; + for (int n : { 4, 40, -4 }) { + ins->bindParamI(0, n); + ins->execute(); + auto id = ro->insertId(); + BOOST_REQUIRE_GT(id, prevId); + prevId = id; + } } BOOST_AUTO_TEST_CASE( errors ) |