| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Namespaces | Functions
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 38 of file ExceptionsTest.cpp.

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