• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ cppunit::TestSuite类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cppunit::TestSuite的典型用法代码示例。如果您正苦于以下问题:C++ TestSuite类的具体用法?C++ TestSuite怎么用?C++ TestSuite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TestSuite类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: suite

CppUnit::Test* ObjectPoolTest::suite()
{
	CppUnit::TestSuite* suiteOfTests = new CppUnit::TestSuite("ObjectPoolTest");
	suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>( 
		"testSimple", 
		&ObjectPoolTest::testSimple ) );

	suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>( 
		"testCreation", 
		&ObjectPoolTest::testCreation ) );

	suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>( 
		"testInvalidChunkSize", 
		&ObjectPoolTest::testInvalidChunkSize ) );

	suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>( 
		"testAcquire", 
		&ObjectPoolTest::testAcquire ) );

	suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>( 
		"testExclusivity", 
		&ObjectPoolTest::testExclusivity ) );

	suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>( 
		"testRelease", 
		&ObjectPoolTest::testRelease ) );
	return suiteOfTests;
}
开发者ID:EmuxEvans,项目名称:Woody-Ye-s-Code-Share,代码行数:28,代码来源:ObjectPoolTest.cpp


示例2:

 static CppUnit::Test *suite()
 {
   CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite( "JTSArray4MessageTest" );
   
   suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>( 
                                  "testConstructionDefaults", 
                                  &JTSArray4MessageTest::testConstructionDefaults ) );
                                  
   suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>( 
                                  "testSetGetOperations (TP_3.3.5.1)", 
                                  &JTSArray4MessageTest::testSetGetOperations ) );
                                  
   suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>( 
                                  "testEncodeToSpec (TP_3.3.5.2)", 
                                  &JTSArray4MessageTest::testEncodeToSpec ) );
                                  
   suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>( 
                                  "testEncodeDecodeOperations (TP_3.3.5.3)", 
                                  &JTSArray4MessageTest::testEncodeDecodeOperations ) );                                   
                                                                     
   suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>( 
                                  "testEquality", 
                                  &JTSArray4MessageTest::testEquality ) );
                                  
   suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>(
                                  "testInequality",
                                  &JTSArray4MessageTest::testInequality ) );
   return suiteOfTests;
 }
开发者ID:lavernw,项目名称:jaustoolset,代码行数:29,代码来源:array4_utst.cpp


示例3:

CppUnit::Test * ind_withIDTest::suite()
{
  CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite( "ind_withIDTest"  );
  suiteOfTests->addTest( 
			new CppUnit::TestCaller<ind_withIDTest>(
								"testNonmemPars_h", 
								&ind_withIDTest::testNonmemPars_h ) );
  suiteOfTests->addTest( 
			new CppUnit::TestCaller<ind_withIDTest>(
								"testIndDataClass", 
								&ind_withIDTest::testIndDataClass ) );
  suiteOfTests->addTest( 
			new CppUnit::TestCaller<ind_withIDTest>(
								"testDataSetClass", 
								&ind_withIDTest::testDataSetClass ) );
  suiteOfTests->addTest( 
			new CppUnit::TestCaller<ind_withIDTest>(
								"testPredClass", 
								&ind_withIDTest::testPredClass ) );
  suiteOfTests->addTest( 
			new CppUnit::TestCaller<ind_withIDTest>(
								"testDriver", 
								&ind_withIDTest::testDriver ) );
  suiteOfTests->addTest( 
			new CppUnit::TestCaller<ind_withIDTest>(
								"testReportML", 
								&ind_withIDTest::testReportML ) );
  return suiteOfTests;
}
开发者ID:ernstae,项目名称:sysforpopkinetics,代码行数:29,代码来源:ind_withIDTest.cpp


示例4: suite

CppUnit::Test* LoggingTestSuite::suite()
{
	CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LoggingTestSuite");

	pSuite->addTest(LoggerTest::suite());
	pSuite->addTest(ChannelTest::suite());
	pSuite->addTest(PatternFormatterTest::suite());
	pSuite->addTest(FileChannelTest::suite());
	pSuite->addTest(SimpleFileChannelTest::suite());
	pSuite->addTest(LoggingFactoryTest::suite());
	pSuite->addTest(LoggingRegistryTest::suite());
	pSuite->addTest(LogStreamTest::suite());

	return pSuite;
}
开发者ID:Alcibiades586,项目名称:roadrunner,代码行数:15,代码来源:LoggingTestSuite.cpp


示例5:

