first thoughts about cache
This commit is contained in:
parent
2f34fa69e8
commit
a613eaed27
6 changed files with 205 additions and 7 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "database.h"
|
||||
#include "table.h"
|
||||
#include "cache.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
@ -10,7 +11,8 @@ protected:
|
|||
DataBaseTest():
|
||||
::testing::Test(),
|
||||
t1(db->getTable<uint32_t, uint32_t>("table1")),
|
||||
t2(db->getTable<QString, QString>("table2")) {}
|
||||
t2(db->getTable<QString, QString>("table2")),
|
||||
c1(db->getCache<int8_t, std::string>("cache1")) {}
|
||||
|
||||
~DataBaseTest() {}
|
||||
|
||||
|
@ -19,6 +21,7 @@ protected:
|
|||
db = new DataBase("testBase");
|
||||
db->addTable<uint32_t, uint32_t>("table1");
|
||||
db->addTable<QString, QString>("table2");
|
||||
db->addCache<int8_t, std::string>("cache1");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +36,7 @@ protected:
|
|||
|
||||
DataBase::Table<uint32_t, uint32_t>* t1;
|
||||
DataBase::Table<QString, QString>* t2;
|
||||
DataBase::Cache<int8_t, std::string>* c1;
|
||||
};
|
||||
|
||||
|
||||
|
@ -120,6 +124,7 @@ TEST_F(DataBaseTest, Persistence) {
|
|||
db = new DataBase("testBase");
|
||||
t1 = db->addTable<uint32_t, uint32_t>("table1");
|
||||
t2 = db->addTable<QString, QString>("table2");
|
||||
c1 = db->addCache<int8_t, std::string>("cache1");
|
||||
db->open();
|
||||
|
||||
EXPECT_EQ(t1->getRecord(3), 15);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue