diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-05 20:16:15 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-05 20:16:15 +0100 |
commit | eb0e38698550df4c30efbc979823cc500fd2c428 (patch) | |
tree | fcfdbb46021160d8fef9ac1fd24922b8206eff80 | |
parent | Tidy selecting source data a bit (diff) | |
download | mygrate-eb0e38698550df4c30efbc979823cc500fd2c428.tar.bz2 mygrate-eb0e38698550df4c30efbc979823cc500fd2c428.tar.xz mygrate-eb0e38698550df4c30efbc979823cc500fd2c428.zip |
Test something more predictable
Specifically that the test DB server instance in MariaDB
-rw-r--r-- | test/test-mysql.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test-mysql.cpp b/test/test-mysql.cpp index 8da3f7b..4ad9bb5 100644 --- a/test/test-mysql.cpp +++ b/test/test-mysql.cpp @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(simple) } using SomeSelect = MyGrate::DbStmt<"SELECT * FROM foo">; -using SomeShow = MyGrate::DbStmt<"SHOW MASTER STATUS">; +using SomeShow = MyGrate::DbStmt<"SHOW VARIABLES LIKE 'version'">; using SomeUpdate = MyGrate::DbStmt<"UPDATE foo SET blah = ? WHERE bar = ?">; static_assert(std::is_same_v<SomeSelect::Return, MyGrate::RecordSetPtr>); @@ -54,9 +54,9 @@ BOOST_AUTO_TEST_CASE(stmt) const auto rs {SomeShow::execute(&c)}; BOOST_REQUIRE(rs); BOOST_REQUIRE_EQUAL(rs->rows(), 1); - BOOST_REQUIRE_EQUAL(rs->columns(), 4); - BOOST_CHECK(std::get<std::string_view>(rs->at(0, 0)).starts_with("mariadb")); - BOOST_CHECK_GE(std::get<int64_t>(rs->at(0, 1)), 4); + BOOST_REQUIRE_EQUAL(rs->columns(), 2); + const std::string_view versionString {rs->at(0, 1)}; + BOOST_CHECK(versionString.find("MariaDB") != std::string_view::npos); } BOOST_AUTO_TEST_CASE(mock) |