/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/lcio/src/cpp/src/TESTS/test_example.cc

Go to the documentation of this file.
00001 ////////////////////////////////////////
00002 // example for LCIO tests
00003 ////////////////////////////////////////
00004 
00005 #include "tutil.h"
00006 #include "lcio.h"
00007 
00008 #include "EVENT/LCIO.h"
00009 #include "IO/LCWriter.h"
00010 #include "IMPL/LCEventImpl.h" 
00011 #include "IMPL/LCCollectionVec.h"
00012 
00013 #include <iostream>
00014 
00015 using namespace std ;
00016 using namespace lcio ;
00017 
00018 // replace mytest with the name of your test
00019 const static string testname="mytest";
00020 
00021 //=============================================================================
00022 
00023 int main(int argc, char** argv ){
00024     
00025     // this should be the first line in your test
00026     TEST MYTEST=TEST( testname, std::cout );
00027     
00028     // write your test here
00029     for( int i=0; i<3; i++){
00030         MYTEST.LOG( "this is just a test..." );
00031     }
00032 
00033     //if( true ){
00034     if( false ){
00035         // force test program to fail in this way:
00036         MYTEST.FAILED( "oops, something went wrong..." );
00037     }
00038 
00039     // example with a try&catch fail condition:
00040     //
00041     ///////////////////////////////////////////////////////////////////////
00042     //LCReader* lcReader = LCFactory::getInstance()->createLCReader() ;
00043     //try{
00044     //    lcReader->open( "blub.slcio" ) ;
00045     //}
00046     //catch( Exception &e ){
00047     //    MYTEST.FAILED( e.what() );
00048     //}
00049     //lcReader->close();
00050     //delete lcReader;
00051     ///////////////////////////////////////////////////////////////////////
00052 
00053     return 0;
00054 }
00055 
00056 //=============================================================================
00057 

Generated on Mon Jan 7 13:15:21 2013 for MicromegasFramework by  doxygen 1.4.7