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

C++ Tester类代码示例

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

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



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

示例1: test_class_SSArray_ctor_dctor_count

// test_class_SSArray_ctor_dctor_count
// Test suite for class template SSArray, number of class to item type
//  ctor, dctor.
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_SSArray_ctor_dctor_count(Tester & t)
{
    std::cout << "Test Suite: class template SSArray - ctor, dctor count"
              << std::endl;

    // Check number of value type ctor/dctor calls
    //  on array creation & destruction
    Counter::reset();
    { // Block, so we get dctor calls before function ends
        const SSArray<Counter> tacc(10);

        t.test(Counter::getCtorCount() == 10,
          "Counting default ctor calls due to array creation");

        Counter::reset();
    }
    t.test(Counter::getDctorCount() == 10,
      "Counting dctor calls due to destruction");

/*
    // Check correct number of value type ctor & dctor calls
    //  on self-assignment
    SSArray<Counter> tacc2(10);
    Counter::reset();
    tacc2 = tacc2;
    int i1 = Counter::getCtorCount() + Counter::getDctorCount();
    t.test(i1 == 0 || i1 == 20, "Self-assignment ctor/dctor calls");
*/
}
开发者ID:jasonwarta,项目名称:CS311_Assignments,代码行数:37,代码来源:ssarray_test.cpp


示例2: test_class_SSArray_bracket_op

// test_class_SSArray_bracket_op
// Test suite for class Product, bracket operator
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate have been messages printed to cout.
void test_class_SSArray_bracket_op(Tester & t)
{
    std::cout << "Test Suite: class Product, bracket operator" << std::endl;

    const int theSize = 10;
    bool noErrors;  // True if no errors encountered
    int i;          // Counter

    SSArray<int> ssai(theSize);
    for (i = 0; i < theSize; ++i)
        ssai[i] = 15 - i * i;

    noErrors = true;
    for (i = 0; i < theSize; ++i)
    {
        if (ssai[i] != 15 - i * i)
            noErrors = false;
    }
    t.test(noErrors, "Bracket operator (non-const)");

    // Make const version, no copy
    const SSArray<int> & ssaiRef = ssai;

    noErrors = true;
    for (i = 0; i < theSize; ++i)
    {
        if (ssaiRef[i] != 15 - i * i)
            noErrors = false;
    }
    t.test(noErrors, "Bracket operator (const)");
}
开发者ID:amiel,项目名称:random-useless-scripts,代码行数:37,代码来源:ssarray-test.cpp


示例3: run_main

int
run_main (int, ACE_TCHAR *[])
{
    ACE_START_TEST (ACE_TEXT ("RMCast_Retransmission_Test"));

    ACE_DEBUG ((LM_DEBUG,
                ACE_TEXT ("This is ACE Version %u.%u.%u\n\n"),
                ACE::major_version(),
                ACE::minor_version(),
                ACE::beta_version()));

    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Running single threaded test\n")));
        //! Run the test in single threaded mode
        Tester tester;
        tester.run (100);
        tester.validate_message_count ();
    }
    {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Running multi threaded test\n")));
        //! Run the test in multi-threaded mode
        Tester tester;
        Task task (&tester);
        if (task.activate (THR_NEW_LWP|THR_JOINABLE, 4) == -1)
            ACE_ERROR_RETURN ((LM_ERROR,
                               ACE_TEXT ("Cannot activate the threads\n")),
                              1);
        ACE_Thread_Manager::instance ()->wait ();
        tester.validate_message_count ();
    }

    ACE_END_TEST;
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:34,代码来源:RMCast_Retransmission_Test.cpp


示例4: test_class_SSArray_copy_assn

// test_class_SSArray_copy_assn
// Test suite for class SSArray, copy assignment
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate have been messages printed to cout.
void test_class_SSArray_copy_assn(Tester & t)
{
    std::cout << "Test Suite: class SSArray - copy assignment" << std::endl;

    const int theSize = 10;
    bool noErrors;  // True if no errors encountered
    int i;          // Counter

    SSArray<int> ssai(theSize);
    for (i = 0; i < theSize; ++i)
        ssai[i] = 15 - i * i;

    // Make const version, no copy
    const SSArray<int> & ssaiRef = ssai;
    // Make copy (copy assignment)
    SSArray<int> ssaiCopy(1);
    ssaiCopy = ssaiRef;

    t.test(ssaiCopy.size() == theSize, "Copy assignment - check size");

    noErrors = true;
    for (i = 0; i < theSize; ++i)
    {
        if (ssaiCopy[i] != 15 - i * i)
            noErrors = false;
    }
    t.test(noErrors, "Copy assignment - check values");
}
开发者ID:amiel,项目名称:random-useless-scripts,代码行数:34,代码来源:ssarray-test.cpp


