// Interactor_t.cpp #include "InteractorTest.h" #include #include #include using std::cout; using std::cerr; using std::endl; using std::string; using trf::TrackError; using trf::ETrack; //********************************************************************** int main( ) { string component = "Interactor"; 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 << ok_prefix << "Construct interactor." << endl; ObjTable::register_type(); InteractorTest inter(5.0); assert( inter.get_errfac() == 5.0 ); //******************************************************************** cout << ok_prefix << "Interact track." << endl; ETrack tre; const TrackError& cleanError = tre.get_error(); TrackError err; err(0,0) = 4.0; tre.set_error(err); assert( tre.get_error()(0,0) == 4.0 ); inter.interact(tre); assert( tre.get_error()(0,0) == 20.0 ); //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }