test/tsked.cc
/// For time Mon 15:15:00, get the source (cms).
/// Mark it as failed.
/// Get again and expect the alternate source: ksjn
/// Mark it as failed.
/// Get again and expect the alternate source: master
///
For time Mon 15:15:00, get the source (cms).
Mark it as failed.
Get again and expect the alternate source: ksjn
Mark it as failed.
Get again and expect the alternate source: master
For time Mon 15 : 15 : 00 get the source ( cms ) . Mark it as failed . Get again and expect the alternate source : ksjn Mark it as failed . Get again and expect the alternate source : master
BOOST_AUTO_TEST_CASE( Source_fail_test )
{
    Schedule sched;
    LOG_INFO(Lgr) << "Unit test: Source_fail_test";
    sched.load(TestSchedule1);
    struct tm  *pstm = mktime( 120, Mon, 15, 15, 0 );
    spPlay_slot slot { sched.play_daytime( pstm ) };
    spSource src = slot->source();
    BOOST_TEST( src->name() == "cms" );
    src->mark_failed();
    src->describe();
    BOOST_TEST(src->failedp());
    slot = sched.play_daytime( pstm );
    spSource src2 = slot->source();
    BOOST_TEST( src2->name() == "ksjn" );
    src2->mark_failed();
    src2->describe();
    BOOST_TEST(src2->failedp());
    slot = sched.play_daytime( pstm );
    spSource src3 = slot->source();
    src3->describe();
    BOOST_TEST( src3->name() == "master" );
}
BOOST_AUTO_TEST_CASE ( Source_fail_test ) { Schedule sched ; LOG_INFO ( Lgr ) << " " ; sched . load ( TestSchedule1 ) ; struct tm * pstm = mktime ( 120 , Mon , 15 , 15 , 0 ) ; spPlay_slot slot { sched . play_daytime ( pstm ) } ; spSource src = slot -> source ( ) ; BOOST_TEST ( src -> name ( ) == " " ) ; src -> mark_failed ( ) ; src -> describe ( ) ; BOOST_TEST ( src -> failedp ( ) ) ; slot = sched . play_daytime ( pstm ) ; spSource src2 = slot -> source ( ) ; BOOST_TEST ( src2 -> name ( ) == " " ) ; src2 -> mark_failed ( ) ; src2 -> describe ( ) ; BOOST_TEST ( src2 -> failedp ( ) ) ; slot = sched . play_daytime ( pstm ) ; spSource src3 = slot -> source ( ) ; src3 -> describe ( ) ; BOOST_TEST ( src3 -> name ( ) == " " ) ; }
For time Mon 15:15:00, get the source (cms).
For time Mon 15 : 15 : 00 get the source ( cms ) .
// // //