#include "dunecore/ArtSupport/DuneToolManager.h"
#include "dunecore/ArtSupport/Tool/TestTool.h"
#include <string>
#include <iostream>
#include <fstream>
#include <cassert>
Go to the source code of this file.
int test_DuneToolManager |
( |
bool |
useExistingFcl = false | ) |
|
Definition at line 19 of file test_DuneToolManager.cxx.
20 const string myname =
"test_DuneToolManager: ";
21 cout << myname <<
"Starting test" <<
endl;
23 cout << myname <<
"NDEBUG must be off." <<
endl;
26 string line =
"-----------------------------";
29 cout << myname << line <<
endl;
30 string fclfile =
"test_DuneToolManager.fcl";
31 if ( ! useExistingFcl ) {
32 cout << myname <<
"Creating top-level FCL." <<
endl;
33 ofstream
fout(fclfile.c_str());
36 fout <<
" tool_type: TestTool" <<
endl;
37 fout <<
" Label: \"Tool 1\"" <<
endl;
40 fout <<
" tool_type: TestTool" <<
endl;
41 fout <<
" Label: \"Tool 2\"" <<
endl;
46 cout << myname <<
"Using existing top-level FCL." <<
endl;
50 cout << myname <<
"Retrieve tool manager." <<
endl;
52 assert( ptm !=
nullptr );
56 cout << myname << line <<
endl;
57 cout << myname <<
"Display tools." <<
endl;
60 cout << myname << line <<
endl;
61 cout << myname <<
"Check tool list." <<
endl;
64 cout << myname << line <<
endl;
65 cout << myname <<
"Fetch a private tool." <<
endl;
67 assert( ptp1 !=
nullptr );
68 assert( ptp1->label() ==
"Tool 1" );
70 cout << myname << line <<
endl;
71 cout << myname <<
"Fetch a private tool." <<
endl;
73 assert( ptp2 !=
nullptr );
74 assert( ptp2 != ptp1 );
75 assert( ptp2->label() ==
"Tool 1" );
77 cout << myname << line <<
endl;
78 cout << myname <<
"Fetch a shared tool." <<
endl;
80 assert( pts1 !=
nullptr );
81 assert( pts1 != ptp1.get() );
82 assert( pts1->label() ==
"Tool 1" );
84 cout << myname << line <<
endl;
85 cout << myname <<
"Fetch shared tool again." <<
endl;
87 assert( pts2 !=
nullptr );
88 assert( pts2 == pts1 );
89 assert( pts2->label() ==
"Tool 1" );
91 cout << myname << line <<
endl;
92 cout << myname <<
"Fetch another shared tool." <<
endl;
94 assert( pts3 !=
nullptr );
95 assert( pts3 != pts2 );
96 assert( pts3->label() ==
"Tool 2" );
98 cout << myname << line <<
endl;
99 cout << myname <<
"Fetch a private tool with config." <<
endl;
100 string scfgTool =
"{ tool_type:TestTool Label:\"Tool C\" }";
101 cout << myname <<
"Config: " << scfgTool <<
endl;
103 assert( ptpc !=
nullptr );
104 assert( ptpc != ptp1 );
105 assert( ptpc->label() ==
"Tool C" );
107 cout << myname << line <<
endl;
108 cout << myname <<
"Done." <<
endl;
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)