mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
42 lines
753 B
C
42 lines
753 B
C
|
#include <cxxtest/TestSuite.h>
|
||
|
|
||
|
//
|
||
|
// This test suite demonstrates the default ValueTraits
|
||
|
//
|
||
|
|
||
|
class DefaultTraits : public CxxTest::TestSuite
|
||
|
{
|
||
|
public:
|
||
|
struct EightBytes
|
||
|
{
|
||
|
EightBytes() {}
|
||
|
unsigned char data[8];
|
||
|
};
|
||
|
|
||
|
void testSmallDefaultTraits()
|
||
|
{
|
||
|
EightBytes x;
|
||
|
for (unsigned i = 0; i < sizeof(x.data); ++ i)
|
||
|
{
|
||
|
x.data[i] = (unsigned char)i;
|
||
|
}
|
||
|
TS_FAIL(x);
|
||
|
}
|
||
|
|
||
|
struct NineBytes
|
||
|
{
|
||
|
NineBytes() {}
|
||
|
unsigned char data[9];
|
||
|
};
|
||
|
|
||
|
void testBigDefaultTraits()
|
||
|
{
|
||
|
NineBytes x;
|
||
|
for (unsigned i = 0; i < sizeof(x.data); ++ i)
|
||
|
{
|
||
|
x.data[i] = (unsigned char)(0x98 + i);
|
||
|
}
|
||
|
TS_FAIL(x);
|
||
|
}
|
||
|
};
|