forked from CxxTest/cxxtest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SameData.h
41 lines (34 loc) · 816 Bytes
/
SameData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <cxxtest/TestSuite.h>
//
// This test suite demonstrates TS_ASSERT_SAME_DATA
//
class SameData : public CxxTest::TestSuite
{
public:
enum { DATA_SIZE = 24 };
unsigned char x[DATA_SIZE], y[DATA_SIZE];
void setUp()
{
for (unsigned i = 0; i < DATA_SIZE; ++ i)
{
x[i] = (unsigned char)i;
y[i] = (unsigned char)~x[i];
}
}
void testAssertSameData()
{
TS_ASSERT_SAME_DATA(x, y, DATA_SIZE);
}
void testAssertMessageSameData()
{
TSM_ASSERT_SAME_DATA("Not same data", x, y, DATA_SIZE);
}
void testSafeAssertSameData()
{
ETS_ASSERT_SAME_DATA(x, y, DATA_SIZE);
}
void testSafeAssertMessageSameData()
{
ETSM_ASSERT_SAME_DATA("Not same data", x, y, DATA_SIZE);
}
};