Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drape/drape_tests/testingmain.cpp2
-rw-r--r--platform/downloader_tests/downloader_test.cpp4
-rw-r--r--platform/platform_tests/local_country_file_tests.cpp7
-rw-r--r--qt/main.cpp4
-rw-r--r--search/search_integration_tests/search_query_v2_test.cpp2
-rw-r--r--testing/testingmain.cpp2
6 files changed, 8 insertions, 13 deletions
diff --git a/drape/drape_tests/testingmain.cpp b/drape/drape_tests/testingmain.cpp
index d1f6c6fa60..cfcf9642bd 100644
--- a/drape/drape_tests/testingmain.cpp
+++ b/drape/drape_tests/testingmain.cpp
@@ -41,7 +41,7 @@ int main(int argc, char * argv[])
UNUSED_VALUE(argv);
#endif
- my::g_LogLevel = LINFO;
+ my::ScopedLogLevelChanger const infoLogLevel(LINFO);
emul::GLMockFunctions::Init(&argc, argv);
MY_SCOPE_GUARD(GLMockScope, bind(&emul::GLMockFunctions::Teardown));
diff --git a/platform/downloader_tests/downloader_test.cpp b/platform/downloader_tests/downloader_test.cpp
index df3ef426df..2a7a8235b1 100644
--- a/platform/downloader_tests/downloader_test.cpp
+++ b/platform/downloader_tests/downloader_test.cpp
@@ -38,12 +38,12 @@ class DownloadObserver
vector<HttpRequest::StatusT> m_statuses;
// Interrupt download after this number of chunks
int m_chunksToFail;
+ my::ScopedLogLevelChanger const m_debugLogLevel;
public:
- DownloadObserver() : m_chunksToFail(-1)
+ DownloadObserver() : m_chunksToFail(-1), m_debugLogLevel(LDEBUG)
{
Reset();
- my::g_LogLevel = LDEBUG;
}
void CancelDownloadOnGivenChunk(int chunksToFail)
diff --git a/platform/platform_tests/local_country_file_tests.cpp b/platform/platform_tests/local_country_file_tests.cpp
index 0348851c06..e0689f7ee5 100644
--- a/platform/platform_tests/local_country_file_tests.cpp
+++ b/platform/platform_tests/local_country_file_tests.cpp
@@ -352,12 +352,7 @@ UNIT_TEST(LocalCountryFile_CountryIndexes)
UNIT_TEST(LocalCountryFile_DoNotDeleteUserFiles)
{
- my::LogLevel oldLogLevel = my::g_LogLevel;
- my::g_LogLevel = LCRITICAL;
- MY_SCOPE_GUARD(restoreLogLevel, [&oldLogLevel]()
- {
- my::g_LogLevel = oldLogLevel;
- });
+ my::ScopedLogLevelChanger const criticalLogLevel(LCRITICAL);
ScopedDir testDir("101010");
diff --git a/qt/main.cpp b/qt/main.cpp
index a17eacf594..144420eee2 100644
--- a/qt/main.cpp
+++ b/qt/main.cpp
@@ -41,12 +41,12 @@ namespace
class InitializeFinalize : public FinalizeBase
{
FILE * m_errFile;
+ my::ScopedLogLevelChanger const m_debugLog;
public:
- InitializeFinalize()
+ InitializeFinalize() : m_debugLog(LDEBUG)
{
// App runs without error console under win32.
m_errFile = ::freopen(".\\mapsme.log", "w", stderr);
- my::g_LogLevel = my::LDEBUG;
//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_DELAY_FREE_MEM_DF);
//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
diff --git a/search/search_integration_tests/search_query_v2_test.cpp b/search/search_integration_tests/search_query_v2_test.cpp
index d6451a9b82..cd989b7427 100644
--- a/search/search_integration_tests/search_query_v2_test.cpp
+++ b/search/search_integration_tests/search_query_v2_test.cpp
@@ -49,7 +49,7 @@ class TestSearchQueryFactory : public search::SearchQueryFactory
UNIT_TEST(SearchQueryV2_Smoke)
{
- my::g_LogLevel = LDEBUG;
+ my::ScopedLogLevelChanger const debugLogLevel(LDEBUG);
classificator::Load();
Platform & platform = GetPlatform();
diff --git a/testing/testingmain.cpp b/testing/testingmain.cpp
index 6ecb057189..bfbebc97df 100644
--- a/testing/testingmain.cpp
+++ b/testing/testingmain.cpp
@@ -110,7 +110,7 @@ int main(int argc, char * argv[])
UNUSED_VALUE(argv);
#endif
- my::g_LogLevel = LINFO;
+ my::ScopedLogLevelChanger const infoLogLevel(LINFO);
#if defined(OMIM_OS_MAC) || defined(OMIM_OS_LINUX)
my::SetLogMessageFn(my::LogMessageTests);
#endif