[msvc] Avoid warnings in tests (#276)

This commit is contained in:
Tadej Novak
2022-04-26 17:44:49 +02:00
committed by GitHub
parent 32ed70c95d
commit 2dcc9d8b61
19 changed files with 77 additions and 61 deletions

View File

@@ -20,7 +20,11 @@ namespace {
std::string toAbsoluteURL(const std::string& fileName) {
char buff[PATH_MAX + 1];
#ifdef _MSC_VER
char* cwd = _getcwd( buff, PATH_MAX + 1 );
#else
char* cwd = getcwd( buff, PATH_MAX + 1 );
#endif
std::string url = { "file://" + std::string(cwd) + "/test/fixtures/storage/assets/" + fileName };
assert(url.size() <= PATH_MAX);
return url;

View File

@@ -669,7 +669,7 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(DISABLED_MaximumAmbientCacheSize)) {
namespace {
std::list<std::tuple<Resource, Response>> generateResources(const std::string& tilePrefix,
const std::string& stylePrefix) {
static const auto responseData = randomString(.5 * 1024 * 1024);
static const auto responseData = randomString(512 * 1024);
Response response;
response.data = responseData;
std::list<std::tuple<Resource, Response>> resources;
@@ -694,7 +694,7 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(DeleteRegion)) {
{
Response response;
response.data = randomString(.5 * 1024 * 1024);
response.data = randomString(512 * 1024);
OfflineDatabase db(filename, fixture::tileServerOptions);
@@ -753,7 +753,7 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(Pack)) {
db.runPackDatabaseAutomatically(false);
Response response;
response.data = randomString(.5 * 1024 * 1024);
response.data = randomString(512 * 1024);
for (unsigned i = 0; i < 50; ++i) {
const Resource tile = Resource::tile("maptiler://tiles/tiles/tile_" + std::to_string(i), 1, 0, 0, 0, Tileset::Scheme::XYZ);
@@ -975,7 +975,7 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(ClearAmbientCache)) {
{
Response response;
response.data = randomString(.5 * 1024 * 1024);
response.data = randomString(512 * 1024);
OfflineDatabase db(filename, fixture::tileServerOptions);