Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
11f60b79
Commit
11f60b79
authored
Apr 25, 2017
by
Daniel Vrátil
🤖
Browse files
Fix test
parent
79133830
Changes
1
Hide whitespace changes
Inline
Side-by-side
webengineviewer/src/checkphishingurl/autotests/checkphishingurlutiltest.cpp
View file @
11f60b79
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment