All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ExceptionsTest.cpp File Reference

Test file for the class NumericalDerivative. More...

#include <math.h>
#include <stdio.h>
#include <iostream>
#include <exception>
#include "GaudiKernel/GaudiException.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "GaudiMath/GaudiMath.h"
#include "CLHEP/GenericFunctions/Sin.hh"
Include dependency graph for ExceptionsTest.cpp:

Go to the source code of this file.

Namespaces

 CLHEP
 

Functions

int main ()
 

Detailed Description

Test file for the class NumericalDerivative.

Date
2003-08-31
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru

Definition in file ExceptionsTest.cpp.

Function Documentation

int main ( )

Definition at line 39 of file ExceptionsTest.cpp.

40 {
41 
42  std::cout <<
43  " Test for embedded exceptions ( 2 exception shoudl be catched) "
44  << std::endl ;
45 
46  try {
47  const GaudiMath::Function& mysin = Genfun::Sin();
48  // the exception!!! showl be thrown!
49  const GaudiMath::Function& prim = GaudiMath::Derivative( mysin , 5 );
50  std::cout << "One should never see this line!! " << std::endl ;
51  mysin + prim ;
52  }
53  catch( const std::exception& e )
54  {
55  std::cout << " OK 1) The exception is catched with 'what'='"
56  << e.what() << "'" << std::endl;
57  }
58 
59  try {
60  const GaudiMath::Function& mysin = Genfun::Sin();
61  // the exception!!! showl be thrown!
62  const GaudiMath::Function& prim = GaudiMath::Derivative( mysin , 10 );
63  std::cout << "One should never see this line!! " << std::endl ;
64  mysin + prim ;
65  }
66  catch( const GaudiException& e )
67  {
68  std::cout << " OK 2) " << e << std::endl ;
69  }
70 
71  exit(0);
72 
73 }
Define general base for Gaudi exception.
Genfun::AbsFunction Function
Definition: GaudiMath.h:26
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:31