mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:17:28 +00:00
Tests: Fix tests
This commit is contained in:
parent
9699d520eb
commit
4d760b9776
@ -18,6 +18,7 @@
|
||||
#include <stat/statmanager.h>
|
||||
#include <util/dateutil.h>
|
||||
#include <util/fileutil.h>
|
||||
#include <util/ioc/ioccontainer.h>
|
||||
|
||||
#include <mocks/mockquotamanager.h>
|
||||
|
||||
@ -99,9 +100,13 @@ void debugStatTraf(SqliteDb *sqliteDb)
|
||||
|
||||
TEST_F(StatTest, dbWriteRead)
|
||||
{
|
||||
NiceMock<MockQuotaManager> quotaManager;
|
||||
IocContainer ioc;
|
||||
ioc.pinToThread();
|
||||
|
||||
StatManager statManager(":memory:", "aManager);
|
||||
NiceMock<MockQuotaManager> quotaManager;
|
||||
ioc.set<QuotaManager>(quotaManager);
|
||||
|
||||
StatManager statManager(":memory:");
|
||||
|
||||
statManager.setUp();
|
||||
|
||||
|
@ -92,7 +92,7 @@ TEST_F(ConfUtilTest, confWriteRead)
|
||||
|
||||
ASSERT_TRUE(DriverCommon::confAppBlocked(
|
||||
data, DriverCommon::confAppFind(data, "System"), &blockReason));
|
||||
ASSERT_EQ(blockReason, FORT_BLOCK_REASON_FILTER_MODE);
|
||||
ASSERT_EQ(blockReason, FORT_BLOCK_REASON_APP_GROUP_FOUND);
|
||||
|
||||
ASSERT_FALSE(DriverCommon::confAppBlocked(data,
|
||||
DriverCommon::confAppFind(
|
||||
|
@ -128,7 +128,7 @@ void StatManager::updateActivePeriod()
|
||||
m_isActivePeriodSet = true;
|
||||
m_isActivePeriod = true;
|
||||
|
||||
if (conf()->activePeriodEnabled()) {
|
||||
if (conf() && conf()->activePeriodEnabled()) {
|
||||
const QTime now = QTime::currentTime();
|
||||
|
||||
m_isActivePeriod = DriverCommon::isTimeInPeriod(quint8(now.hour()),
|
||||
|
Loading…
Reference in New Issue
Block a user