MOAB: Mesh Oriented datABase
(version 5.4.1)
|
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 | |
QualityAssessor * | mQA |
QualityImprover * | mQI |
QualityMetric * | mQM |
ObjectiveFunction * | mOF |
InstructionQueue | mQueue |
Definition at line 69 of file InstructionQueueTest.cpp.
InstructionQueueTest::InstructionQueueTest | ( | ) | [inline] |
Definition at line 113 of file InstructionQueueTest.cpp.
{}
InstructionQueueTest::CPPUNIT_TEST | ( | test_add_preconditioner | ) | [private] |
InstructionQueueTest::CPPUNIT_TEST | ( | test_remove_preconditioner | ) | [private] |
InstructionQueueTest::CPPUNIT_TEST | ( | test_insert_preconditioner | ) | [private] |
InstructionQueueTest::CPPUNIT_TEST | ( | test_add_quality_assessor | ) | [private] |
InstructionQueueTest::CPPUNIT_TEST_SUITE | ( | InstructionQueueTest | ) | [private] |
InstructionQueueTest::CPPUNIT_TEST_SUITE_END | ( | ) | [private] |
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] |
void InstructionQueueTest::test_add_preconditioner | ( | ) | [inline] |
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(); }
void InstructionQueueTest::test_add_quality_assessor | ( | ) | [inline] |
Definition at line 175 of file InstructionQueueTest.cpp.
References MBMesquite::MsqError::clear(), and CPPUNIT_ASSERT.
{ MsqPrintError err( cout ); mQueue.clear(); mQueue.add_quality_assessor( mQA, err ); CPPUNIT_ASSERT( !err ); err.clear(); mQueue.set_master_quality_improver( mQI, err ); CPPUNIT_ASSERT( !err ); err.clear(); mQueue.add_quality_assessor( mQA, err ); CPPUNIT_ASSERT( !err ); }
Definition at line 252 of file InstructionQueueTest.cpp.
References MBMesquite::InstructionQueue::add_vertex_slaver(), ASSERT_NO_ERROR, MBMesquite::MsqError::clear(), CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, MBMesquite::Settings::get_slaved_ho_node_mode(), MBMesquite::InstructionQueue::remove_vertex_slaver(), MBMesquite::Settings::SLAVE_ALL, and MBMesquite::Settings::SLAVE_CALCULATED.
{ InstructionQueue q; DummyVertexSlaver s1, s2; MsqPrintError err( std::cerr ); CPPUNIT_ASSERT( q.get_slaved_ho_node_mode() != Settings::SLAVE_CALCULATED ); q.add_vertex_slaver( &s1, err ); ASSERT_NO_ERROR( err ); CPPUNIT_ASSERT_EQUAL( Settings::SLAVE_CALCULATED, q.get_slaved_ho_node_mode() ); q.add_vertex_slaver( &s2, err ); ASSERT_NO_ERROR( err ); CPPUNIT_ASSERT_EQUAL( Settings::SLAVE_CALCULATED, q.get_slaved_ho_node_mode() ); q.remove_vertex_slaver( &s2, err ); ASSERT_NO_ERROR( err ); CPPUNIT_ASSERT_EQUAL( Settings::SLAVE_CALCULATED, q.get_slaved_ho_node_mode() ); q.remove_vertex_slaver( &s2, err ); CPPUNIT_ASSERT( err ); err.clear(); CPPUNIT_ASSERT_EQUAL( Settings::SLAVE_CALCULATED, q.get_slaved_ho_node_mode() ); q.remove_vertex_slaver( &s1, err ); ASSERT_NO_ERROR( err ); CPPUNIT_ASSERT_EQUAL( Settings::SLAVE_ALL, q.get_slaved_ho_node_mode() ); }
void InstructionQueueTest::test_insert_preconditioner | ( | ) | [inline] |
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(); }
void InstructionQueueTest::test_insert_quality_assessor | ( | ) | [inline] |
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(); }
void InstructionQueueTest::test_remove_preconditioner | ( | ) | [inline] |
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(); }
void InstructionQueueTest::test_remove_quality_assessor | ( | ) | [inline] |
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(); }
ObjectiveFunction* InstructionQueueTest::mOF [private] |
Definition at line 86 of file InstructionQueueTest.cpp.
QualityAssessor* InstructionQueueTest::mQA [private] |
Definition at line 83 of file InstructionQueueTest.cpp.
QualityImprover* InstructionQueueTest::mQI [private] |
Definition at line 84 of file InstructionQueueTest.cpp.
QualityMetric* InstructionQueueTest::mQM [private] |
Definition at line 85 of file InstructionQueueTest.cpp.
InstructionQueue InstructionQueueTest::mQueue [private] |
Definition at line 87 of file InstructionQueueTest.cpp.