test/test_streamaligner.cpp
/**
 * This testcase checks, if all samples are replayed,
 * if a newer sample is given to the aligner first.  
 * This test case is about the inital case.
 * */
This testcase checks, if all samples are replayed,
if a newer sample is given to the aligner first.
This test case is about the inital case.
This testcase checks if all samples are replayed if a newer sample is given to the aligner first . This test case is about the inital case .
BOOST_AUTO_TEST_CASE(newer_data_first_init_case)
{
    std::cout<<"\n*** STREAM_ALIGNER [TEST 11] ***\n";
    StreamAligner<NUMBER_OF_STREAMS> aligner; 
    aligner.setTimeout( base::Time::fromSeconds(2.0) );
    const size_t N = 5;
    int s1 = aligner.registerStream<std::string, N>( &test_callback, base::Time::fromSeconds(2,0));
    int s2 = aligner.registerStream<std::string, N>( &test_callback, base::Time::fromSeconds(0,0));
    aligner.push<std::string, N>( s1, base::Time::fromSeconds(1.1), std::string("b"));
    last_sample = ""; aligner.step(); BOOST_CHECK(last_sample == "");
    aligner.push<std::string, N>(s2, base::Time::fromSeconds(1.0), std::string("a"));
    last_sample = ""; aligner.step(); BOOST_CHECK(last_sample == "a");
}
BOOST_AUTO_TEST_CASE ( newer_data_first_init_case ) { std :: cout << " \n \n " ; StreamAligner < NUMBER_OF_STREAMS > aligner ; aligner . setTimeout ( base :: Time :: fromSeconds ( 2.0 ) ) ; const size_t N = 5 ; int s1 = aligner . registerStream < std :: string , N > ( & test_callback , base :: Time :: fromSeconds ( 2 , 0 ) ) ; int s2 = aligner . registerStream < std :: string , N > ( & test_callback , base :: Time :: fromSeconds ( 0 , 0 ) ) ; aligner . push < std :: string , N > ( s1 , base :: Time :: fromSeconds ( 1.1 ) , std :: string ( " " ) ) ; last_sample = " " ; aligner . step ( ) ; BOOST_CHECK ( last_sample == " " ) ; aligner . push < std :: string , N > ( s2 , base :: Time :: fromSeconds ( 1.0 ) , std :: string ( " " ) ) ; last_sample = " " ; aligner . step ( ) ; BOOST_CHECK ( last_sample == " " ) ; }
This testcase checks, if all samples are replayed,
 if a newer sample is given to the aligner first.
This testcase checks if all samples are replayed if a newer sample is given to the aligner first .
/** callback, period_time **/