From f450ffaa267bd33e8ece2354998ffcf6dac839b0 Mon Sep 17 00:00:00 2001 From: Krzysztof Jackiewicz Date: Fri, 21 Sep 2018 11:48:11 +0200 Subject: [PATCH] Fix internal migration tests Migration tests use existing databases so test alias names must not be changed Change-Id: I4277125a9031d822d1666e51a8ee54466901e2a0 --- tests/DBFixture.cpp | 8 ++++---- tests/DBFixture.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/DBFixture.cpp b/tests/DBFixture.cpp index a7e42fe..67241c5 100644 --- a/tests/DBFixture.cpp +++ b/tests/DBFixture.cpp @@ -92,7 +92,7 @@ void DBFixture::generate_name(unsigned int id, Name &output) void DBFixture::generate_owner(unsigned int id, ClientId &output) { std::stringstream ss; - ss << "owner_no_" << id; + ss << "label_no_" << id; output = ss.str(); } @@ -195,7 +195,7 @@ void DBFixture::check_DB_integrity(const DB::Row &rowPattern) BOOST_REQUIRE_NO_THROW(m_db.saveRow(rowPattern)); DB::Crypto::RowOptional optional_row; - BOOST_REQUIRE_NO_THROW(optional_row = m_db.getRow("name", "owner", + BOOST_REQUIRE_NO_THROW(optional_row = m_db.getRow(m_default_name, m_default_owner, DataType::BINARY_DATA)); BOOST_REQUIRE_MESSAGE(optional_row, "Select didn't return any row"); @@ -205,11 +205,11 @@ void DBFixture::check_DB_integrity(const DB::Row &rowPattern) name_duplicate.dataSize = name_duplicate.data.size(); unsigned int erased; - BOOST_REQUIRE_NO_THROW(erased = m_db.deleteRow("name", "owner")); + BOOST_REQUIRE_NO_THROW(erased = m_db.deleteRow(m_default_name, m_default_owner)); BOOST_REQUIRE_MESSAGE(erased > 0, "Inserted row didn't exist in db"); DB::Crypto::RowOptional row_optional; - BOOST_REQUIRE_NO_THROW(row_optional = m_db.getRow("name", "owner", + BOOST_REQUIRE_NO_THROW(row_optional = m_db.getRow(m_default_name, m_default_owner, DataType::BINARY_DATA)); BOOST_REQUIRE_MESSAGE(!row_optional, "Select should not return row after deletion"); diff --git a/tests/DBFixture.h b/tests/DBFixture.h index 5b40820..be7e2e0 100644 --- a/tests/DBFixture.h +++ b/tests/DBFixture.h @@ -33,7 +33,7 @@ public: DBFixture(const char *db_fname); constexpr static const char *m_default_name = "name"; - constexpr static const char *m_default_owner = "owner"; + constexpr static const char *m_default_owner = "label"; // ::::::::::::::::::::::::: helper methods ::::::::::::::::::::::::: static void generate_name(unsigned int id, CKM::Name &output); -- 2.7.4