##// END OF EJS Templates
Implements unit test (2)...
Implements unit test (2) Handles variable init and operations (zooms/pans)

File last commit:

r556:552e9eaf7536
r688:a0932f2ad0d7
Show More
TestVariableCacheController.cpp
331 lines | 13.6 KiB | text/x-c | CppLexer
/ core / tests / Variable / TestVariableCacheController.cpp
Implementation of the cach interval algoritm
r213 #include <Variable/Variable.h>
#include <Variable/VariableCacheController.h>
#include <QObject>
#include <QtTest>
#include <memory>
class TestVariableCacheController : public QObject {
Q_OBJECT
private slots:
void testProvideNotInCacheDateTimeList();
Implementation of the addDateTime method of the cache
r214
void testAddDateTime();
Implementation of the cach interval algoritm
r213 };
void TestVariableCacheController::testProvideNotInCacheDateTimeList()
{
VariableCacheController variableCacheController{};
auto ts0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 0, 0}};
auto te0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp0 = SqpRange{DateUtils::secondsSinceEpoch(ts0), DateUtils::secondsSinceEpoch(te0)};
Implementation of the cach interval algoritm
r213
auto ts1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 6, 0, 0}};
auto te1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 8, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp1 = SqpRange{DateUtils::secondsSinceEpoch(ts1), DateUtils::secondsSinceEpoch(te1)};
Implementation of the cach interval algoritm
r213
auto ts2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 18, 0, 0}};
auto te2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 20, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp2 = SqpRange{DateUtils::secondsSinceEpoch(ts2), DateUtils::secondsSinceEpoch(te2)};
Implementation of the cach interval algoritm
r213
Alexandre Leroux
Removes unit and mission from variable...
r372 auto var0 = std::make_shared<Variable>("", sqp0);
Implementation of the cach interval algoritm
r213
variableCacheController.addDateTime(var0, sqp0);
variableCacheController.addDateTime(var0, sqp1);
variableCacheController.addDateTime(var0, sqp2);
// first case [ts,te] < ts0
auto ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}};
auto te = QDateTime{QDate{2017, 01, 01}, QTime{2, 1, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
auto notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 1);
Correction for pull request
r227 auto notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// second case ts < ts0 && ts0 < te <= te0
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 1);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0));
Implementation of the cach interval algoritm
r213
// 3th case ts < ts0 && te0 < te <= ts1
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 2);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(1);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// 4th case ts < ts0 && ts1 < te <= te1
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 7, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 2);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(1);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1));
Implementation of the cach interval algoritm
r213
// 5th case ts < ts0 && te3 < te
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 0, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 22, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 4);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts0));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(1);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(2);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te1));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts2));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(3);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te2));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// 6th case ts2 < ts
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 45, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 47, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 1);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// 7th case ts = te0 && te < ts1
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 1);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// 8th case ts0 < ts < te0 && te < ts1
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 1);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// 9th case ts0 < ts < te0 && ts1 < te < te1
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 30, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 7, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 1);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te0));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1));
Implementation of the cach interval algoritm
r213
// 10th case te1 < ts < te < ts2
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 9, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 10, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 1);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// 11th case te0 < ts < ts1 && te3 < te
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 47, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 3);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(1);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te1));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts2));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(2);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te2));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Implementation of the cach interval algoritm
r213
// 12th case te0 < ts < ts1 && te3 < te
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 5, 0, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 10, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Implementation of the cach interval algoritm
r213
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 2);
Correction for pull request
r227 notInCacheSqp = notInCach.first();
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(ts));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(ts1));
Implementation of the cach interval algoritm
r213
Correction for pull request
r227 notInCacheSqp = notInCach.at(1);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(notInCacheSqp.m_TStart, DateUtils::secondsSinceEpoch(te1));
QCOMPARE(notInCacheSqp.m_TEnd, DateUtils::secondsSinceEpoch(te));
Update the test to include the fixed bug test
r275
// 12th case ts0 < ts < te0
ts = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 10, 0}};
te = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 50, 0}};
PR: Use DateUtils instead of static_cast
r556 sqp = SqpRange{DateUtils::secondsSinceEpoch(ts), DateUtils::secondsSinceEpoch(te)};
Update the test to include the fixed bug test
r275
notInCach = variableCacheController.provideNotInCacheDateTimeList(var0, sqp);
QCOMPARE(notInCach.size(), 0);
Implementation of the cach interval algoritm
r213 }
Implementation of the addDateTime method of the cache
r214
void TestVariableCacheController::testAddDateTime()
{
VariableCacheController variableCacheController{};
auto ts0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 3, 0, 0}};
auto te0 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp0 = SqpRange{DateUtils::secondsSinceEpoch(ts0), DateUtils::secondsSinceEpoch(te0)};
Implementation of the addDateTime method of the cache
r214
auto ts1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 6, 0, 0}};
auto te1 = QDateTime{QDate{2017, 01, 01}, QTime{2, 8, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp1 = SqpRange{DateUtils::secondsSinceEpoch(ts1), DateUtils::secondsSinceEpoch(te1)};
Implementation of the addDateTime method of the cache
r214
auto ts2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 18, 0, 0}};
auto te2 = QDateTime{QDate{2017, 01, 01}, QTime{2, 20, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp2 = SqpRange{DateUtils::secondsSinceEpoch(ts2), DateUtils::secondsSinceEpoch(te2)};
Implementation of the addDateTime method of the cache
r214
auto ts01 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}};
auto te01 = QDateTime{QDate{2017, 01, 01}, QTime{2, 6, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp01 = SqpRange{DateUtils::secondsSinceEpoch(ts01), DateUtils::secondsSinceEpoch(te01)};
Implementation of the addDateTime method of the cache
r214
auto ts3 = QDateTime{QDate{2017, 01, 01}, QTime{2, 14, 0, 0}};
auto te3 = QDateTime{QDate{2017, 01, 01}, QTime{2, 16, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp3 = SqpRange{DateUtils::secondsSinceEpoch(ts3), DateUtils::secondsSinceEpoch(te3)};
Implementation of the addDateTime method of the cache
r214
auto ts03 = QDateTime{QDate{2017, 01, 01}, QTime{2, 4, 0, 0}};
auto te03 = QDateTime{QDate{2017, 01, 01}, QTime{2, 22, 0, 0}};
PR: Use DateUtils instead of static_cast
r556 auto sqp03 = SqpRange{DateUtils::secondsSinceEpoch(ts03), DateUtils::secondsSinceEpoch(te03)};
Implementation of the addDateTime method of the cache
r214
Alexandre Leroux
Removes unit and mission from variable...
r372 auto var0 = std::make_shared<Variable>("", sqp0);
Implementation of the addDateTime method of the cache
r214
// First case: add the first interval to the variable :sqp0
variableCacheController.addDateTime(var0, sqp0);
auto dateCacheList = variableCacheController.dateCacheList(var0);
QCOMPARE(dateCacheList.count(), 1);
auto dateCache = dateCacheList.at(0);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te0));
Implementation of the addDateTime method of the cache
r214
// 2nd case: add a second interval : sqp1 > sqp0
variableCacheController.addDateTime(var0, sqp1);
dateCacheList = variableCacheController.dateCacheList(var0);
QCOMPARE(dateCacheList.count(), 2);
dateCache = dateCacheList.at(0);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te0));
Implementation of the addDateTime method of the cache
r214
dateCache = dateCacheList.at(1);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts1));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te1));
Implementation of the addDateTime method of the cache
r214
// 3th case: merge sqp0 & sqp1 with sqp01
variableCacheController.addDateTime(var0, sqp01);
dateCacheList = variableCacheController.dateCacheList(var0);
QCOMPARE(dateCacheList.count(), 1);
dateCache = dateCacheList.at(0);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te1));
Implementation of the addDateTime method of the cache
r214
// 4th case: add a second interval : sqp1 > sqp0
variableCacheController.addDateTime(var0, sqp2);
variableCacheController.addDateTime(var0, sqp3);
dateCacheList = variableCacheController.dateCacheList(var0);
QCOMPARE(dateCacheList.count(), 3);
dateCache = dateCacheList.at(0);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te1));
Implementation of the addDateTime method of the cache
r214
dateCache = dateCacheList.at(1);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts3));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te3));
Implementation of the addDateTime method of the cache
r214
dateCache = dateCacheList.at(2);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts2));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te2));
Implementation of the addDateTime method of the cache
r214
// 5th case: merge all interval
variableCacheController.addDateTime(var0, sqp03);
dateCacheList = variableCacheController.dateCacheList(var0);
QCOMPARE(dateCacheList.count(), 1);
dateCache = dateCacheList.at(0);
PR: Use DateUtils instead of static_cast
r556 QCOMPARE(dateCache.m_TStart, DateUtils::secondsSinceEpoch(ts0));
QCOMPARE(dateCache.m_TEnd, DateUtils::secondsSinceEpoch(te03));
Implementation of the addDateTime method of the cache
r214 }
Implementation of the cach interval algoritm
r213 QTEST_MAIN(TestVariableCacheController)
#include "TestVariableCacheController.moc"