MOAB: Mesh Oriented datABase  (version 5.3.1)
InstructionQueueTest Class Reference
+ Inheritance diagram for InstructionQueueTest:
+ Collaboration diagram for InstructionQueueTest:

Public Member Functions

void setUp ()
void tearDown ()
 InstructionQueueTest ()
void test_add_preconditioner ()
void test_remove_preconditioner ()
void test_insert_preconditioner ()
void test_add_quality_assessor ()
void test_remove_quality_assessor ()
void test_insert_quality_assessor ()
void test_add_remove_vertex_slaver ()

Private Member Functions

 CPPUNIT_TEST_SUITE (InstructionQueueTest)
 CPPUNIT_TEST (test_add_preconditioner)
 CPPUNIT_TEST (test_remove_preconditioner)
 CPPUNIT_TEST (test_insert_preconditioner)
 CPPUNIT_TEST (test_add_quality_assessor)
 CPPUNIT_TEST (test_remove_quality_assessor)
 CPPUNIT_TEST (test_insert_quality_assessor)
 CPPUNIT_TEST (test_add_remove_vertex_slaver)
 CPPUNIT_TEST_SUITE_END ()

Private Attributes

QualityAssessormQA
QualityImprovermQI
QualityMetricmQM
ObjectiveFunctionmOF
InstructionQueue mQueue

Detailed Description

Definition at line 69 of file InstructionQueueTest.cpp.


Constructor & Destructor Documentation

Definition at line 113 of file InstructionQueueTest.cpp.

{}

Member Function Documentation

void InstructionQueueTest::setUp ( ) [inline]

Definition at line 90 of file InstructionQueueTest.cpp.

References CPPUNIT_ASSERT.

    {
        MsqPrintError err( cout );
        // creates a quality assessor and a qualilty improver
        mQM = new IdealWeightInverseMeanRatio( err );
        CPPUNIT_ASSERT( !err );
        mOF = new LPtoPTemplate( mQM, 2, err );
        CPPUNIT_ASSERT( !err );
        mQI = new SteepestDescent( mOF );
        mQA = new QualityAssessor();
        mQA->set_stopping_assessment( mQM );
        CPPUNIT_ASSERT( !err );
    }
void InstructionQueueTest::tearDown ( ) [inline]

Definition at line 104 of file InstructionQueueTest.cpp.

    {
        delete mQA;
        delete mQI;
        delete mQM;
        delete mOF;
    }

Definition at line 115 of file InstructionQueueTest.cpp.

References MBMesquite::MsqError::clear(), and CPPUNIT_ASSERT.

    {
        MsqPrintError err( cout );
        mQueue.clear();
        mQueue.add_preconditioner( mQI, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.set_master_quality_improver( mQI, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.add_preconditioner( mQI, err );
        CPPUNIT_ASSERT_MESSAGE( "preconditioner cannot be added after master QI", err );
        err.clear();
    }

Definition at line 157 of file InstructionQueueTest.cpp.

References MBMesquite::MsqError::clear(), and CPPUNIT_ASSERT.

    {
        MsqPrintError err( cout );
        mQueue.clear();
        mQueue.add_preconditioner( mQI, err );    // 0
        mQueue.add_quality_assessor( mQA, err );  // 1
        mQueue.add_preconditioner( mQI, err );    // 2
        mQueue.set_master_quality_improver( mQI, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.insert_preconditioner( mQI, 2, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.insert_preconditioner( mQI, 5, err );
        CPPUNIT_ASSERT_MESSAGE( "should not insert after master QualityImprover", err );
        err.clear();
    }

Definition at line 213 of file InstructionQueueTest.cpp.

References MBMesquite::MsqError::clear(), and CPPUNIT_ASSERT.

    {
        MsqPrintError err( cout );
        mQueue.clear();
        mQueue.add_preconditioner( mQI, err );    // 0
        mQueue.add_quality_assessor( mQA, err );  // 1
        mQueue.add_preconditioner( mQI, err );    // 2
        mQueue.set_master_quality_improver( mQI, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.insert_quality_assessor( mQA, 2, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.insert_quality_assessor( mQA, 5, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
    }

Definition at line 130 of file InstructionQueueTest.cpp.

References MBMesquite::MsqError::clear(), and CPPUNIT_ASSERT.

    {
        MsqPrintError err( cout );
        mQueue.clear();
        mQueue.add_preconditioner( mQI, err );    // 0
        mQueue.add_quality_assessor( mQA, err );  // 1
        mQueue.add_preconditioner( mQI, err );    // 2
        mQueue.set_master_quality_improver( mQI, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.remove_preconditioner( 2, err );
        CPPUNIT_ASSERT_MESSAGE( "should remove QualityImprover", !err );
        err.clear();
        mQueue.remove_preconditioner( 3, err );
        CPPUNIT_ASSERT_MESSAGE( "should not remove master QualityImprover", err );
        err.clear();
        mQueue.remove_preconditioner( 1, err );
        CPPUNIT_ASSERT_MESSAGE( "should not remove QualityAssessor", err );
        err.clear();
        mQueue.remove_preconditioner( 0, err );
        CPPUNIT_ASSERT_MESSAGE( "should  remove QualityImprover", !err );
        err.clear();
        mQueue.remove_preconditioner( 0, err );
        CPPUNIT_ASSERT_MESSAGE( "should not remove QualityAssessor", err );
        err.clear();
    }

Definition at line 189 of file InstructionQueueTest.cpp.

References MBMesquite::MsqError::clear(), and CPPUNIT_ASSERT.

    {
        MsqPrintError err( cout );
        mQueue.clear();
        mQueue.add_preconditioner( mQI, err );    // 0
        mQueue.add_quality_assessor( mQA, err );  // 1
        mQueue.add_preconditioner( mQI, err );    // 2
        mQueue.set_master_quality_improver( mQI, err );
        CPPUNIT_ASSERT( !err );
        err.clear();
        mQueue.remove_quality_assessor( 2, err );
        CPPUNIT_ASSERT_MESSAGE( "should not remove QualityImprover", err );
        err.clear();
        mQueue.remove_quality_assessor( 3, err );
        CPPUNIT_ASSERT_MESSAGE( "should not remove master QualityImprover", err );
        err.clear();
        mQueue.remove_quality_assessor( 1, err );
        CPPUNIT_ASSERT_MESSAGE( "should remove QualityAssessor", !err );
        err.clear();
        mQueue.remove_quality_assessor( 1, err );
        CPPUNIT_ASSERT_MESSAGE( "should not remove QualityImprover", err );
        err.clear();
    }

Member Data Documentation

Definition at line 83 of file InstructionQueueTest.cpp.

Definition at line 84 of file InstructionQueueTest.cpp.

Definition at line 85 of file InstructionQueueTest.cpp.

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines