// Filter_t.cpp #include "Filter.h" #include "FilterTest.h" #include #include #include #include "trfbase/SurfTest.h" #include "trfbase/ETrack.h" #include "trffit/MTrack.h" using std::cout; using std::cerr; using std::endl; using std::string; using namespace trf; //********************************************************************** int main( ) { string component = "Filter"; 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 filter." << endl; FilterTest filt; cout << filt << endl; //******************************************************************** cout << ok_prefix << "Test processing." << endl; ETrack tre( SurfacePtr(new SurfTest(1)) ); Filter::MTrackPtr ptrm( new MTrack(tre) ); Filter::MTrackArray trms; trms.push_back(ptrm); trms.push_back(ptrm); trms.push_back(ptrm); assert( trms.size() == 3 ); Filter::FlagArray flags = filt.process(trms); assert( flags.size() == trms.size() ); cout << "Flags: "; for ( int iflg=0; iflg