mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
37 lines
686 B
C++
37 lines
686 B
C++
// MyTestSuite7.h
|
|
#include <cxxtest/TestSuite.h>
|
|
#include <iostream>
|
|
|
|
class MyTestSuite7 : public CxxTest::TestSuite
|
|
{
|
|
public:
|
|
|
|
struct Data
|
|
{
|
|
char data[3];
|
|
bool operator==(Data o)
|
|
{
|
|
return (memcmp(this, &o, sizeof(o)) == 0);
|
|
}
|
|
};
|
|
|
|
struct Data2
|
|
{
|
|
char data[3];
|
|
};
|
|
|
|
void testCompareData()
|
|
{
|
|
Data x, y;
|
|
memset(x.data, 0x12, sizeof(x.data));
|
|
memset(y.data, 0xF6, sizeof(y.data));
|
|
TS_ASSERT_EQUALS(x, y);
|
|
|
|
Data2 z, w;
|
|
memset(z.data, 0x12, sizeof(x.data));
|
|
memset(w.data, 0xF6, sizeof(y.data));
|
|
TS_ASSERT_SAME_DATA(&z, &w, sizeof(z))
|
|
}
|
|
};
|
|
|