Commit 11f60b79 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Fix test

parent 79133830
......@@ -40,7 +40,7 @@ void CheckPhishingUrlUtilTest::shouldConvertToSecond_data()
QTest::addColumn<double>("result");
QTest::newRow("empty") << QString() << (double) - 1;
QTest::newRow("test1") << QStringLiteral("459.123s") << 459.123;
QTest::newRow("test2") << QStringLiteral("459s") << static_cast<double>(459);
QTest::newRow("test2") << QStringLiteral("459s") << 459.;
}
void CheckPhishingUrlUtilTest::shouldConvertToSecond()
......@@ -55,13 +55,13 @@ void CheckPhishingUrlUtilTest::shouldCacheIsStillValid_data()
QTest::addColumn<double>("second");
QTest::addColumn<bool>("valid");
uint currentTime = QDateTime::currentDateTimeUtc().toTime_t();
QTest::newRow("valid") << (currentTime + 2000) << true;
QTest::newRow("invalid") << (currentTime - 2000) << false;
QTest::newRow("valid") << (currentTime + 2000.) << true;
QTest::newRow("invalid") << (currentTime - 2000.) << false;
}
void CheckPhishingUrlUtilTest::shouldCacheIsStillValid()
{
QFETCH(uint, second);
QFETCH(double, second);
QFETCH(bool, valid);
QCOMPARE(WebEngineViewer::CheckPhishingUrlUtil::cachedValueStillValid(second), valid);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment