// FilterAll_t.cpp #include "FilterAll.h" #include #include #include #include "objstream/StdObjStream.hpp" #include "trfutil/trfstream.h" #include "trfutil/trfstream.h" #include "trfbase/SurfTest.h" #include "trfbase/ETrack.h" #include "trffit/MTrack.h" #include "FilterPtr.h" using std::cout; using std::cerr; using std::endl; using std::string; using std::ostringstream; using std::istringstream; using namespace trf; //********************************************************************** int main( ) { string component = "FilterAll"; string ok_prefix = component + " (I): "; string error_prefix = component + " test (E): "; cout << ok_prefix << "-------- Testing component " + component + ". --------" << endl; // Make sure assert is enabled. bool assert_flag = false; assert ( ( assert_flag = true, assert_flag ) ); if ( ! assert_flag ) { cerr << "Assert is disabled" << endl; return 1; } //******************************************************************** cout << trf_format; cout << ok_prefix << "Create filters." << endl; ObjTable::register_type(); FilterAll accept(true); FilterAll reject(false); FilterAll defaul; cout << accept << endl; cout << reject << endl; cout << defaul << endl; //******************************************************************** cout << ok_prefix << "Build list of tracks." << endl; ETrack tre( SurfacePtr(new SurfTest(1)) ); Filter::MTrackPtr ptrm( new MTrack(tre) ); Filter::MTrackArray trms; int ntrm = 5; for ( int i=0; iget_type() == FilterAll::get_static_type() ); assert( pfil->get_state() == false ); } } //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }