diff --git a/DDTest/src/test_PolarGridRPhi2.cc b/DDTest/src/test_PolarGridRPhi2.cc index eb39796604da89d84d9587cfc702d63e01699aba..14d2d151a165801f9ea487013f5e6ab2e847248e 100644 --- a/DDTest/src/test_PolarGridRPhi2.cc +++ b/DDTest/src/test_PolarGridRPhi2.cc @@ -7,9 +7,6 @@ #include <algorithm> #include <exception> - -static dd4hep::DDTest test( "PolarGridRPhi2" ) ; - class TestTuple { public: double _r; @@ -20,6 +17,7 @@ public: }; int main() { + dd4hep::DDTest test( "PolarGridRPhi2" ) ; try{ dd4hep::DDSegmentation::PolarGridRPhi2 seg("system:8,layer:8,barrel:3,layer:8,slice:5,r:16,phi:16"); diff --git a/DDTest/src/test_bitfield64.cc b/DDTest/src/test_bitfield64.cc index 0067bdde3160c56372d9504c61a8d1f1a2da3b86..49ea6109f512bfdd7d50795cbe937e14b47c93c5 100644 --- a/DDTest/src/test_bitfield64.cc +++ b/DDTest/src/test_bitfield64.cc @@ -6,25 +6,19 @@ #include "DDSegmentation/BitField64.h" - using namespace std ; using namespace dd4hep ; using namespace DDSegmentation ; -// this should be the first line in your test -static DDTest test( "bitfield64" ) ; - //============================================================================= - int main(int /* argc */, char** /* argv */ ){ + DDTest test( "bitfield64" ) ; + try{ - // ----- write your tests in here ------------------------------------- - test.log( "test bitfield64" ); - // initialize with a string that uses all 64 bits : BitField64 bf("system:5,side:-2,layer:9,module:8,sensor:8,x:32:-16,y:-16" ) ; diff --git a/DDTest/src/test_bitfieldcoder.cc b/DDTest/src/test_bitfieldcoder.cc index d548613c0d67d0333787b5091d8be3d0bf134f2d..e6f6bae59a34c6e81c6178cd7bc7b4c890e89fae 100644 --- a/DDTest/src/test_bitfieldcoder.cc +++ b/DDTest/src/test_bitfieldcoder.cc @@ -11,13 +11,11 @@ using namespace std ; using namespace dd4hep ; using namespace DDSegmentation ; -// this should be the first line in your test -static DDTest test( "bitfield64" ) ; - //============================================================================= - int main(int /* argc */, char** /* argv */ ){ - + // this should be the first line in your test + DDTest test( "bitfield64" ); + try{ // ----- write your tests in here ------------------------------------- diff --git a/DDTest/src/test_example.cc b/DDTest/src/test_example.cc index 16d5e7037da72ef4e489f7500b1162d77dca0f5b..b41adde32d63e2126a1084b323995dcf144d19ee 100644 --- a/DDTest/src/test_example.cc +++ b/DDTest/src/test_example.cc @@ -4,15 +4,11 @@ #include <assert.h> #include <cmath> -using namespace std ; -using namespace dd4hep ; - -// this should be the first line in your test -static DDTest test( "example" ) ; - //============================================================================= - int main(int /* argc */, char** /* argv */ ){ + + // this should be the first line in your test + dd4hep::DDTest test( "example" ) ; try{ @@ -26,11 +22,8 @@ int main(int /* argc */, char** /* argv */ ){ //test( "Example", "BadExample", "example test - string comparison " ); // this test will fail - - double pi_d = M_PI ; float pi_f = M_PI ; - // ----- example for test of an expresssion - not using equality test( 1.1 * pi_f > pi_d , " example comparison: 1.1* float(M_PI) > double( M_PI) " ) ; @@ -41,16 +34,11 @@ int main(int /* argc */, char** /* argv */ ){ // test( pi_f > pi_d , " example comparison: float(M_PI) > double( M_PI) " ) ; // -------------------------------------------------------------------- - - - } catch( exception &e ){ - //} catch( ... ){ - + } + catch( std::exception &e ){ test.log( e.what() ); test.error( "exception occurred" ); } - return 0; } - //=============================================================================