summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-01-21 13:03:03 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-01-22 18:41:54 -0800
commitfa894d7cbc7e27a64fa7e466fa56e718079da24c (patch)
tree8ab4c23e1ed7becacb72c20d4809e4ad6cc39589 /test
parentcef5c331fe6ab827e71aed1e4e0387983083c88e (diff)
downloadqtlocation-mapboxgl-fa894d7cbc7e27a64fa7e466fa56e718079da24c.tar.gz
[core] Polyfill std::chrono::abs
Diffstat (limited to 'test')
-rw-r--r--test/storage/http_header_parsing.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/storage/http_header_parsing.cpp b/test/storage/http_header_parsing.cpp
index 827aa70abc..521fa239e6 100644
--- a/test/storage/http_header_parsing.cpp
+++ b/test/storage/http_header_parsing.cpp
@@ -39,15 +39,13 @@ TEST_F(Storage, HTTPCacheControlParsing) {
util::RunLoop loop;
OnlineFileSource fs(nullptr);
- const Seconds now = toSeconds(SystemClock::now());
-
std::unique_ptr<FileRequest> req2 = fs.request({ Resource::Unknown, "http://127.0.0.1:3000/test?cachecontrol=max-age=120" },
[&](Response res) {
req2.reset();
EXPECT_EQ(nullptr, res.error);
ASSERT_TRUE(res.data.get());
EXPECT_EQ("Hello World!", *res.data);
- EXPECT_GT(2, std::abs(toSeconds(*res.expires).count() - now.count() - 120)) << "Expiration date isn't about 120 seconds in the future";
+ EXPECT_GT(Seconds(2), util::abs(*res.expires - SystemClock::now() - Seconds(120))) << "Expiration date isn't about 120 seconds in the future";
EXPECT_FALSE(bool(res.modified));
EXPECT_FALSE(bool(res.etag));
loop.stop();