// The following are just for unittesting the exception class
static bool is_disabled();
- static bool disable();
- static bool enable();
+ static void disable();
+ static void enable();
static uint32_t disabled_counter();
static void increment_disabled_counter();
char _error_message[BUFSIZ];
};
+class disconnected : std::runtime_error
+{
+public:
+ disconnected(const char *file, int line, const char *func, const char *instance, const in_port_t port, const char *format, ...);
+
+ const char* what() const throw()
+ {
+ return _error_message;
+ }
+
+ // The following are just for unittesting the exception class
+ static bool is_disabled();
+ static void disable();
+ static void enable();
+ static uint32_t disabled_counter();
+ static void increment_disabled_counter();
+
+private:
+ char _error_message[BUFSIZ];
+ in_port_t _port;
+ char _instance[1024];
+};
+
} // namespace libtest
-#define fatal_message(__mesg) libtest::fatal(LIBYATL_DEFAULT_PARAM, __mesg)
+#define fatal_message(__mesg) throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "%s", __mesg)
+#define fatal_assert(__assert) if((__assert)) {} else { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "%s", #__assert); }