CppUnit::TestSuite *ABTMessageTest::getSuite(void)
{
     CppUnit::TestSuite          *suite = new CppUnit::TestSuite();
     suite->addTest(
        new CppUnit::TestCaller<ABTMessageTest>(
            "ABTMessageTest::test_constructor",
            &ABTMessageTest::test_constructor));
    
    suite->addTest(
        new CppUnit::TestCaller<ABTMessageTest>(
            "ABTMessageTest::test_accessors",
            &ABTMessageTest::test_accessors));
    
    suite->addTest(
        new CppUnit::TestCaller<ABTMessageTest>(
            "ABTMessageTest::test_xml",
            &ABTMessageTest::test_xml));

    return suite;
}
开发者ID:mransan,项目名称:maxmm,代码行数:20,代码来源:ABTMessageTest.cpp


示例6: ListAllTestsInTestSuite

/*! List all available tests in a given test suite. */
int ListAllTestsInTestSuite(CppUnit::Test* tests) {
    int count = 0;
    // try to see if this is a TestSuite
    CppUnit::TestSuite* testSuite = dynamic_cast<CppUnit::TestSuite *>(tests);
    // it's a suite, check all components
    if (testSuite != NULL) {
        std::vector<CppUnit::Test*> allTestsVector = testSuite->getTests();
        std::vector<CppUnit::Test*>::iterator testIterator;
        for (testIterator = allTestsVector.begin();
             testIterator != allTestsVector.end();
             testIterator++) {
            count += ListAllTestsInTestSuite(*testIterator);
        }
    } else {
        // it's a test, get the name
        count++;
        std::cout << tests->getName() << std::endl;
    }
    return count;
}
开发者ID:Shuyoung,项目名称:cisst,代码行数:21,代码来源:cisstTestMain.cpp


示例7: main

int main(int argc, char* argv[])
{
// Get the top level suite from the registry
//CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
	CppUnit::TestSuite *unitSuite = new CppUnit::TestSuite( "All unit test" );
	unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("VarTableTest").makeTest());	
	unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("ProcTableTest").makeTest());
	unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("ModifiesTest").makeTest());
	unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("UsesTest").makeTest());	
	CppUnit::TestFactoryRegistry::getRegistry().addTestToSuite(unitSuite);
	CppUnit::TextUi::TestRunner runner;


	runner.addTest(unitSuite);
	bool wasSucessful = runner.run();

//cin.get();
getchar();

return wasSucessful ? 0 : 1;
}
开发者ID:khzaw,项目名称:xcalibur,代码行数:21,代码来源:UnitTest.cpp


示例8: InstantiateTests

CppUnit::Test * InstantiateTests(const cisstTestParameters::TestNameContainerType & testNames)
{
    CppUnit::Test * wholeRegistry = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    if (testNames.empty())
        return wholeRegistry;

    CppUnit::TestSuite * testSuite = new CppUnit::TestSuite("");
    cisstTestParameters::TestNameContainerType::const_iterator nameIterator
        = testNames.begin();
    while (nameIterator != testNames.end()) {
        CppUnit::Test * test = FindTestInTestSuite(wholeRegistry, (*nameIterator));
        if (test != NULL) {
            testSuite->addTest(test);
        } else {
            std::cerr << "Failed to instantiate " << (*nameIterator) << std::endl;
        }

        ++nameIterator;
    }
    return testSuite;
}
开发者ID:Shuyoung,项目名称:cisst,代码行数:21,代码来源:cisstTestMain.cpp


示例9: main

int main(int argc, char** argv)
{
	CppUnit::TestSuite suite;

//	FrontSparcTest fst("FrontSparcTest");
//	  FrontendTest fet("FrontendTest");
//	FrontPentTest fpt("FrontPentTest");
	FrontPentTest fSt("FrontPentTest");

//	fst.registerTests(&suite);
//	fpt.registerTests(&suite);
	fSt.registerTests(&suite);

	CppUnit::TextTestResult res;

	prog.readLibParams();		 // Read library signatures (once!)
	suite.run( &res );
	std::cout << res << std::endl;

	return 0;
}
开发者ID:PhuongLam94,项目名称:Boomerang-Production,代码行数:21,代码来源:testFront.cpp


示例10: suite

CppUnit::Test* TriangleTestFixture::suite()
{
	// Create test suite
	CppUnit::TestSuite* suiteOfTests = new CppUnit::TestSuite("Triangle Tests");

	auto testFixture = new TriangleTestFixture();

	// Add tests
	suiteOfTests->addTest(new CppUnit::TestCaller<TriangleTestFixture>(
		"testEquality", &TriangleTestFixture::testIdentification, testFixture));

	suiteOfTests->addTest(new CppUnit::TestCaller<TriangleTestFixture>(
		"predicateTesting", &TriangleTestFixture::predicateTesting, testFixture));

	suiteOfTests->addTest(new CppUnit::TestCaller<TriangleTestFixture>(
		"negativeTesting", &TriangleTestFixture::negativeTesting, testFixture));

	//delete testFixture;

	return suiteOfTests;
}
开发者ID:Amazao2,项目名称:CPPUnitDemo,代码行数:21,代码来源:TriangleTestFixture.cpp


