00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #pragma once
00016
00017 #include "TestToolBox/IEventReceiver.h"
00018
00019
00020
00021 namespace TestToolBox
00022 {
00023
00024 class BoostEventReceiverForTestEvents : public IEventReceiver
00025 {
00026
00027 virtual void EventMsg(
00028 EventContext in_context,
00029 const char* in_eventDescription)
00030 {
00031
00032
00033
00034 std::ostringstream fullInfoStr;
00035 fullInfoStr << "TEST_EVENT:";
00036 if (in_context & CTX_INFO)
00037 {
00038 fullInfoStr << " INFO: " << in_eventDescription;
00039 }
00040 else
00041 {
00042 if (in_context & CTX_UNEXPECTED_EVENTS)
00043 {
00044 fullInfoStr << " UNEXPECTED_EVENTS";
00045 }
00046 else
00047 {
00048 fullInfoStr << " WRONG RESULT";
00049 }
00050 if (in_context & CTX_FATAL_ERROR) fullInfoStr << " FATAL_ERROR";
00051
00052 fullInfoStr << " (for more info see next line)\n" << in_eventDescription;
00053 }
00054
00055 if (in_context & CTX_FATAL_ERROR)
00056 {
00057 BOOST_FAIL(fullInfoStr.str());
00058 }
00059 else if (in_context & CTX_INFO)
00060 {
00061 BOOST_MESSAGE(fullInfoStr.str());
00062 }
00063 else
00064 {
00065 BOOST_ERROR(fullInfoStr.str());
00066 }
00067 }
00068 };
00069
00070 };
00071
00072
00073