Exemplo n.º 1
0
BOOST_AUTO_TEST_CASE_TEMPLATE( testClear_manyItems, DPQ, both )
{
    DPQ dpq;
    typedef typename DPQ::Index Index;

    for( int i( 0 ); i < 70000; ++i )
    {
        dpq.push( i );
    }

    BOOST_CHECK( dpq.check() );

    dpq.clear();

    BOOST_CHECK( dpq.isEmpty() );
    BOOST_CHECK( dpq.check() );

    dpq.push( 2 );
    dpq.push( 20 );
    dpq.push( 30 );

    BOOST_CHECK_EQUAL( Index( 3 ), dpq.getSize() );

    dpq.clear();

    BOOST_CHECK( dpq.isEmpty() );
    BOOST_CHECK( dpq.check() );
}
Exemplo n.º 2
0
    void testClearManyItems()
    {
        DPQ dpq;
        typedef typename DPQ::Index Index;

        for( int i( 0 ); i < 70000; ++i )
        {
            dpq.push( i );
        }

        BOOST_CHECK( dpq.checkConsistency() );

        dpq.clear();

        BOOST_CHECK( dpq.isEmpty() );
        BOOST_CHECK( dpq.checkConsistency() );

        dpq.push( 2 );
        dpq.push( 20 );
        dpq.push( 30 );

        BOOST_CHECK_EQUAL( Index( 3 ), dpq.getSize() );

        dpq.clear();

        BOOST_CHECK( dpq.isEmpty() );
        BOOST_CHECK( dpq.checkConsistency() );
    }
Exemplo n.º 3
0
BOOST_AUTO_TEST_CASE_TEMPLATE( testClear, DPQ, both )
{
    DPQ dpq;
    typedef typename DPQ::Index Index;

    dpq.push( 1 );
    dpq.push( 20 );
    dpq.push( 50 );

    BOOST_CHECK_EQUAL( Index( 3 ), dpq.getSize() );

    dpq.clear();

    BOOST_CHECK( dpq.isEmpty() );
    BOOST_CHECK( dpq.check() );

    dpq.push( 2 );
    dpq.push( 20 );
    dpq.push( 30 );

    BOOST_CHECK_EQUAL( Index( 3 ), dpq.getSize() );

    dpq.clear();

    BOOST_CHECK( dpq.isEmpty() );
    BOOST_CHECK( dpq.check() );
}
Exemplo n.º 4
0
    void testClear()
    {
        DPQ dpq;

        dpq.push( 1 );
        dpq.push( 20 );
        dpq.push( 50 );

        BOOST_CHECK_EQUAL( Index( 3 ), dpq.getSize() );

        dpq.clear();

        BOOST_CHECK( dpq.isEmpty() );
        BOOST_CHECK( dpq.checkConsistency() );

        dpq.push( 2 );
        dpq.push( 20 );
        dpq.push( 30 );

        BOOST_CHECK_EQUAL( Index( 3 ), dpq.getSize() );

        dpq.clear();

        BOOST_CHECK( dpq.isEmpty() );
        BOOST_CHECK( dpq.checkConsistency() );
    }