示例11: suite

CppUnit::Test* SocketsTestSuite::suite()
{
    CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SocketsTestSuite");

    pSuite->addTest(SocketTest::suite());
    pSuite->addTest(SocketStreamTest::suite());
    pSuite->addTest(DatagramSocketTest::suite());
    pSuite->addTest(NetworkInterfaceTest::suite());
    pSuite->addTest(MulticastSocketTest::suite());
    pSuite->addTest(DialogSocketTest::suite());
    pSuite->addTest(RawSocketTest::suite());

    return pSuite;
}
开发者ID:as2120,项目名称:ZPoco,代码行数:14,代码来源:SocketsTestSuite.cpp


示例12: ConcurrencyComposite

CppUnit::Test *SharedQueueTest::suite() {
    // Create a ConcurrencyComposite to act as our test suite.   Each test added to the composite will
    // be run in its own thread.

    ConcurrencyComposite *composite = new ConcurrencyComposite("SharedQueueTest");

    // Create 10 consumer threads.   Each thread will do a testPop followed by a testTryPop 100 times
    // before returning.

    for (int i = 0; i < 10; ++i) {
        CppUnit::TestSuite *consumer = new CppUnit::TestSuite();

        consumer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testPop", &SharedQueueTest::testPop));
        //consumer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testPop", &SharedQueueTest::testPop));
        consumer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testTryPop", &SharedQueueTest::testTryPop));

        composite->addTest(new RepetitionDecorator(consumer, 100));
    }

    // Now create 10 producer threads.   Each thread will do a testPush followed by a testTryPush 100 times
    // before returning.

    for (int i = 0; i < 10; ++i) {
        CppUnit::TestSuite *producer = new CppUnit::TestSuite();

        producer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testPush", &SharedQueueTest::testPush));
        producer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testTryPush", &SharedQueueTest::testTryPush));

        composite->addTest(new RepetitionDecorator(producer, 100));
    }

    return composite;
}
开发者ID:duderino,项目名称:rilakkuma,代码行数:33,代码来源:SharedQueueTest.cpp


示例13: suite

CppUnit::Test* TestPottsSpin::suite()
{
    CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite("TestPottsSpin");
    
    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_constructor", &TestPottsSpin::test_constructor ) );

    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_get_set_value", &TestPottsSpin::test_get_set_value ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_get_set_max_value", &TestPottsSpin::test_get_set_max_value ) );

    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_operator_equal", &TestPottsSpin::test_operator_equal ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_operator_multiply", &TestPottsSpin::test_operator_multiply ) );

    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_all_possible_values", &TestPottsSpin::test_all_possible_values ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_random", &TestPottsSpin::test_random ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_random_differ", &TestPottsSpin::test_random_differ ) );

    return suiteOfTests;
}
开发者ID:SpeckFleck,项目名称:mocasinns,代码行数:18,代码来源:test_potts_spin.cpp


示例14:

    static CppUnit::Test *suite()
    {
      CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite("GraphTest");

      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("graphInsertTest", &GraphTest::graphInsertTest));
      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("diGraphInsertTest", &GraphTest::diGraphInsertTest));
      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("completeGraphTest", &GraphTest::completeGraphTest));
      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("findTest", &GraphTest::findTest));
      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("traversalTest", &GraphTest::traversalTest));
      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("iteratorTest", &GraphTest::iteratorTest));
      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("printTest", &GraphTest::printTest));
      suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("printPrunerTest", &GraphTest::printPrunerTest));

      return suiteOfTests;
    }
开发者ID:Brainiarc7,项目名称:TS,代码行数:15,代码来源:GraphTest.hpp


示例15: suite

CppUnit::Test* DateTimeTestSuite::suite()
{
	CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DateTimeTestSuite");

	pSuite->addTest(TimestampTest::suite());
	pSuite->addTest(ClockTest::suite());
	pSuite->addTest(TimespanTest::suite());
	pSuite->addTest(TimezoneTest::suite());
	pSuite->addTest(DateTimeTest::suite());
	pSuite->addTest(LocalDateTimeTest::suite());
	pSuite->addTest(DateTimeFormatterTest::suite());
	pSuite->addTest(DateTimeParserTest::suite());

	return pSuite;
}
开发者ID:alexdarling,项目名称:roadrunner,代码行数:15,代码来源:DateTimeTestSuite.cpp


示例16: suite