示例5: test_class_KSArray_types

// test_class_KSArray_types
// Test suite for class KSArray, types
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_KSArray_types(Tester & t)
{
    std::cout << "Test Suite: class KSArray - types" << std::endl;

    bool correctType;  // result of type checking

    // value_type test #1: int
    KSArray<int>::value_type i1 = 0;
    correctType = TypeCheck<int>::check(i1);
    t.test(correctType, "value_type test #1");

    // value_type test #2: double
    KSArray<double>::value_type d1 = 0.;
    correctType = TypeCheck<double>::check(d1);
    t.test(correctType, "value_type test #2");

    // value_type check modifiability (only needs to compile)
    KSArray<double>::value_type d2;
    d2 = 0.;
    t.test(true, "value_type check modifiability");

    // size_type test
    KSArray<Counter>::size_type s1 = 0;
    correctType = TypeCheck<std::size_t>::check(s1)
                  || TypeCheck<std::ptrdiff_t>::check(s1);
    t.test(correctType, "size_type test");

    // size_type check modifiability (only needs to compile)
    KSArray<Counter>::size_type s2;
    s2 = 0;
    t.test(true, "size_type check modifiability");
}
开发者ID:stachick,项目名称:CS-311-DataStructuresAndAlgorithms,代码行数:39,代码来源:ksarray_test.cpp


示例6: main

int main(int argc, char* argv[])
{
   // default configuration filename
   std::string configFilename = "test01.edl";

   // parse arguments
   for (int i = 1; i < argc; i++) {
      if ( std::string(argv[i]) == "-f" ) {
         configFilename = argv[++i];
      }
   }

   // build tester
   Tester* tester = builder(configFilename);

   // create the thread
   TimerThread* thread = createTheThread(tester);
   if (thread != nullptr) {

      // run the test
      run(tester);

      tester->event(oe::base::Component::SHUTDOWN_EVENT);
      tester->unref();
      tester = nullptr;

      // stop the thread
      thread->terminate();
      thread->unref();
      thread = nullptr;
   }

   return 0;
}
开发者ID:wangfeilong321,项目名称:OpenEaaglesExamples,代码行数:34,代码来源:main.cpp


示例7: test_class_SSArray_ctor_from_size_and_val

// test_class_SSArray_ctor_from_size_and_val
// Test suite for class template SSArray, ctor from size & value
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate have been messages printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_SSArray_ctor_from_size_and_val(Tester & t)
{
    std::cout << "Test Suite: class template SSArray - "
              << "ctor from size & value"
              << std::endl;

    const int theSize = 1000;
    bool noErrors;  // True if no errors encountered
    const double val = -3.2;

    SSArray<double> tad(theSize, val);

    // check size
    t.test(tad.size() == theSize, "Ctor from size & value - check size");

    // check values
    typedef SSArray<double>::size_type ST;
    noErrors = true;
    for (auto i = static_cast<ST>(0);
         i < tad.size();
         ++i)
    {
        if (tad[i] != val)
            noErrors = false;
    }
    t.test(noErrors, "Ctor from size & value - check values");
}
开发者ID:jasonwarta,项目名称:CS311_Assignments,代码行数:34,代码来源:ssarray_test.cpp


示例8: main

int main(){
	Tester test;
	test.otworzPlik();
	test.symulacja();
	test.zamknijPlik();
	return 0;

}
开发者ID:200403,项目名称:Pamsi_lab,代码行数:8,代码来源:main.cpp


示例9: Tester

