test/test_streamaligner.cpp
/**
 * This testcase checks if data is replayed, if there is 
 * only data on one stream available
 * */
This testcase checks if data is replayed, if there is
only data on one stream available
This testcase checks if data is replayed if there is only data on one stream available
BOOST_AUTO_TEST_CASE( data_on_one_stream_test )
{
    std::cout<<"\n*** STREAM_ALIGNER [TEST 10] ***\n";
    StreamAligner<NUMBER_OF_STREAMS> aligner;
    aligner.setTimeout(base::Time::fromSeconds(2.0));
    const size_t N = 5;
    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, 5>(s2, base::Time::fromSeconds(1.0), std::string("a"));
    last_sample = ""; aligner.step(); BOOST_CHECK(last_sample == "a");
}
BOOST_AUTO_TEST_CASE ( data_on_one_stream_test ) { std :: cout << " \n \n " ; StreamAligner < NUMBER_OF_STREAMS > aligner ; aligner . setTimeout ( base :: Time :: fromSeconds ( 2.0 ) ) ; const size_t N = 5 ; 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 , 5 > ( s2 , base :: Time :: fromSeconds ( 1.0 ) , std :: string ( " " ) ) ; last_sample = " " ; aligner . step ( ) ; BOOST_CHECK ( last_sample == " " ) ; }
This testcase checks if data is replayed, if there is
 only data on one stream available
This testcase checks if data is replayed if there is only data on one stream available
/** callback, period_time **/ /** instant replay, as perios of s2 is zero **/