// AddFitter_t.cpp // Test AddFitter. #include "AddFitter.h" #include #include #include #include "trfutil/trfstream.h" #include "HTrack.h" #include "trfbase/SurfTest.h" #include "trfbase/HitTest.h" #include "AddFitterTest.h" using std::cout; using std::cerr; using std::endl; using std::string; using namespace trf; //********************************************************************** int main( ) { string component = "AddFitter"; 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 << "Define tracks and hit." << endl; SurfTest srf(10); ETrack tre( SurfacePtr(srf.new_pure_surface()) ); HTrack trh(tre); ClusterPtr pclu( new ClusterTest(srf,3) ); HitPtr phit = pclu->predict(tre).front(); //******************************************************************** cout << ok_prefix << "Test constructor." << endl; AddFitterTest fit0(12); const AddFitter& fit(fit0); cout << fit << endl; assert( fit.add_hit(trh,phit) ); assert( fit.add_hit_with_record(trh,phit,0) ); //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }