|
||||
File indexing completed on 2025-01-30 09:17:43
0001 #include "DD4hep/DDTest.h" 0002 #include <exception> 0003 #include <iostream> 0004 #include <assert.h> 0005 #include <cmath> 0006 0007 //============================================================================= 0008 int main(int /* argc */, char** /* argv */ ){ 0009 0010 // this should be the first line in your test 0011 dd4hep::DDTest test( "example" ); 0012 0013 try{ 0014 0015 // ----- write your tests in here ------------------------------------- 0016 0017 test.log( "example test" ); 0018 0019 // ----- example test for testing two expressions for equality: 0020 0021 test( std::string("Example"), std::string("Example"), "example test - string comparison " ); // this test will pass 0022 0023 //test( "Example", "BadExample", "example test - string comparison " ); // this test will fail 0024 0025 double pi_d = M_PI ; 0026 float pi_f = M_PI ; 0027 // ----- example for test of an expresssion - not using equality 0028 0029 test( 1.1 * pi_f > pi_d , " example comparison: 1.1* float(M_PI) > double( M_PI) " ) ; 0030 0031 // ... guess which of these will pass ... 0032 // test( pi_f == pi_d , " example comparison: float(M_PI) == double( M_PI) " ) ; 0033 // test( pi_f < pi_d , " example comparison: float(M_PI) < double( M_PI) " ) ; 0034 // test( pi_f > pi_d , " example comparison: float(M_PI) > double( M_PI) " ) ; 0035 0036 // -------------------------------------------------------------------- 0037 } 0038 catch( std::exception &e ){ 0039 test.log( e.what() ); 0040 test.error( "exception occurred" ); 0041 } 0042 return 0; 0043 } 0044 //=============================================================================
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |