diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-07-07 21:01:52 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-07-07 21:01:52 -0700 |
commit | 4c75c696b3162c72e7dec21ce0b3f69cae9d1034 (patch) | |
tree | 70a004afbe27f0e1025cb7d3da226fffc6916f80 | |
parent | 49b0f098c237ff43b07e88130eaf47b94870fa23 (diff) | |
download | qtlocation-mapboxgl-4c75c696b3162c72e7dec21ce0b3f69cae9d1034.tar.gz |
don't overwrite global symbol basename
-rw-r--r-- | test/fixtures/fixture_request.cpp | 10 | ||||
-rw-r--r-- | test/headless.cpp | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/test/fixtures/fixture_request.cpp b/test/fixtures/fixture_request.cpp index 39e8434b11..5cbbfda3f6 100644 --- a/test/fixtures/fixture_request.cpp +++ b/test/fixtures/fixture_request.cpp @@ -2,10 +2,10 @@ #include <llmr/platform/request.hpp> #include <llmr/util/uv.hpp> -const std::string basename = []{ - std::string basename = __FILE__; - basename.erase(basename.find_last_of("/")); - return basename; +const std::string base_directory = []{ + std::string fn = __FILE__; + fn.erase(fn.find_last_of("/")); + return fn; }(); @@ -22,7 +22,7 @@ platform::request_http(const std::string &url, l = uv_default_loop(); } - std::string clean_url = basename + "/" + url; + std::string clean_url = base_directory + "/" + url; auto pos = clean_url.find("://"); if (pos != std::string::npos) { clean_url.replace(pos, 3, "/"); diff --git a/test/headless.cpp b/test/headless.cpp index 57d351bb83..88169d8da9 100644 --- a/test/headless.cpp +++ b/test/headless.cpp @@ -10,10 +10,10 @@ #include <iostream> #include <fstream> -const std::string basename = []{ - std::string basename = __FILE__; - basename.erase(basename.find_last_of("/")); - return basename; +const std::string base_directory = []{ + std::string fn = __FILE__; + fn.erase(fn.find_last_of("/")); + return fn; }(); TEST(Headless, initialize) { @@ -56,7 +56,7 @@ TEST(Headless, initialize) { std::string result = llmr::util::compress_png(width, height, pixels, true); llmr::util::write_file("out.png", result); - std::ifstream imagefile(basename + "/fixtures/result/out.png"); + std::ifstream imagefile(base_directory + "/fixtures/result/out.png"); ASSERT_TRUE(imagefile.good()); std::stringstream image; image << imagefile.rdbuf(); |