本文整理汇总了C++中Tester::run方法的典型用法代码示例。如果您正苦于以下问题:C++ Tester::run方法的具体用法?C++ Tester::run怎么用?C++ Tester::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tester
的用法示例。
在下文中一共展示了Tester::run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: task
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;
}
示例2: 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;
}
示例3: main
int main(int argc, char* argv[])
{
//zak³adamy ¿e system docelowy jest pierwszym parametrem
long base = atoi(argv[1]);
//system w którym podawane bêd¹ liczby z wejœcia
long in_base = 16;
//cout << "Podaj baze systemu w ktorym bêdziesz podawa³: ";
//cin >> in_base;
string liczba1;
string liczba2;
char command;
Large l1(base);
Large l2(base);
Large res(base);
LargeRational u1(base);
LargeRational u2(base);
LargeRational wynik(base);
/*while(true){
cin>>liczba1>>command>>liczba2;
l1 = Large::Set(liczba1, base, in_base);
l2 = Large::Set(liczba2, base, in_base);
switch(command){
case '+':
res = l1 + l2;
//res = Large::convert(res, 16);
cout << res.toHex() << endl;
break;
case '-':
res = l1 - l2;
//res = Large::convert(res, 16);
cout << res.toHex() << endl;
break;
case '*':
res = l1 * l2;
//res = Large::convert(res, 16);
cout << res.toHex() << endl;
break;
case '/':
res = l1 / l2;
//res = Large::convert(res, 16);
cout << res.toHex() << endl;
break;
case '?':
cout << Large::comparisonToChar(l1,l2) << endl;
break;
case 'q': //rundka profilera
Profiler().profile();
break;
default:
cout << "Nie poprawny operator" << endl;
}
//}*/
/*while(true){
cin>>liczba1>>command>>liczba2;
u1 = LargeRational::Set(liczba1, base, in_base);
u2 = LargeRational::Set(liczba2, base, in_base);
switch(command){
case '+':
wynik = u1 + u2;
//res = Large::convert(res, 16);
cout << wynik.toHex() << endl;
break;
case '*':
wynik = u1 * u2;
//res = Large::convert(res, 16);
cout << wynik.toHex() << endl;
break;
default:
cout << "Nie poprawny operator" << endl;
}
}*/
Tester t = Tester();
t.run();
TesterRational tt = TesterRational();
tt.run();
cin >>command;
return 0;
}
示例4: main
int main() {
Tester t;
t.run(2);
// Eksempel på tilfældige tal.
/*unsigned int seed = 12345;
std::default_random_engine dre(seed);
std::uniform_int_distribution<> dis(1, 1000);
for (int n=0; n<10; ++n)
std::cout << dis(dre) << ' ';
std::cout << '\n';
*/
/*
const unsigned int testsize = 1000000;
auto testbheap = std::make_shared<BHeap>();
Timer t1;
t1.start();
for(unsigned int i = 0; i < testsize; ++i) {
testbheap->Insert(2+i,2+i);
}
t1.stop();
std::cout << t1.duration().count() << std::endl;
t1.reset();
t1.start();
testbheap = std::make_shared<BHeap>();
for(unsigned int i = 0; i < testsize; ++i) {
testbheap->Insert(2+i, testsize-i+5);
}
t1.stop();
std::cout << t1.duration().count() << std::endl;
Timer t;
t.start();
auto fheap = std::make_shared<FHeap>();
Dijkstra f(fheap);
f.load("test2.txt");
f.run();
t.stop();
*/
//Dijkstra d1(fheap);
//d1.sayName();
/*for(int i = 0; i < 40; i++) {
bheap->Insert(2+i, 42-i);
}
for(int i = 0; i < 40; i++) {
bheap->DecreaseKey(2+i,2);
}
for(int i = 0; i < 40; i++) {
bheap->DeleteMin();
}
*/
//bheap->Swap();
//std::cout << bheap->graph() << std::endl;
/*auto fheap = std::make_shared<FHeap>();
auto fheap = std::make_shared<FHeap>();
Dijkstra d(fheap);
d.load("test2.txt");
d.run();
bheap->printInformation();
*/
//std::cout << "It took: " << t.duration().count() << " milliseconds" << std::endl;
std::cin.get();
return 0;
}