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

Function InitStorage

libs/storage/storage_integration_tests/storage_http_tests.cpp:56–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void InitStorage(Storage & storage, Storage::UpdateCallback const & didDownload,
57 Storage::ProgressFunction const & progress)
58{
59 auto const changeCountryFunction = [&](CountryId const & /* countryId */)
60 {
61 if (!storage.IsDownloadInProgress())
62 {
63 // End wait for downloading complete.
64 testing::StopEventLoop();
65 }
66 };
67
68 storage.Init(didDownload, [](CountryId const &, LocalFilePtr const) { return false; });
69 storage.RegisterAllLocalMaps();
70 storage.Subscribe(changeCountryFunction, progress);
71 storage.SetDownloadingServersForTesting({kTestWebServer});
72}
73
74class StorageHttpTest
75{

Callers 1

UNIT_CLASS_TESTFunction · 0.70

Calls 6

StopEventLoopFunction · 0.85
IsDownloadInProgressMethod · 0.80
RegisterAllLocalMapsMethod · 0.80
InitMethod · 0.45
SubscribeMethod · 0.45

Tested by

no test coverage detected