diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-08-20 15:52:58 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-08-20 15:54:13 +0300 |
commit | bcca5d3ac57f17b8d4d34ca8c9172788c8da3dfd (patch) | |
tree | d6c066f337e04d651f42c84619edbc0152ab9340 /test/storage/default_file_source.test.cpp | |
parent | c42b44197ffa012810c50dfa658cf979b08244d4 (diff) | |
download | qtlocation-mapboxgl-bcca5d3ac57f17b8d4d34ca8c9172788c8da3dfd.tar.gz |
[core] Remove wrapper for std::chrono::system_clock::now()upstream/tmpsantos-chrono_overflow
Better make it explict now that we no longer cast to time_point<Seconds>
Diffstat (limited to 'test/storage/default_file_source.test.cpp')
-rw-r--r-- | test/storage/default_file_source.test.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/storage/default_file_source.test.cpp b/test/storage/default_file_source.test.cpp index 38c7abb039..106785533f 100644 --- a/test/storage/default_file_source.test.cpp +++ b/test/storage/default_file_source.test.cpp @@ -258,7 +258,7 @@ TEST(DefaultFileSource, OptionalNonExpired) { Response response; response.data = std::make_shared<std::string>("Cached value"); - response.expires = util::now() + 1h; + response.expires = system_clock::now() + 1h; fs.put(optionalResource, response); std::unique_ptr<AsyncRequest> req; @@ -288,7 +288,7 @@ TEST(DefaultFileSource, OptionalExpired) { Response response; response.data = std::make_shared<std::string>("Cached value"); - response.expires = util::now() - 1h; + response.expires = system_clock::now() - 1h; fs.put(optionalResource, response); std::unique_ptr<AsyncRequest> req; @@ -363,7 +363,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(NoCacheRefreshEtagNotModified)) { // Put a fake value into the cache to make sure we're not retrieving anything from the cache. Response response; response.data = std::make_shared<std::string>("Cached value"); - response.expires = util::now() + 1h; + response.expires = system_clock::now() + 1h; fs.put(resource, response); std::unique_ptr<AsyncRequest> req; @@ -373,7 +373,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(NoCacheRefreshEtagNotModified)) { EXPECT_TRUE(res.notModified); EXPECT_FALSE(res.data.get()); ASSERT_TRUE(bool(res.expires)); - EXPECT_LT(util::now(), *res.expires); + EXPECT_LT(system_clock::now(), *res.expires); EXPECT_TRUE(res.mustRevalidate); EXPECT_FALSE(bool(res.modified)); ASSERT_TRUE(bool(res.etag)); @@ -398,7 +398,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(NoCacheRefreshEtagModified)) { // Put a fake value into the cache to make sure we're not retrieving anything from the cache. Response response; response.data = std::make_shared<std::string>("Cached value"); - response.expires = util::now() + 1h; + response.expires = system_clock::now() + 1h; fs.put(resource, response); std::unique_ptr<AsyncRequest> req; @@ -432,7 +432,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(NoCacheFull)) { // Put a fake value into the cache to make sure we're not retrieving anything from the cache. Response response; response.data = std::make_shared<std::string>("Cached value"); - response.expires = util::now() + 1h; + response.expires = system_clock::now() + 1h; fs.put(resource, response); std::unique_ptr<AsyncRequest> req; @@ -468,7 +468,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(NoCacheRefreshModifiedNotModified)) // Put a fake value into the cache to make sure we're not retrieving anything from the cache. Response response; response.data = std::make_shared<std::string>("Cached value"); - response.expires = util::now() + 1h; + response.expires = system_clock::now() + 1h; fs.put(resource, response); std::unique_ptr<AsyncRequest> req; @@ -478,7 +478,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(NoCacheRefreshModifiedNotModified)) EXPECT_TRUE(res.notModified); EXPECT_FALSE(res.data.get()); ASSERT_TRUE(bool(res.expires)); - EXPECT_LT(util::now(), *res.expires); + EXPECT_LT(system_clock::now(), *res.expires); EXPECT_TRUE(res.mustRevalidate); ASSERT_TRUE(bool(res.modified)); EXPECT_EQ(Timestamp{ Seconds(1420070400) }, *res.modified); @@ -504,7 +504,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(NoCacheRefreshModifiedModified)) { // Put a fake value into the cache to make sure we're not retrieving anything from the cache. Response response; response.data = std::make_shared<std::string>("Cached value"); - response.expires = util::now() + 1h; + response.expires = system_clock::now() + 1h; fs.put(resource, response); std::unique_ptr<AsyncRequest> req; @@ -651,7 +651,7 @@ TEST(DefaultFileSource, TEST_REQUIRES_SERVER(RespondToStaleMustRevalidate)) { // return new data, only a 304 Not Modified response. EXPECT_EQ("Prior value", *res.data); ASSERT_TRUE(res.expires); - EXPECT_LE(util::now(), *res.expires); + EXPECT_LE(system_clock::now(), *res.expires); EXPECT_TRUE(res.mustRevalidate); ASSERT_TRUE(res.modified); EXPECT_EQ(Timestamp{ Seconds(1417392000) }, *res.modified); |