1 //------------------------------------------------------------------------------
2 // MessageBRectItemTest.h
4 //------------------------------------------------------------------------------
6 #ifndef MESSAGEBRECTITEMTEST_H
7 #define MESSAGEBRECTITEMTEST_H
9 // Standard Includes -----------------------------------------------------------
11 // System Includes -------------------------------------------------------------
13 // Project Includes ------------------------------------------------------------
15 // Local Includes --------------------------------------------------------------
16 #include "MessageItemTest.h"
18 // Local Defines ---------------------------------------------------------------
20 // Globals ---------------------------------------------------------------------
22 typedef TMessageItemFuncPolicy
30 &BMessage::ReplaceRect
34 struct TBRectInitPolicy
: public ArrayTypeBase
<BRect
>
36 inline static BRect
Zero() { return BRect(0, 0, 0, 0); }
37 inline static BRect
Test1() { return BRect(1, 2, 3, 4); }
38 inline static BRect
Test2() { return BRect(5, 6, 7, 8); }
39 inline static size_t SizeOf(const BRect
&) { return sizeof (BRect
); }
40 inline static ArrayType
Array()
43 array
.push_back(BRect(1, 2, 3, 4));
44 array
.push_back(BRect(4, 5, 6, 7));
45 array
.push_back(BRect(7, 8, 9, 10));
50 struct TBRectAssertPolicy
52 inline static BRect
Zero() { return BRect(0, 0, 0, 0); }
53 inline static BRect
Invalid() { return BRect(0, 0, -1, -1); }
54 inline static bool Size(size_t size
, BRect
& r
)
55 { return size
== sizeof (r
); }
58 typedef TMessageItemTest
66 TMessageBRectItemTest
;
68 std::ostream
& operator<<(std::ostream
& os
, const BRect
& rect
)
70 int precision
= os
.precision();
75 << " r:" << rect
.right
76 << " b:" << rect
.bottom
78 os
.precision(precision
);
83 #endif // MESSAGEBRECTITEMTEST_H