src/base/debug.test.cc
/** Test changing flag enabled with aux functions. */
Test changing flag enabled with aux functions.
Test changing flag enabled with aux functions .
TEST(DebugFlagTest, SetClearDebugFlag)
{
    debug::Flag::globalEnable();
    debug::SimpleFlag flag_a("FlagSetClearDebugFlagTestA", "");
    debug::SimpleFlag flag_b("FlagSetClearDebugFlagTestB", "");
    ASSERT_FALSE(flag_a.tracing());
    setDebugFlag("FlagSetClearDebugFlagTestA");
    ASSERT_TRUE(!TRACING_ON || flag_a.tracing());
    clearDebugFlag("FlagSetClearDebugFlagTestA");
    ASSERT_FALSE(flag_a.tracing());
    ASSERT_FALSE(flag_b.tracing());
    clearDebugFlag("FlagSetClearDebugFlagTestB");
    ASSERT_FALSE(flag_b.tracing());
    setDebugFlag("FlagSetClearDebugFlagTestB");
    ASSERT_TRUE(!TRACING_ON || flag_b.tracing());
    setDebugFlag("FlagSetClearDebugFlagTestC");
    clearDebugFlag("FlagSetClearDebugFlagTestC");
}
TEST ( DebugFlagTest , SetClearDebugFlag ) { debug :: Flag :: globalEnable ( ) ; debug :: SimpleFlag flag_a ( " " , " " ) ; debug :: SimpleFlag flag_b ( " " , " " ) ; ASSERT_FALSE ( flag_a . tracing ( ) ) ; setDebugFlag ( " " ) ; ASSERT_TRUE ( ! TRACING_ON || flag_a . tracing ( ) ) ; clearDebugFlag ( " " ) ; ASSERT_FALSE ( flag_a . tracing ( ) ) ; ASSERT_FALSE ( flag_b . tracing ( ) ) ; clearDebugFlag ( " " ) ; ASSERT_FALSE ( flag_b . tracing ( ) ) ; setDebugFlag ( " " ) ; ASSERT_TRUE ( ! TRACING_ON || flag_b . tracing ( ) ) ; setDebugFlag ( " " ) ; clearDebugFlag ( " " ) ; }
Test changing flag enabled with aux functions.
Test changing flag enabled with aux functions .
// Enable and disable a flag // Disable and enable a flag // Change a non-existent flag