From eb0e38698550df4c30efbc979823cc500fd2c428 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 5 Jul 2021 20:16:15 +0100 Subject: Test something more predictable Specifically that the test DB server instance in MariaDB --- test/test-mysql.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') 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); @@ -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(rs->at(0, 0)).starts_with("mariadb")); - BOOST_CHECK_GE(std::get(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) -- cgit v1.2.3