CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
testzmex.cc File Reference
#include <string>
#include "CLHEP/Cast/itos.h"
#include "CLHEP/Exceptions/ZMthrow.h"
#include "CLHEP/Exceptions/ZMexception.h"
#include "CLHEP/Exceptions/ZMexAction.h"
#include "CLHEP/Exceptions/ZMexClassInfo.h"
#include "CLHEP/Exceptions/ZMexSeverity.h"
#include "CLHEP/Exceptions/ZMerrno.h"

Go to the source code of this file.

Functions

 ZMexStandardDefinition (zmex::ZMexception, ZMxTest)
 
void display (const zmex::ZMexception *ex)
 
int main ()
 

Variables

const string QUOTE = "\""
 
const string NEWLINE1 = "\n"
 
const string NEWLINE2 = "\n\n"
 

Function Documentation

◆ display()

void display ( const zmex::ZMexception ex)

Definition at line 48 of file testzmex.cc.

48 {
49
51 + ex->name() + ": " + QUOTE + ex->message() + QUOTE + NEWLINE1
52 + " " + (ex->wasThrown() ? "thrown" : "ignored")
53 + " by " + ex->handlerUsed() + "()" + NEWLINE1
54 );
55
56}
ZMexLogResult emit(const ZMexception &exc)
Definition: ZMexLogger.cc:255
std::string handlerUsed() const
std::string message() const
bool wasThrown() const
virtual std::string name() const
Definition: ZMexception.cc:106
ZMexLogger & ZMlogger()
Definition: ZMexception.cc:70
const string QUOTE
Definition: testzmex.cc:44
const string NEWLINE1
Definition: testzmex.cc:45

◆ main()

int main ( )

Definition at line 59 of file testzmex.cc.

59 {
60
61 // ----------
62 // Begin testing, check out basic logger:
63 // ----------
65 zmex::ZMlogger().emit( "---------- Begin testing: ----------\n" );
67 zmex::ZMlogger().emit( "This message checks out basic logger behavior\n" );
68
69 ZMthrow( ZMxTest( "Testing exception behavior" ) );
70
71 // ----------
72 // Done, go home
73 // ----------
74 return 0;
75
76} // main()
#define ZMthrow(userExcept)
Definition: ZMthrow.h:97

◆ ZMexStandardDefinition()

ZMexStandardDefinition ( zmex::ZMexception  ,
ZMxTest   
)

Variable Documentation

◆ NEWLINE1

const string NEWLINE1 = "\n"

Definition at line 45 of file testzmex.cc.

Referenced by display(), and main().

◆ NEWLINE2

const string NEWLINE2 = "\n\n"

Definition at line 46 of file testzmex.cc.

◆ QUOTE

const string QUOTE = "\""

Definition at line 44 of file testzmex.cc.

Referenced by display().