23 using std::istringstream;
31 const string myname =
"test_FclIndexVectorMapTool: ";
33 cout << myname <<
"NDEBUG must be off." <<
endl;
36 string line =
"-----------------------------";
38 cout << myname << line <<
endl;
39 string fclfile =
"test_FclIndexVectorMapTool.fcl";
40 if ( ! useExistingFcl ) {
41 cout << myname <<
"Creating top-level FCL." <<
endl;
42 ofstream
fout(fclfile.c_str());
46 fout <<
" tool_type: FclIndexVectorMapTool" <<
endl;
48 fout <<
" Entries: [ [100, 2, 3], [101, 12] ]" <<
endl;
54 cout << myname <<
"Using existing top-level FCL." <<
endl;
57 cout << myname << line <<
endl;
58 cout << myname <<
"Fetching tool manager." <<
endl;
60 assert ( ptm !=
nullptr );
65 cout << myname << line <<
endl;
66 cout << myname <<
"Fetching tool." <<
endl;
68 assert( pvm !=
nullptr );
70 cout << myname << line <<
endl;
71 cout << myname <<
"Check get." <<
endl;
73 assert( vec0.size() == 2 );
75 assert( vec1.size() == 1 );
77 assert( vec2.size() == 0 );
79 cout << myname << line <<
endl;
80 cout << myname <<
"Check contains." <<
endl;
81 assert( pvm->contains(100, 2) );
82 assert( pvm->contains(100, 3) );
83 assert( ! pvm->contains(100, 4) );
84 assert( pvm->contains(101, 12) );
85 assert( ! pvm->contains(101, 4) );
86 assert( ! pvm->contains(102, 4) );
88 cout << myname << line <<
endl;
89 cout << myname <<
"Done." <<
endl;
96 bool useExistingFcl =
false;
100 if ( sarg ==
"-h" ) {
101 cout <<
"Usage: " << argv[0] <<
" [keepFCL] [RUN]" <<
endl;
102 cout <<
" If keepFCL = true, existing FCL file is used." <<
endl;
103 cout <<
" If RUN is nonzero, the data for that run are displayed." <<
endl;
106 useExistingFcl = sarg ==
"true" || sarg ==
"1";
109 string sarg(argv[2]);
110 istringstream ssarg(argv[2]);
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)