fixed tests build

This commit is contained in:
Blue 2023-03-26 21:42:52 +03:00
parent 763d956bf8
commit c83369f347
Signed by: blue
GPG Key ID: 9B203B252A63EE38
2 changed files with 8 additions and 7 deletions

View File

@ -16,7 +16,8 @@ target_link_libraries(
runUnitTests
GTest::gtest_main
${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Core
lmdb
)
include(GoogleTest)
gtest_discover_tests(runUnitTests)

View File

@ -10,8 +10,8 @@ class BaseTest : public ::testing::Test {
protected:
BaseTest():
::testing::Test(),
t1(db->getTable<uint32_t, uint32_t>("table1")),
t2(db->getTable<QString, QString>("table2")),
t1(db->getStorage<uint32_t, uint32_t>("table1")),
t2(db->getStorage<QString, QString>("table2")),
c1(db->getCache<int8_t, std::string>("cache1")) {}
~BaseTest() {}
@ -19,8 +19,8 @@ protected:
static void SetUpTestSuite() {
if (db == nullptr) {
db = new LMDBAL::Base("testBase");
db->addTable<uint32_t, uint32_t>("table1");
db->addTable<QString, QString>("table2");
db->addStorage<uint32_t, uint32_t>("table1");
db->addStorage<QString, QString>("table2");
db->addCache<int8_t, std::string>("cache1");
}
}
@ -152,8 +152,8 @@ TEST_F(BaseTest, Persistence) {
delete db;
db = new LMDBAL::Base("testBase");
t1 = db->addTable<uint32_t, uint32_t>("table1");
t2 = db->addTable<QString, QString>("table2");
t1 = db->addStorage<uint32_t, uint32_t>("table1");
t2 = db->addStorage<QString, QString>("table2");
c1 = db->addCache<int8_t, std::string>("cache1");
db->open();