本文整理汇总了C++中TestSuite::testall方法的典型用法代码示例。如果您正苦于以下问题:C++ TestSuite::testall方法的具体用法?C++ TestSuite::testall怎么用?C++ TestSuite::testall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSuite
的用法示例。
在下文中一共展示了TestSuite::testall方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]) {
unsigned int old_cw;
fpu_fix_start(&old_cw);
/* Parse the arguments. */
char *arg;
for (int i = 1; i < argc; i++) {
arg = argv[i];
if (strcmp(arg, "-h") == 0 || strcmp(arg, "-help") == 0) {
print_usage();
std::exit(0);
} else if (strcmp(arg, "-double") == 0) {
flag_test_double = true;
} else if (strcmp(arg, "-dd") == 0) {
flag_test_dd = true;
} else if (strcmp(arg, "-qd") == 0) {
flag_test_qd = true;
} else if (strcmp(arg, "-all") == 0) {
flag_test_double = flag_test_dd = flag_test_qd = true;
} else if (strcmp(arg, "-v") == 0) {
flag_verbose = true;
} else if (strcmp(arg, "-long") == 0) {
long_factor *= 10;
} else {
cerr << "Unknown flag `" << arg << "'." << endl;
}
}
/* If no flag, test both double-double and quad-double. */
if (!flag_test_double && !flag_test_dd && !flag_test_qd) {
flag_test_dd = true;
flag_test_qd = true;
}
if (flag_test_double) {
TestSuite<double> test;
cout << endl;
cout << "Timing double" << endl;
cout << "-------------" << endl;
test.testall();
}
if (flag_test_dd) {
TestSuite<dd_real> test;
cout << endl;
cout << "Timing dd_real" << endl;
cout << "--------------" << endl;
test.testall();
}
if (flag_test_qd) {
TestSuite<qd_real> test;
cout << endl;
cout << "Timing qd_real" << endl;
cout << "--------------" << endl;
test.testall();
}
fpu_fix_end(&old_cw);
return 0;
}