Esempio n. 1
0
 void test_remove_preconditioner()
 {
    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();
 }
Esempio n. 2
0
  void test_add_quality_assessor()
 {
    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);
 }
Esempio n. 3
0
 void test_add_preconditioner()
 {
    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(); 
 }
Esempio n. 4
0
 void test_insert_quality_assessor()
 {
    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();
 }
Esempio n. 5
0
 void test_insert_preconditioner()
 {
    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();
 }