CppUnit::Test* TestHistogram::suite()
{
    CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite("TestHistograms/TestHistogram");
    
    suiteOfTests->addTest( new CppUnit::TestCaller<TestHistogram>("TestHistograms/TestHistogram: test_operator_fill", &TestHistogram::test_operator_fill ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestHistogram>("TestHistograms/TestHistogram: test_operator_access", &TestHistogram::test_operator_access ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestHistogram>("TestHistograms/TestHistogram: test_operator_increment", &TestHistogram::test_operator_increment ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestHistogram>("TestHistograms/TestHistogram: test_operator_divide", &TestHistogram::test_operator_divide ) );

    suiteOfTests->addTest( new CppUnit::TestCaller<TestHistogram>("TestHistograms/TestHistogram: test_initialise_empty", &TestHistogram::test_initialise_empty ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestHistogram>("TestHistograms/TestHistogram: test_insert", &TestHistogram::test_insert ) );
    suiteOfTests->addTest( new CppUnit::TestCaller<TestHistogram>("TestHistograms/TestHistogram: test_serialize", &TestHistogram::test_serialize ) );

    return suiteOfTests;
}
开发者ID:bkrueger,项目名称:mocasinns,代码行数:15,代码来源:test_histogram.cpp


示例17: suite

CppUnit::Test* TextTestSuite::suite()
{
	CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TextTestSuite");

	pSuite->addTest(TextIteratorTest::suite());
	pSuite->addTest(TextBufferIteratorTest::suite());
	pSuite->addTest(TextConverterTest::suite());
	pSuite->addTest(StreamConverterTest::suite());
	pSuite->addTest(TextEncodingTest::suite());
	pSuite->addTest(UTF8StringTest::suite());
#ifndef POCO_NO_WSTRING
	pSuite->addTest(UnicodeConverterTest::suite());
#endif

	return pSuite;
}
开发者ID:Chingliu,项目名称:poco,代码行数:16,代码来源:TextTestSuite.cpp


示例18:

CppUnit::Test *DestructionTest2::suite(void)
{	
	typedef BThreadedTestCaller<DestructionTest2> DestructionTest2Caller;
	CppUnit::TestSuite *testSuite = new CppUnit::TestSuite("DestructionTest2");
	
	// Make a benaphore based test object, create a ThreadedTestCase for it and add
	// two threads to it.
	DestructionTest2 *theTest = new DestructionTest2("Benaphore", true);
	DestructionTest2Caller *threadedTest1 = new DestructionTest2Caller("BLocker::Destruction Test #2 (benaphore)", theTest);
	threadedTest1->addThread("A", &DestructionTest2::TestThread1);
	threadedTest1->addThread("B", &DestructionTest2::TestThread2);
				
	// Make a semaphore based test object, create a ThreadedTestCase for it and add
	// three threads to it.					 		
	theTest = new DestructionTest2("Semaphore", false);
	DestructionTest2Caller *threadedTest2 = new DestructionTest2Caller("BLocker::Destruction Test #2 (semaphore)", theTest);
	threadedTest2->addThread("A", &DestructionTest2::TestThread1);
	threadedTest2->addThread("B", &DestructionTest2::TestThread2);
									 		
	testSuite->addTest(threadedTest1);	
	testSuite->addTest(threadedTest2);
	return(testSuite);
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:23,代码来源:DestructionTest2.cpp


示例19: GetTest

CppUnit::Test* GetTest(CppUnit::Test* tests, const std::string& name)
{

  CppUnit::TestSuite* testSuite = dynamic_cast<CppUnit::TestSuite *>(tests);

  CppUnit::Test* returnTest = NULL;

  if (testSuite)
  {
    if (testSuite->getName() == name)
    {
      return (testSuite);
    }
    else
    {
      std::vector<CppUnit::Test*> allTests = testSuite->getTests();
      std::vector<CppUnit::Test*>::iterator testi;
      for (testi = allTests.begin();
           testi != allTests.end();
           testi++)
      {
        returnTest = GetTest(*testi, name);
        if (returnTest)
          return (returnTest);
      }
    }
  }
  else
  {
    if (tests->getName() == name)
    {
      return (tests);
    }
  }
  return NULL;
};
开发者ID:radarsat1,项目名称:siconos,代码行数:36,代码来源:TestMain.cpp


示例20: suite

CppUnit::Test* SocketsTestSuite::suite()
{
	CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SocketsTestSuite");

	pSuite->addTest(SocketTest::suite());
	pSuite->addTest(SocketStreamTest::suite());
	pSuite->addTest(DatagramSocketTest::suite());
	pSuite->addTest(DialogSocketTest::suite());
	pSuite->addTest(RawSocketTest::suite());
#ifdef POCO_NET_HAS_INTERFACE
	pSuite->addTest(MulticastSocketTest::suite());
#endif
	return pSuite;
}
开发者ID:12307,项目名称:poco,代码行数:14,代码来源:SocketsTestSuite.cpp



注:本文中的cppunit::TestSuite类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cppunit::TextTestRunner类代码示例发布时间:2022-05-31
下一篇:
C++ cppunit::TestRunner类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap