1
0
forked from blue/lmdbal

fixed tests build

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

View File

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

View File

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