reset log level after it's done testing.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 24 Jan 2012 22:15:06 +0000 (22:15 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 24 Jan 2012 22:15:06 +0000 (22:15 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@67516 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/tests/eina_test_log.c

index 1ed65ad..e0f0363 100644 (file)
@@ -101,9 +101,11 @@ _eina_test_log_safety(const Eina_Log_Domain *d, Eina_Log_Level level, const char
 START_TEST(eina_log_macro)
 {
    struct log_ctx ctx;
+   int oldlevel;
 
    fail_if(!eina_init());
 
+   oldlevel = eina_log_level_get();
    eina_log_level_set(EINA_LOG_LEVEL_DBG);
    eina_log_print_cb_set(_eina_test_log, &ctx);
 
@@ -137,6 +139,7 @@ START_TEST(eina_log_macro)
 #undef TEST_LOG_CTX
 
    eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
+   eina_log_level_set(oldlevel);
 
    eina_shutdown();
 }
@@ -145,10 +148,12 @@ END_TEST
 START_TEST(eina_log_domains_macros)
 {
    struct log_ctx ctx;
+   int oldlevel;
 
    fail_if(!eina_init());
 
    /* make global log level blocker */
+   oldlevel = eina_log_level_get();
    eina_log_level_set(EINA_LOG_LEVEL_CRITICAL);
    eina_log_print_cb_set(_eina_test_log_domain, &ctx);
 
@@ -189,6 +194,7 @@ START_TEST(eina_log_domains_macros)
 #undef TEST_LOG_CTX
 
    eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
+   eina_log_level_set(oldlevel);
 
    eina_shutdown();
 }