MCPcopy Create free account
hub / github.com/comaps/comaps / CreateDummyMapFile

Function CreateDummyMapFile

libs/storage/storage_tests/storage_tests.cpp:446–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446LocalFilePtr CreateDummyMapFile(CountryFile const & countryFile, int64_t version, uint64_t size)
447{
448 LocalFilePtr localFile = PreparePlaceForCountryFiles(version, string() /* dataDir */, countryFile);
449 TEST(localFile.get(), ("Can't prepare place for", countryFile, "(version", version, ")"));
450 {
451 string const zeroes(size, '\0');
452 FileWriter writer(localFile->GetPath(MapFileType::Map));
453 writer.Write(zeroes.data(), zeroes.size());
454 }
455 localFile->SyncWithDisk();
456 TEST(localFile->OnDisk(MapFileType::Map), ());
457 TEST_EQUAL(size, localFile->GetSize(MapFileType::Map), ());
458 return localFile;
459}
460
461void InitStorage(Storage & storage, TaskRunner & runner, Storage::UpdateCallback const & update = &OnCountryDownloaded)
462{

Callers 1

UNIT_TESTFunction · 0.85

Calls 10

TESTFunction · 0.85
SyncWithDiskMethod · 0.80
OnDiskMethod · 0.80
getMethod · 0.65
GetPathMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected