1 //------------------------------------------------------------------------------ 2 // MessageInt32ItemTest.h 3 // 4 //------------------------------------------------------------------------------ 5 6 #ifndef MESSAGEINT32ITEMTEST_H 7 #define MESSAGEINT32ITEMTEST_H 8 9 // Standard Includes ----------------------------------------------------------- 10 11 // System Includes ------------------------------------------------------------- 12 13 // Project Includes ------------------------------------------------------------ 14 15 // Local Includes -------------------------------------------------------------- 16 #include "../common.h" 17 18 // Local Defines --------------------------------------------------------------- 19 20 // Globals --------------------------------------------------------------------- 21 #define USE_TEMPLATES 22 #ifdef USE_TEMPLATES 23 #include "MessageItemTest.h" 24 25 typedef TMessageItemFuncPolicy 26 < 27 int32, 28 &BMessage::AddInt32, 29 &BMessage::FindInt32, 30 &BMessage::FindInt32, 31 &BMessage::FindInt32, 32 &BMessage::HasInt32, 33 &BMessage::ReplaceInt32 34 > 35 TInt32FuncPolicy; 36 37 struct TInt32InitPolicy : public ArrayTypeBase<int32> 38 { ZeroTInt32InitPolicy39 inline static int32 Zero() { return 0; } Test1TInt32InitPolicy40 inline static int32 Test1() { return 1234; } Test2TInt32InitPolicy41 inline static int32 Test2() { return 5678; } SizeOfTInt32InitPolicy42 inline static size_t SizeOf(const int32&) { return sizeof (int32); } ArrayTInt32InitPolicy43 inline static ArrayType Array() 44 { 45 ArrayType array; 46 array.push_back(123); 47 array.push_back(456); 48 array.push_back(789); 49 return array; 50 } 51 }; 52 53 typedef TMessageItemAssertPolicy 54 < 55 int32 56 > 57 TInt32AssertPolicy; 58 59 typedef TMessageItemTest 60 < 61 int32, 62 B_INT32_TYPE, 63 TInt32FuncPolicy, 64 TInt32InitPolicy, 65 TInt32AssertPolicy 66 > 67 TMessageInt32ItemTest; 68 69 #else 70 class TMessageInt32ItemTest : public TestCase 71 { 72 public: TMessageInt32ItemTest()73 TMessageInt32ItemTest() {;} TMessageInt32ItemTest(std::string name)74 TMessageInt32ItemTest(std::string name) : TestCase(name) {;} 75 76 void MessageInt32ItemTest1(); 77 void MessageInt32ItemTest2(); 78 void MessageInt32ItemTest3(); 79 void MessageInt32ItemTest4(); 80 void MessageInt32ItemTest5(); 81 void MessageInt32ItemTest6(); 82 void MessageInt32ItemTest7(); 83 void MessageInt32ItemTest8(); 84 85 static TestSuite* Suite(); 86 }; 87 #endif 88 89 #endif // MESSAGEINT32ITEMTEST_H 90 91 /* 92 * $Log $ 93 * 94 * $Id $ 95 * 96 */ 97 98