COSC_4P82_Assignment_1/lib/beagle-3.0.3/tests/Common/Macros.hpp

37 lines
1.1 KiB
C++
Raw Normal View History

2024-02-13 21:21:51 -05:00
#ifndef Beagle_Test_Macro_hpp
#define Beagle_Test_Macro_hpp
#include "beagle/Exception.hpp"
#define Beagle_Test_CatchEverythingM \
catch ( Beagle::Exception& inException ) { \
cerr << "A Beagle exception was thrown:" << endl; \
inException.terminate(); \
} \
catch ( PACC::Socket::Exception& inException ) { \
cerr << "A PACC::Socket exception was thrown:" << endl; \
cerr << inException.getMessage() << endl; \
} \
catch ( std::exception& inException ) { \
cerr << "A standard exception was thrown:" << endl; \
cerr << inException.what(); \
} \
catch ( std::string& inException ) { \
cerr << "A standard string was thrown:" << endl; \
cerr << "Its contents are: \"" << inException << "\"" << endl; \
} \
catch ( char* inException ) { \
cerr << "A character pointer was thrown:" << endl; \
cerr << "Its contents are: \"" << inException << "\"" << endl; \
} \
catch ( int inException ) { \
cerr << "An integer was thrown:" << endl; \
cerr << "Its value is: \"" << inException << "\"" << endl; \
} \
catch ( ... ) { \
cerr << "An unknown exception was thrown" << endl; \
} \
#endif // Beagle_Test_Macro_hpp