本文整理汇总了C++中Tester::testDataTypes方法的典型用法代码示例。如果您正苦于以下问题:C++ Tester::testDataTypes方法的具体用法?C++ Tester::testDataTypes怎么用?C++ Tester::testDataTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tester
的用法示例。
在下文中一共展示了Tester::testDataTypes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char * const argv[]) {
cout << "Hello, World!\n";
if (argc < 2){
usage();
return 1;
} else {
for(int i = 1; i < argc; i++){ // check if all options are valid first
if (argv[i][0] != '-')
{
cout << "'" << argv[i] << "' does not start with a dash: not a valid option. Exiting." << endl;
usage();
return 1;
}
}
for(int i = 1; i < argc; i++){ //if all options are valid, proceed and evaluate
if (argv[i][1] == 't') {
cout << "---- testing option '" << argv[i][2] << "' ----" << endl;
//---------------------------------------------------
//run various tests
//---------------------------------------------------
string base = "";
char *home = getenv( "HOME" );
if (home){
base = home;
base += "/Desktop";
}
cout << "output directory '" << base << "'" << endl;
Tester *t = new Tester(base);
switch(argv[i][2]){
case '1':
t->testCrossCorrelator( 1 );
break;
case '2':
t->testArrayClasses();
break;
case '3':
t->testFourierTrafo();
break;
case '4':
{
int io_mode = 0; //general case: test all 2D formats
// io_mode = 1; //2D EDF
// io_mode = 2; //2D HDF5
// io_mode = 3; //2D TIFF
// io_mode = 4; //2D ASCII
// io_mode = 5; //special case...
// io_mode = 12; //test all 1D formats
t->testIO(io_mode);
}
break;
case '5':
t->testDataTypes();
break;
case '6':
t->testArraySpeed();
break;
case '0': // fall through to default
default:
t->testCrossCorrelator( 1 );
t->testArrayClasses();
t->testFourierTrafo();
t->testIO();
t->testDataTypes();
break;
}//end switch
cout << "---- testing done ----" << endl;
delete t;
return 0;
} else {
cout << "-" << argv[i][1] << " is not a valid option." << endl;
usage();
return 2;
}
}//end for i
}//end if
return 0;
}