// LayerSimulator_t.cpp #include "LayerSimulatorTest.h" #include #include #include #include "trfutil/trfstream.h" #include "LayerTest.h" #include "trfbase/VTrack.h" using std::cout; using std::cerr; using std::endl; using std::string; using namespace trf; //********************************************************************** int main( ) { string component = "LayerSimulator"; 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 << "Check constructor." << endl; LayerPtr plyr; plyr = new LayerTest(5.0); LayerSimulatorTest lsim(plyr); cout << lsim << endl; assert( plyr == &lsim.get_layer() ); assert( plyr == lsim.get_layer_pointer() ); assert( lsim.get_generators().size() == 1 ); VTrack trv( SurfacePtr(new SurfTest(5.0)) ); lsim.add_clusters(trv); lsim.drop_clusters(); //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }