src/base/debug.test.cc
/**
 * Tests that manipulate the kids to change the enablement status of the
 * compound flag.
 */
Tests that manipulate the kids to change the enablement status of the
compound flag.
Tests that manipulate the kids to change the enablement status of the compound flag .
TEST(DebugCompoundFlagTest, EnabledKids)
{
    debug::Flag::globalEnable();
    debug::SimpleFlag flag_a("CompoundFlagEnabledKidsTestKidA", "");
    debug::SimpleFlag flag_b("CompoundFlagEnabledKidsTestKidB", "");
    debug::CompoundFlag flag("CompoundFlagEnabledKidsTest", "",
        {&flag_a, &flag_b});
    ASSERT_FALSE(flag_a.tracing());
    ASSERT_FALSE(flag_b.tracing());
    ASSERT_FALSE(flag.tracing());
    flag_a.enable();
    ASSERT_TRUE(!TRACING_ON || flag_a.tracing());
    ASSERT_FALSE(flag_b.tracing());
    ASSERT_FALSE(flag.tracing());
    ASSERT_TRUE(!TRACING_ON || flag_a.tracing());
    ASSERT_FALSE(flag_b.tracing());
    ASSERT_FALSE(flag.tracing());
    flag_b.enable();
    ASSERT_TRUE(!TRACING_ON || flag_a.tracing());
    ASSERT_TRUE(!TRACING_ON || flag_b.tracing());
    flag_a.disable();
    ASSERT_FALSE(flag_a.tracing());
    ASSERT_TRUE(!TRACING_ON || flag_b.tracing());
    ASSERT_FALSE(flag.tracing());
}
TEST ( DebugCompoundFlagTest , EnabledKids ) { debug :: Flag :: globalEnable ( ) ; debug :: SimpleFlag flag_a ( " " , " " ) ; debug :: SimpleFlag flag_b ( " " , " " ) ; debug :: CompoundFlag flag ( " " , " " , { & flag_a , & flag_b } ) ; ASSERT_FALSE ( flag_a . tracing ( ) ) ; ASSERT_FALSE ( flag_b . tracing ( ) ) ; ASSERT_FALSE ( flag . tracing ( ) ) ; flag_a . enable ( ) ; ASSERT_TRUE ( ! TRACING_ON || flag_a . tracing ( ) ) ; ASSERT_FALSE ( flag_b . tracing ( ) ) ; ASSERT_FALSE ( flag . tracing ( ) ) ; ASSERT_TRUE ( ! TRACING_ON || flag_a . tracing ( ) ) ; ASSERT_FALSE ( flag_b . tracing ( ) ) ; ASSERT_FALSE ( flag . tracing ( ) ) ; flag_b . enable ( ) ; ASSERT_TRUE ( ! TRACING_ON || flag_a . tracing ( ) ) ; ASSERT_TRUE ( ! TRACING_ON || flag_b . tracing ( ) ) ; flag_a . disable ( ) ; ASSERT_FALSE ( flag_a . tracing ( ) ) ; ASSERT_TRUE ( ! TRACING_ON || flag_b . tracing ( ) ) ; ASSERT_FALSE ( flag . tracing ( ) ) ; }
Tests that manipulate the kids to change the enablement status of the
 compound flag.
Tests that manipulate the kids to change the enablement status of the compound flag .
// Test enabling only flag A // Test that enabling both flags enables the compound flag // Test that disabling one of the flags disables the compound flag