diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-01-23 11:04:26 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-02-04 10:49:06 +0100 |
commit | 4a985e09f2addcc9cb86f435b5a87517d20ec483 (patch) | |
tree | 9a004e7a29b90ebd9d470007946bddfdee3470ec /test/storage/http_error.cpp | |
parent | 9a549094e02b046eb67a3c3a1ed8df96791825ca (diff) | |
download | qtlocation-mapboxgl-4a985e09f2addcc9cb86f435b5a87517d20ec483.tar.gz |
asset:// URLs are local to the executable path now
Diffstat (limited to 'test/storage/http_error.cpp')
-rw-r--r-- | test/storage/http_error.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/storage/http_error.cpp b/test/storage/http_error.cpp index 274b88fd4a..101166780a 100644 --- a/test/storage/http_error.cpp +++ b/test/storage/http_error.cpp @@ -26,14 +26,14 @@ TEST_F(Storage, HTTPError) { fs.request({ Resource::Unknown, "http://127.0.0.1:3000/temporary-error" }, uv_default_loop(), [&](const Response &res) { const auto duration = double(uv_hrtime() - start) / 1e9; - EXPECT_GT(duration, 1) << "Backoff timer didn't wait 1 second"; - EXPECT_LT(duration, 1.2) << "Backoff timer fired too late"; - EXPECT_EQ(res.status, Response::Successful); - EXPECT_EQ(res.data, "Hello World!"); - EXPECT_EQ(res.expires, 0); - EXPECT_EQ(res.modified, 0); - EXPECT_EQ(res.etag, ""); - EXPECT_EQ(res.message, ""); + EXPECT_LT(1, duration) << "Backoff timer didn't wait 1 second"; + EXPECT_GT(1.2, duration) << "Backoff timer fired too late"; + EXPECT_EQ(Response::Successful, res.status); + EXPECT_EQ("Hello World!", res.data); + EXPECT_EQ(0, res.expires); + EXPECT_EQ(0, res.modified); + EXPECT_EQ("", res.etag); + EXPECT_EQ("", res.message); HTTPTemporaryError.finish(); }); @@ -41,14 +41,14 @@ TEST_F(Storage, HTTPError) { fs.request({ Resource::Unknown, "http://127.0.0.1:3001/" }, uv_default_loop(), [&](const Response &res) { const auto duration = double(uv_hrtime() - start) / 1e9; // 1.5 seconds == 4 retries, with a 500ms timeout (see above). - EXPECT_GT(duration, 1.5) << "Resource wasn't retried the correct number of times"; - EXPECT_LT(duration, 1.7) << "Resource wasn't retried the correct number of times"; - EXPECT_EQ(res.status, Response::Error); + EXPECT_LT(1.5, duration) << "Resource wasn't retried the correct number of times"; + EXPECT_GT(1.7, duration) << "Resource wasn't retried the correct number of times"; + EXPECT_EQ(Response::Error, res.status); EXPECT_TRUE(res.message == "Couldn't connect to server" || res.message == "The operation couldn’t be completed. (NSURLErrorDomain error -1004.)"); - EXPECT_EQ(res.data, ""); - EXPECT_EQ(res.expires, 0); - EXPECT_EQ(res.modified, 0); - EXPECT_EQ(res.etag, ""); + EXPECT_EQ("", res.data); + EXPECT_EQ(0, res.expires); + EXPECT_EQ(0, res.modified); + EXPECT_EQ("", res.etag); HTTPConnectionError.finish(); }); |