void TestPage::doubleClick (QListBoxItem *item)
{
  if (! item)
    return;
    
  Tester *dialog = new Tester(item->text(), chartIndex);
  dialog->show();
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:8,代码来源:TestPage.cpp


示例10: test_class_SSArray_equality_comparisons

// test_class_SSArray_equality_comparisons
// Test suite for class template SSArray, comparisons ==, !=
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_SSArray_equality_comparisons(Tester & t)
{
    std::cout << "Test Suite: class template SSArray - "
              << "equality comparisons"
              << std::endl;

    bool correctType;  // result of type checking

    const int theSize = 10;
    int i;          // Counter

    SSArray<int> tai1(theSize);
    for (i = 0; i < theSize; ++i)
        tai1[i] = 15 - i * i;
    const SSArray<int> & tai1Ref = tai1;
    SSArray<int> tai1Copy(tai1Ref);
    SSArray<int> tai2(theSize-1);
    for (i = 0; i < theSize-1; ++i)
        tai2[i] = 15 - i * i;
    const SSArray<int> & tai2Ref = tai2;
    
    // operator== return type
    correctType = TypeCheck<bool>::check(tai1 == tai1Copy);
    t.test(correctType, "operator==, return type");

    // operator!= return type
    correctType = TypeCheck<bool>::check(tai1 != tai1Copy);
    t.test(correctType, "operator!=, return type");

    // Check equality of copies
    t.test(tai1 == tai1Copy, "Equality of copies");

    // Check inequality of copies
    t.test(!(tai1 != tai1Copy), "Inequality of copies");

    // Check equality of different sizes #1
    //  (compilation checks constness of op==)
    t.test(!(tai1Ref == tai2Ref), "Equality of different sizes #1");

    // Check inequality of different sizes #1
    //  (compilation checks constness of op!=)
    t.test(tai1Ref != tai2Ref, "Inequality of different sizes #1");

    // Check equality of different sizes #2
    t.test(!(tai2Ref == tai1Ref), "Equality of different sizes #2");

    // Check inequality of different sizes #2
    t.test(tai2Ref != tai1Ref, "Inequality of different sizes #2");

    // Modify copy
    ++tai1Copy[theSize-1];

    // Check equality of modification of copy
    t.test(!(tai1 == tai1Copy), "Equality of modification of copy");

    // Check inequality of modification of copy
    t.test(tai1 != tai1Copy, "Inequality of modification of copy");
}
开发者ID:jasonwarta,项目名称:CS311_Assignments,代码行数:65,代码来源:ssarray_test.cpp


示例11: main

int main( int argc, char **argv )
{
  QApplication app( argc, argv );
  
  Tester t;
  t.test();
  
  return 0;
}
开发者ID:KleineKarsten,项目名称:FoundationsOfQtDev,代码行数:9,代码来源:main.cpp


示例12: main

int main() { 
    Tester<500> t;                                                                                                                                                                                                                 
    char * ptr  = t.getPtr();                                                                                                                                                                                                      
    char * buf = t.getBuf();                                                                                                                                                                                                       

    std::cout << "'" << (void*)ptr << std::endl;
    std::cout << "'" << (void*)buf << std::endl;
    assert( buf == ptr );                                                                                                                                                                                                          
}                                                                                                                                                                                                                                  
开发者ID:CCJY,项目名称:coliru,代码行数:9,代码来源:main.cpp


示例13: main

int main(int argc, char *argv[])
{
    QApplication    app(argc, argv);
    Tester          w;

    QApplication::setApplicationName("widgetKeyboard");    
	w.show();
	return app.exec();
}
开发者ID:RayMalak,项目名称:VirtualKeyboard,代码行数:9,代码来源:main.cpp


示例14: main

int main(int arc, char** argv)
{
  iris::glog<iris::Warning>("Global Test");
  iris::glog<iris::Warning>("Global Test 2",
                            "Arg1", iris::arg<int>(5));

  Tester t;
  t.doit();
  return 0;
}
开发者ID:dtu-elektro,项目名称:iris,代码行数:10,代码来源:example2.cpp


示例15: action

void CompositeTest::action(Tester& t)
{
  t.preTests(*this);

  for (std::list<Test*>::iterator i = m_tests.begin(); i != m_tests.end(); ++i)
    {
      (*i)->action(t);
    }

  t.postTests(*this);
}
开发者ID:ChristianFrisson,项目名称:gephex,代码行数:11,代码来源:CompositeTest.cpp


示例16: test_class_SSArray_bracket_op

// test_class_SSArray_bracket_op
// Test suite for class template SSArray, bracket operator
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_SSArray_bracket_op(Tester & t)
{
    std::cout << "Test Suite: class template SSArray, bracket operator"
              << std::endl;

    bool correctType;  // result of type checking

    const int theSize = 10;
    bool noErrors;  // True if no errors encountered
    int i;          // Counter

    SSArray<double> tad1;
    correctType = TypeCheck<SSArray<double>::value_type>::check(tad1[1]);
    t.test(correctType, "Bracket operator (non-const), return type");

    SSArray<int> tai(theSize);
    for (i = 0; i < theSize; ++i)
        tai[i] = 15 - i * i;

    noErrors = true;
    for (i = 0; i < theSize; ++i)
    {
        if (tai[i] != 15 - i * i)
            noErrors = false;
    }
    t.test(noErrors, "Bracket operator (non-const) #1");

    tai[2] = 1000;
    noErrors = true;
    for (i = 0; i < theSize; ++i)
    {
        if (tai[i] != ((i == 2) ? 1000 : 15 - i * i))
            noErrors = false;
    }
    t.test(noErrors, "Bracket operator (non-const) #2");

    // Make const version, no copy
    const SSArray<int> & taiRef = tai;

    const SSArray<double> tad2;
    correctType = TypeCheck<SSArray<double>::value_type>::check(tad2[1]);
    t.test(correctType, "Bracket operator (const), return type");

    noErrors = true;
    for (i = 0; i < theSize; ++i)
    {
        if (taiRef[i] != ((i == 2) ? 1000 : 15 - i * i))
            noErrors = false;
    }
    t.test(noErrors, "Bracket operator (const)");

}
开发者ID:jasonwarta,项目名称:CS311_Assignments,代码行数:59,代码来源:ssarray_test.cpp


示例17: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
    Tester tester;

    tester.Test(TestTextEncoding, "TextEncoding");

    tester.WriteResults();

    CoUninitialize();

    return 0;
}
开发者ID:BackupTheBerlios,项目名称:llamaxml-svn,代码行数:13,代码来源:TestLlamaXML.cpp


