00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023
00024
00025
00026
00027
00028 #include <string>
00029 #include "TestToolBox/IEventReceiver.h"
00030 #include "TestToolBox/CommonSources/ObjectLock.h"
00031
00032
00033 #ifdef USE_TEST_INSTANCE_DLL
00034 # include "TestToolBox/TestInstanceDll.h"
00035 #endif
00036
00037 #pragma warning( push )
00038 #pragma warning( disable : 4996 ) // vsprintf declared deprecated
00039
00040 namespace TestToolBox
00041 {
00042
00043
00044
00045
00046
00047
00048
00049
00050 #define TTB_CMD(method) \
00051 TestToolBox::TestEvents::Get()->Command (#method); \
00052 method ();
00053 #define TTB_CMD1(method,p1) \
00054 TestToolBox::TestEvents::Get()->Command (#method, #p1); \
00055 method ( p1 );
00056 #define TTB_CMD2(method,p1,p2) \
00057 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2); \
00058 method ( p1, p2 );
00059 #define TTB_CMD3(method,p1,p2,p3) \
00060 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3); \
00061 method ( p1, p2, p3 );
00062 #define TTB_CMD4(method,p1,p2,p3,p4) \
00063 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4); \
00064 method ( p1, p2, p3, p4 );
00065 #define TTB_CMD5(method,p1,p2,p3,p4,p5) \
00066 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5); \
00067 method ( p1, p2, p3, p4, p5 );
00068 #define TTB_CMD6(method,p1,p2,p3,p4,p5,p6) \
00069 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5 " " #p6); \
00070 method ( p1, p2, p3, p4, p5, p6 );
00071 #define TTB_CMD7(method,p1,p2,p3,p4,p5,p6,p7) \
00072 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5 " " #p6 " " #p7); \
00073 method ( p1, p2, p3, p4, p5, p6, p7 );
00074 #define TTB_CMD8(method,p1,p2,p3,p4,p5,p6,p7,p8) \
00075 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5 " " #p6 " " #p7 " " #p8); \
00076 method ( p1, p2, p3, p4, p5, p6, p7, p8 );
00077 #define TTB_CMD9(method,p1,p2,p3,p4,p5,p6,p7,p8,p9) \
00078 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5 " " #p6 " " #p7 " " #p8 " " #p9); \
00079 method ( p1, p2, p3, p4, p5, p6, p7, p8, p9 );
00080 #define TTB_CMD10(method,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) \
00081 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5 " " #p6 " " #p7 " " #p8 " " #p9 " " #p10); \
00082 method ( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 );
00083 #define TTB_CMD11(method,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) \
00084 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5 " " #p6 " " #p7 " " #p8 " " #p9 " " #p10 " " #p11); \
00085 method ( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11 );
00086 #define TTB_CMD12(method,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12) \
00087 TestToolBox::TestEvents::Get()->Command (#method, #p1 " " #p2 " " #p3 " " #p4 " " #p5 " " #p6 " " #p7 " " #p8 " " #p9 " " #p10 " " #p11 " " #p12); \
00088 method ( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 #define TTB_EXP_S(expression) \
00120 {\
00121 std::ostringstream oss; \
00122 oss << expression; \
00123 TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,oss.str().c_str()); \
00124 }
00125
00126 #define TTB_EXP(stringValue) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,stringValue)
00127 #define TTB_EXP1(formatString,p1) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,formatString,p1)
00128 #define TTB_EXP2(formatString,p1,p2) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,formatString,p1,p2)
00129 #define TTB_EXP3(formatString,p1,p2,p3) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,formatString,p1,p2,p3)
00130 #define TTB_EXP4(formatString,p1,p2,p3,p4) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,formatString,p1,p2,p3,p4)
00131 #define TTB_EXP5(formatString,p1,p2,p3,p4,p5) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5)
00132 #define TTB_EXP6(formatString,p1,p2,p3,p4,p5,p6) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5,p6)
00133 #define TTB_EXP7(formatString,p1,p2,p3,p4,p5,p6,p7) TestToolBox::TestEvents::Get()->ExpectResult (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5,p6,p7)
00134
00135
00136
00137
00138
00139
00140 #define TTB_EXP_SEQ_S(expression) \
00141 {\
00142 std::ostringstream oss; \
00143 oss << expression; \
00144 TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,oss.str().c_str()); \
00145 }
00146 #define TTB_EXP_SEQ(stringValue) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,stringValue)
00147 #define TTB_EXP_SEQ1(formatString,p1) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,formatString,p1)
00148 #define TTB_EXP_SEQ2(formatString,p1,p2) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,formatString,p1,p2)
00149 #define TTB_EXP_SEQ3(formatString,p1,p2,p3) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,formatString,p1,p2,p3)
00150 #define TTB_EXP_SEQ4(formatString,p1,p2,p3,p4) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,formatString,p1,p2,p3,p4)
00151 #define TTB_EXP_SEQ5(formatString,p1,p2,p3,p4,p5) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5)
00152 #define TTB_EXP_SEQ6(formatString,p1,p2,p3,p4,p5,p6) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5,p6)
00153 #define TTB_EXP_SEQ7(formatString,p1,p2,p3,p4,p5,p6,p7) TestToolBox::TestEvents::Get()->ExpectResultSequential (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5,p6,p7)
00154
00155
00156
00157
00158
00159
00160 #define TTB_EXP_VAR_S(expression) \
00161 {\
00162 std::ostringstream oss; \
00163 oss << expression; \
00164 TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,oss.str().c_str()); \
00165 }
00166 #define TTB_EXP_VAR(stringValue) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,stringValue)
00167 #define TTB_EXP_VAR1(formatString,p1) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,formatString,p1)
00168 #define TTB_EXP_VAR2(formatString,p1,p2) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,formatString,p1,p2)
00169 #define TTB_EXP_VAR3(formatString,p1,p2,p3) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,formatString,p1,p2,p3)
00170 #define TTB_EXP_VAR4(formatString,p1,p2,p3,p4) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,formatString,p1,p2,p3,p4)
00171 #define TTB_EXP_VAR5(formatString,p1,p2,p3,p4,p5) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5)
00172 #define TTB_EXP_VAR6(formatString,p1,p2,p3,p4,p5,p6) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5,p6)
00173 #define TTB_EXP_VAR7(formatString,p1,p2,p3,p4,p5,p6,p7) TestToolBox::TestEvents::Get()->ExpectResultVariable (__FILE__,__LINE__,formatString,p1,p2,p3,p4,p5,p6,p7)
00174
00175
00176
00177
00178
00179
00180
00181 #define TTB_CHECK_COND(expression) \
00182 TestToolBox::TestEvents::Get()->CheckCondition( __FILE__,__LINE__, #expression, expression);
00183
00184 #define TTB_CHECK_EQUAL(left,right) \
00185 TestToolBox::TestEvents::Get()->CheckEqual( __FILE__,__LINE__, #left, left, #right, right);
00186
00187 #define TTB_CHECK(left, op, right) \
00188 TestToolBox::TestEvents::Get()->Check(__FILE__,__LINE__,#left,left,#op,op,#right,right);
00189
00190
00191
00192
00193
00194
00195
00196
00197 #define TTB_INFO(message) TestToolBox::TestEvents::Get()->Info (message)
00198
00199
00200 #define TTB_SECTION(sectionName) TestToolBox::TestEvents::Get()->Section (sectionName)
00201
00202
00203 #define TTB_LIST_ALL_STORED_EVENTS() TestToolBox::TestEvents::Get()->ListAllStoredEvents (__FILE__,__LINE__)
00204
00205
00206 #define TTB_CHECK_FOR_UNEXPECTED_EVENTS() TestToolBox::TestEvents::Get()->CheckForUnexpectedEvents ("explicit check", __FILE__,__LINE__)
00207
00208
00209
00210
00211
00212
00213
00214 #define TTB_CHECK_SECTION() \
00215 BOOST_CHECK((TTB::TestEvents::Get()->CurTestIsStillOk())); \
00216 TestToolBox::TestEvents::Get()->CheckForUnexpectedEvents ("explicit check", __FILE__,__LINE__); \
00217 BOOST_MESSAGE("\n---- TEST_EVENT check section\n"); \
00218 TestToolBox::TestEvents::Get()->StartNewTestCase("TEST_EVENT next test case");
00219
00220 #define TTB_NEXT_SECTION(infoAboutNextSection) \
00221 BOOST_CHECK((TTB::TestEvents::Get()->CurTestIsStillOk())); \
00222 TestToolBox::TestEvents::Get()->CheckForUnexpectedEvents ("explicit check", __FILE__,__LINE__); \
00223 BOOST_MESSAGE("\n---- TEST_EVENT next section: " #infoAboutNextSection "\n"); \
00224 TestToolBox::TestEvents::Get()->StartNewTestCase("TEST_EVENT next test case");
00225
00226
00227 struct IEventReceiver;
00228 struct IProtocol;
00229 class TestEvents;
00230 class EventPosition;
00231
00232
00233
00234
00235
00236
00237 namespace CheckType
00238 {
00239 enum Enum
00240 {
00241
00242 eNOT_SET,
00243
00244
00245 eSTRICT,
00246
00247
00248
00249 eSEQUENTIAL,
00250
00251
00252 eVARIABLE
00253 };
00254 }
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264 class EventPosition
00265 {
00266 public:
00267 EventPosition()
00268 : m_position (-1)
00269 {}
00270 EventPosition (int in_pos)
00271 : m_position (in_pos)
00272 {}
00273 EventPosition (std::vector<int>::size_type in_sizePos)
00274 : m_position (static_cast<int>(in_sizePos))
00275 {}
00276
00277 void Reset (void)
00278 {m_position = -1;}
00279
00280 operator int() const
00281 {return m_position;}
00282
00283 void StorePos (int & out_rPos)
00284 {out_rPos = m_position;}
00285
00286 bool IsOk (void)
00287 {return m_position >= 0;}
00288
00289 private:
00290 int m_position;
00291 };
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303 class TestEvents : public AutoCriticalSection, public IEventReceiver
00304 {
00305 private:
00306
00307
00308
00309 explicit TestEvents (void);
00310
00311 public:
00312
00313 std::string const S_UNEXPECTED_EVENTS;
00314 std::string const S_EVENT_NOT_FOUND;
00315 std::string const S_EXPECTED;
00316 std::string const S_FOUND;
00317 std::string const S_SEPARATOR_LINE_1;
00318 std::string const S_SEPARATOR_LINE_2;
00319
00320
00321
00322
00323 ~TestEvents();
00324
00325
00326 #ifdef USE_TEST_INSTANCE_DLL
00327 static TestEvents* CreateNewInstanceForUsageInDll(void){return new TestEvents;};
00328 static TestEvents* Get (void)
00329 {return TTB_GetInstance_TestEvents();}
00330 static void Cleanup (void)
00331 {TTB_CleanupInstance_TestEvents();}
00332 #else
00333 static TestEvents* Get (void)
00334 {if (!s_pTestEvents) s_pTestEvents = new TestEvents;
00335 return s_pTestEvents;}
00336 static TestEvents* s_pTestEvents;
00337 static void Cleanup (void)
00338 {delete s_pTestEvents; s_pTestEvents = 0;}
00339 #endif
00340
00341
00342 void ConnectWithEventReceiver (IEventReceiver* in_pIEventReceiver)
00343 {m_pIEventReceiver = in_pIEventReceiver;}
00344
00345 void ConnectWithProtocol (IProtocol* in_pIProtocol)
00346 {m_pIProtocol = in_pIProtocol;}
00347
00348
00349
00350 void SetWidthCommandNameInLogFile (int in_width)
00351 {m_widthCommandNameInLogFile = in_width;}
00352
00353
00354
00355
00356
00357
00358
00359
00360 virtual void EventMsg(
00361 EventContext,
00362 const char* in_eventDescription)
00363 {Act(in_eventDescription);}
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381 void Act (const char* in_actualEvent, ...);
00382
00383
00384 void ActualResult (const char* in_actualEvent, ...);
00385
00386
00387 void Act (std::string const & in_actualEvent)
00388 {Act(in_actualEvent.c_str());}
00389
00390
00391
00392
00393
00394
00395
00396 EventPosition ExpectResult(
00397 const char* in_fileName,
00398 const long in_lineNum,
00399 const char* in_expectedEvent, ...);
00400
00401
00402
00403 EventPosition ExpectResultSequential(
00404 const char* in_fileName,
00405 const long in_lineNum,
00406 const char* in_expectedEvent, ...);
00407
00408
00409
00410 EventPosition ExpectResultVariable(
00411 const char* in_fileName,
00412 const long in_lineNum,
00413 const char* in_expectedEvent, ...);
00414
00415
00416
00417
00418
00419
00420 void CheckForUnexpectedEvents (
00421 const char* in_context,
00422 const char* in_fileName = 0,
00423 const long in_lineNum = 0);
00424
00425
00426
00427 void ResetCurrentCheckPosition (void);
00428
00429
00430 void SetCurrentCheckPosition (int in_newPos);
00431
00432
00433 int GetCurrentCheckPosition (void);
00434
00435
00436 void ListAllStoredEvents (
00437 const char* in_fileName = 0,
00438 const long in_lineNum = 0,
00439 CheckType::Enum in_checkType = CheckType::eNOT_SET);
00440
00441
00442
00443
00444
00445
00446
00447 void ClearAllStoredEvents (void);
00448
00449
00450 void SetCheckType (CheckType::Enum in_mode)
00451 {m_checkType = in_mode;}
00452
00453
00454 void ResetCheckType (void)
00455 {m_checkType = CheckType::eNOT_SET;}
00456
00457
00458 CheckType::Enum GetCheckType (void)
00459 {return m_checkType;}
00460
00461
00462 std::string GetCheckTypeAsText (CheckType::Enum in_checkType);
00463
00464
00465
00466 EventPosition GetLastEventPosition (void)
00467 {return m_positionOfLastEvent;}
00468
00469
00470
00471
00472
00473
00474
00475
00476 void SetDetailedLog (
00477 bool in_state,
00478 std::string const & in_prefixAct = "")
00479 {m_detailedLog = in_state; m_actLogPrefix = in_prefixAct;}
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496 bool CheckCondition (
00497 const char* in_fileName,
00498 const long in_lineNum,
00499 std::string const & in_expressionAsText,
00500 bool in_expressionValue);
00501
00502
00503
00504
00505
00506 template <typename T>
00507 bool CheckEqual(
00508 const char* in_fileName,
00509 const long in_lineNum,
00510 std::string const & in_leftExpressionAsText,
00511 T const & in_leftExpressionValue,
00512 std::string const & in_rightExpressionAsText,
00513 T const & in_rightExpressionValue)
00514 {
00515 bool errorFound = (in_leftExpressionValue != in_rightExpressionValue);
00516
00517
00518 DisplayCheckInfo (
00519 in_fileName, in_lineNum,
00520 "CheckEqual", errorFound,
00521 in_leftExpressionAsText, ToString(in_leftExpressionValue),
00522 in_rightExpressionAsText, ToString(in_rightExpressionValue),
00523 "==", typeid(in_leftExpressionValue).name());
00524
00525 return errorFound;
00526 }
00527
00528
00529
00530
00531
00532
00533 bool CheckEqual(
00534 const char* in_fileName,
00535 const long in_lineNum,
00536 std::string const & in_leftExpressionAsText,
00537 double const & in_leftExpressionValue,
00538 std::string const & in_rightExpressionAsText,
00539 double const & in_rightExpressionValue);
00540
00541
00542
00543
00544
00545
00546
00547 template <typename T, typename CompareOp>
00548 bool Check(
00549 const char* in_fileName,
00550 const long in_lineNum,
00551 std::string const & in_leftExpressionAsText,
00552 T const & in_leftExpressionValue,
00553 std::string const & in_compareOpAsText,
00554 CompareOp & in_compareOp,
00555 std::string const & in_rightExpressionAsText,
00556 T const & in_rightExpressionValue)
00557 {
00558
00559 bool errorFound = !in_compareOp(
00560 in_leftExpressionValue,in_rightExpressionValue);
00561
00562
00563 DisplayCheckInfo (
00564 in_fileName, in_lineNum,
00565 "Check", errorFound,
00566 in_leftExpressionAsText, ToString(in_leftExpressionValue),
00567 in_rightExpressionAsText, ToString(in_rightExpressionValue),
00568 in_compareOpAsText, typeid(in_leftExpressionValue).name());
00569
00570 return errorFound;
00571 }
00572
00573
00574
00575 void SetDoublePrecision (int in_precision)
00576 {m_doublePrecision = in_precision;}
00577
00578
00579
00580 int GetDoublePrecision (void)
00581 {return m_doublePrecision;}
00582
00583
00584
00585
00586 void SetDetailedCheckLog (bool in_detailedLog)
00587 {m_detailedCheckLog = in_detailedLog;}
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598 void StartNewTestCase (
00599 const std::string& in_rDescTestCase);
00600
00601
00602 void Command (
00603 std::string const & in_cmd,
00604 std::string const & in_params = "");
00605
00606
00607 void Info (
00608 std::string const & in_info);
00609
00610
00611
00612 void Section (
00613 std::string const & in_sectionName);
00614
00615
00616
00617 void GenerateErrorMessage (
00618 const char* in_fileName,
00619 const long in_lineNum,
00620 std::string const & in_errorInfo);
00621
00622
00623
00624 bool CheckForUnexpectedEvents (
00625 std::string& out_rResult);
00626
00627
00628 void ListAllStoredEvents (
00629 std::string& out_rListOfEvents);
00630
00631
00632 void AddTestEvent (
00633 const std::string& in_rEvent);
00634
00635
00636 EventPosition CheckForTestEvent(
00637 const std::string& in_rEvent,
00638 std::string& out_rResult1,
00639 std::string& out_rResult2);
00640
00641
00642
00643 EventPosition CheckForTestEventSequential(
00644 const std::string& in_rEvent,
00645 std::string& out_rResult1,
00646 std::string& out_rResult2);
00647
00648
00649
00650 EventPosition CheckForTestEventVariable(
00651 const std::string& in_rEvent,
00652 std::string& out_rResult1,
00653 std::string& out_rResult2);
00654
00655
00656 bool AllTestsHaveSucceeded (void)
00657 {return m_numFailedTests == 0;}
00658
00659
00660 bool GetTestResult (
00661 long& out_rNumPerformedTests,
00662 long& out_rNumFailedTests,
00663 std::string& out_rDescFirstFailedTest,
00664 std::string& out_rDescError);
00665
00666
00667 bool CurTestIsStillOk (void)
00668 {return m_curTestStillOk;}
00669
00670
00671 std::string GetDescCurTest (void)
00672 {return m_descCurrentTest;}
00673
00674
00675 void Reset (void);
00676
00677
00678
00679 private:
00680
00681
00682 struct FirstError
00683 {
00684 bool m_exists;
00685 long m_idxFirstFailedTest;
00686 std::string m_descFirstFailedTest;
00687 std::string m_descError;
00688 FirstError() : m_exists (false), m_idxFirstFailedTest(0){}
00689 };
00690
00691
00692 FirstError m_firstError;
00693
00694
00695
00696
00697
00698
00699 typedef std::vector<std::pair <bool, std::string> > Events;
00700
00701
00702 Events m_events;
00703
00704
00705 Events::size_type m_curCheckPos;
00706
00707
00708
00709 EventPosition m_positionOfLastEvent;
00710
00711
00712 std::string m_actLogPrefix;
00713
00714
00715
00716 bool m_active;
00717
00718
00719
00720
00721 bool m_checkForUnexpected;
00722
00723
00724
00725
00726 bool m_detailedLog;
00727
00728
00729
00730 bool m_detailedCheckLog;
00731
00732
00733 CheckType::Enum m_checkType;
00734
00735
00736
00737 int m_doublePrecision;
00738
00739
00740 bool m_curTestStillOk;
00741
00742
00743 long m_numPerformedTests;
00744
00745
00746 long m_numFailedTests;
00747
00748
00749 std::string m_descCurrentTest;
00750
00751
00752
00753 int m_widthCommandNameInLogFile;
00754
00755
00756 IEventReceiver* m_pIEventReceiver;
00757
00758
00759 IProtocol* m_pIProtocol;
00760
00761 friend class EventPosition;
00762
00763 private:
00764
00765
00766
00767
00768
00769
00770 void IncrementCurPos (void);
00771
00772
00773
00774
00775 void StoreError (
00776 const std::string& in_rErrStr1,
00777 const std::string& in_rErrStr2);
00778
00779
00780
00781
00782 EventPosition TestEvents::ExpectResultInternal(
00783 const char* in_fileName,
00784 const long in_lineNum,
00785 const char* in_formattedResult,
00786 CheckType::Enum in_checkType);
00787
00788
00789 void DisplayCheckInfo (
00790 const char* in_fileName,
00791 const long in_lineNum,
00792 std::string const & in_checkType,
00793 bool in_checkFailed,
00794 std::string const & in_paramLeftAsText,
00795 std::string const & in_paramValLeftAsText,
00796 std::string const & in_paramRightAsText = "",
00797 std::string const & in_paramValRightAsText = "",
00798 std::string const & in_compareOpAsText = "",
00799 std::string const & in_paramTypeAsText = "");
00800
00801
00802
00803 };
00804
00805
00806
00807
00808 #ifndef USE_TEST_INSTANCE_DLL
00809 __declspec(selectany) TestEvents* TestEvents::s_pTestEvents = 0;
00810 #endif
00811
00812
00813
00814
00815
00816
00817 static TestEvents* TheTestEvents (void)
00818 {return TestEvents::Get();}
00819
00820 };
00821
00822
00823 #pragma warning( pop )
00824
00825