consolidate_otn_states(states);
auto& state = states[0];
- if ( !state )
+ if ( !state.is_active() )
continue;
// FIXIT-L should we assert(otn->sigInfo)?
return false;
for ( unsigned i = 0; i < lhs.size(); ++i )
- if ( lhs[i].state != rhs[i] )
+ if ( lhs[i].state.is_active() != rhs[i].is_active() )
return false;
return true;
CHECK( state_a.alerts == 0 );
}
- SECTION( "bool()" )
+ SECTION( "is_active" )
{
- CHECK( state_a );
+ CHECK( true == state_a.is_active() );
OtnState state_c = OtnState();
- CHECK_FALSE( state_c );
+ CHECK( true == state_c.is_active() );
state_c.elapsed = 1_ticks;
- CHECK( state_c );
+ CHECK( true == state_c.is_active() );
state_c.elapsed = 0_ticks;
state_c.checks = 1;
- CHECK( state_c );
+ CHECK( true == state_c.is_active() );
}
}
CHECK( copy.sig_info.gid == entry.sig_info.gid );
CHECK( copy.sig_info.sid == entry.sig_info.sid );
CHECK( copy.sig_info.rev == entry.sig_info.rev );
- CHECK( copy.state == entry.state );
+ CHECK( (copy.state.is_active() == entry.state.is_active()) );
}
SECTION( "copy construction" )
CHECK( copy.sig_info.gid == entry.sig_info.gid );
CHECK( copy.sig_info.sid == entry.sig_info.sid );
CHECK( copy.sig_info.rev == entry.sig_info.rev );
- CHECK( copy.state == entry.state );
+ CHECK( (copy.state.is_active() == entry.state.is_active()) );
}
SECTION( "elapsed" )
};
static bool include_fn(const ProfilerNode& node)
-{ return node.get_stats().time; }
+{ return node.get_stats().time.is_active(); }
static void print_fn(StatsTable& t, const View& v)
{
ProfilerBuilder<time_stats::View> builder(time_stats::include_fn);
auto root = builder.build(nodes.get_root());
- if ( root.children.empty() && !root.view.stats )
+ if ( root.children.empty() && !root.view.stats.is_active() )
return;
const auto& sorter = time_stats::sorters[config.sort];
CHECK( stats == TimeProfilerStats() );
}
- SECTION( "bool()" )
+ SECTION( "is_active" )
{
- CHECK( stats );
- CHECK_FALSE( TimeProfilerStats() );
+ CHECK( true == stats.is_active() );
+ CHECK_FALSE( TimeProfilerStats().is_active() );
}
}
{
CHECK( view.name == "foo" );
CHECK( view.stats == the_stats.time );
- CHECK_FALSE( view.caller_stats );
+ CHECK( false == view.caller_stats.is_active() );
}
SECTION( "elapsed" )
parent.stats = { 24_ticks, 6 };
time_stats::View child(node, &parent);
- CHECK( child.caller_stats );
+ CHECK( true == child.caller_stats.is_active() );
SECTION( "pct_caller" )
{
TEST_CASE( "time profiler time context disabled", "[profiler][time_profiler]" )
{
TimeProfilerStats stats;
- REQUIRE_FALSE( stats );
+ REQUIRE( false == stats.is_active() );
TimeProfilerStats::set_enabled(false);
SECTION( "lifetime" )
avoid_optimization();
ctx.stop();
- CHECK( !stats );
+ CHECK( false == stats.is_active() );
}
SECTION( "reentrance" )
TEST_CASE( "time profiler time context", "[profiler][time_profiler]" )
{
TimeProfilerStats stats;
- REQUIRE_FALSE( stats );
+ REQUIRE( false == stats.is_active() );
TimeProfilerStats::set_enabled(true);
SECTION( "lifetime" )
avoid_optimization();
ctx.stop();
- CHECK( stats );
+ CHECK( true == stats.is_active() );
}
SECTION( "reentrance" )