示例18: test_class_SSArray_size_and_ctor_from_size

// test_class_SSArray_size_and_ctor_from_size
// Test suite for class SSArray, function size and ctor from size
// Pre: None.
// Post:
//     Pass/fail status of tests have been registered with t.
//     Appropriate have been messages printed to cout.
void test_class_SSArray_size_and_ctor_from_size(Tester & t)
{
    std::cout << "Test Suite: class SSArray - function size, ctor from size" << std::endl;

    const SSArray<int> ssai(10);
    t.test(ssai.size() == 10, "size, ctor from size (const) #1");

    const SSArray<double> ssad(100);
    t.test(ssad.size() == 100, "size, ctor from size (const) #2)");

    SSArray<int> ssai2(20);
    t.test(ssai2.size() == 20, "size, ctor from size (non-const)");
}
开发者ID:amiel,项目名称:random-useless-scripts,代码行数:19,代码来源:ssarray-test.cpp


示例19: main

int main(int argc, char **argv)
{
	Tester t;
	t.InitTests();
	t.RunTests();
	
	float tx, ty;
	BMU::OrthogonalProjectionOfPointOnCircle(7.5f, 2.5f, 2.5f, 6.f, 3.f, tx, ty);
	
	printf("\n\n%.2f %.2f", tx, ty);
	
	return 0;
}
开发者ID:balazon,项目名称:MathUtils,代码行数:13,代码来源:main.cpp


示例20: main

int main(int argc, char** argv) {
	VerboseType vType = ALL;
	int numRuns = 10;
	std::string rootTestFileName = "testFile";
	Lexer* testLexer = NULL;
	
	std::cout << "------------ Lexer Tester -------------" << std::endl;
	std::cout << "CS480: campbcha, wadec, zoonb, piorkowd" << std::endl << std::endl;
	std::cout << "Running " << numRuns << " tests" << std::endl;
	if ( vType == ALL ) {
		std::cout << "PRINTING ALL MESSAGES";
	} else if ( vType == ERRORS ) {
		std::cout << "PRINTING ONLY ERRORS";
	} else if ( vType == NONE ) {
		std::cout << "PRINTING NO MESSAGES";
	} else {
		std::cout << "VERBOSE ERROR";
	}
	std::cout << std::endl << std::endl;

	for ( int i = 1 ; i <= numRuns; i++ ) {
		Tester myTester;
		std::stringstream out;

		std::cout << "--------------------------------" << std::endl;
		std::cout << "Start test " << i << std::endl;
		
		out << rootTestFileName << i << ".txt";
		std::string testFileName = out.str();
		try {
			myTester.generateTestFile(testFileName);
			testLexer = new Lexer(testFileName.c_str());
			myTester.run(testLexer, vType);
		} catch (Exception e) {
			e.print();
		}

		if ( testLexer != NULL ) {
			delete testLexer;
			testLexer = NULL;
		}
		std::cout << "Test " << i << " done" << std::endl;
		std::cout << "--------------------------------" << std::endl;
#ifdef _WIN32
		Sleep(1000);
#else
		sleep(1);
#endif
	}
	return 0;
}
开发者ID:campbcha,项目名称:translators,代码行数:51,代码来源:Main.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ TetrahedralMesh类代码示例发布时间:2022-05-31
下一篇:
C++ Test_var类代码示例发布时间: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