Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ExceptionsTest.cpp File Reference

Test file for the class NumericalDerivative. More...

#include <cmath>
#include <cstdio>
#include <exception>
#include <iostream>
#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.

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