// OiStream_t.cpp #include "OiStream.h" #include #include #include #include "trfcyl/BSurfCylinder.h" #include "trfcyl/LayerCylinder.h" #include "trflayer/Detector.h" #include "OiBSurfCylinder.h" #include "trfobj/VisColor.h" using std::cout; using std::cerr; using std::endl; using std::string; class MyDet : public Detector { public: MyDet() { double zmax = 30.0; double zmin = -zmax; add_layer("A", LayerPtr(new LayerCylinder(42.0,zmin,zmax)) ); add_layer("B", LayerPtr(new LayerCylinder(44.0,zmin,zmax)) ); add_layer("C", LayerPtr(new LayerCylinder(46.0,zmin,zmax)) ); add_layer("D", LayerPtr(new LayerCylinder(48.0,zmin,zmax)) ); } }; //********************************************************************** int main( ) { string component = "OiStream"; 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 stream." << endl; OiStream oistream; VisStream& stream = oistream; //******************************************************************** cout << ok_prefix << "Write stream." << endl; stream.write("out.iv"); //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }