src/base/debug.test.cc
/** Search for existent and non-existent flags. */
Search for existent and non-existent flags.
Search for existent and non - existent flags .
TEST(DebugFlagTest, FindFlag)
{
    debug::Flag::globalEnable();
    debug::SimpleFlag flag_a("FlagFindFlagTestA", "");
    debug::SimpleFlag flag_b("FlagFindFlagTestB", "");
    debug::Flag *flag;
    EXPECT_TRUE(flag = debug::findFlag("FlagFindFlagTestA"));
    ASSERT_FALSE(flag_a.tracing());
    flag->enable();
    ASSERT_TRUE(!TRACING_ON || flag_a.tracing());
    EXPECT_TRUE(flag = debug::findFlag("FlagFindFlagTestB"));
    ASSERT_FALSE(flag_b.tracing());
    flag->enable();
    ASSERT_TRUE(!TRACING_ON || flag_b.tracing());
    EXPECT_FALSE(debug::findFlag("FlagFindFlagTestC"));
}
TEST ( DebugFlagTest , FindFlag ) { debug :: Flag :: globalEnable ( ) ; debug :: SimpleFlag flag_a ( " " , " " ) ; debug :: SimpleFlag flag_b ( " " , " " ) ; debug :: Flag * flag ; EXPECT_TRUE ( flag = debug :: findFlag ( " " ) ) ; ASSERT_FALSE ( flag_a . tracing ( ) ) ; flag -> enable ( ) ; ASSERT_TRUE ( ! TRACING_ON || flag_a . tracing ( ) ) ; EXPECT_TRUE ( flag = debug :: findFlag ( " " ) ) ; ASSERT_FALSE ( flag_b . tracing ( ) ) ; flag -> enable ( ) ; ASSERT_TRUE ( ! TRACING_ON || flag_b . tracing ( ) ) ; EXPECT_FALSE ( debug :: findFlag ( " " ) ) ; }
Search for existent and non-existent flags.
Search for existent and non - existent flags .
// Enable the found flags and verify that the original flags are // enabled too // Search for a non-existent flag