ReactOS 0.4.16-dev-205-g7b2bb7e
TransformTest Class Reference
Inheritance diagram for TransformTest:
Collaboration diagram for TransformTest:

Protected Member Functions

void trnsfrm1 ()
 
void trnsfrm2 ()
 
void self_str ()
 

Static Protected Member Functions

static int negate_int (int a_)
 
static char map_char (char a_, int b_)
 
static char shift (char c)
 

Private Member Functions

 CPPUNIT_TEST_SUITE (TransformTest)
 
 CPPUNIT_TEST (trnsfrm1)
 
 CPPUNIT_TEST (trnsfrm2)
 
 CPPUNIT_TEST (self_str)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 15 of file transform_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/3]

TransformTest::CPPUNIT_TEST ( self_str  )
private

◆ CPPUNIT_TEST() [2/3]

TransformTest::CPPUNIT_TEST ( trnsfrm1  )
private

◆ CPPUNIT_TEST() [3/3]

TransformTest::CPPUNIT_TEST ( trnsfrm2  )
private

◆ CPPUNIT_TEST_SUITE()

TransformTest::CPPUNIT_TEST_SUITE ( TransformTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

TransformTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ map_char()

static char TransformTest::map_char ( char  a_,
int  b_ 
)
inlinestaticprotected

Definition at line 31 of file transform_test.cpp.

31 {
32 return char(a_ + b_);
33 }
unsigned char
Definition: typeof.h:29

Referenced by trnsfrm2().

◆ negate_int()

static int TransformTest::negate_int ( int  a_)
inlinestaticprotected

Definition at line 28 of file transform_test.cpp.

28 {
29 return -a_;
30 }

Referenced by trnsfrm1().

◆ self_str()

void TransformTest::self_str ( )
protected

Definition at line 73 of file transform_test.cpp.

74{
75 string s( "0123456789abcdefg" );
76 string r( "123456789:bcdefgh" );
77 transform( s.begin(), s.end(), s.begin(), shift );
78 CPPUNIT_ASSERT( s == r );
79}
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLdouble s
Definition: gl.h:2039
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLenum GLenum transform
Definition: glext.h:9407
#define shift
Definition: input.c:1755

◆ shift()

static char TransformTest::shift ( char  c)
inlinestaticprotected

Definition at line 34 of file transform_test.cpp.

34 {
35 return char(((int)c + 1) % 256);
36 }
const GLubyte * c
Definition: glext.h:8905

◆ trnsfrm1()

void TransformTest::trnsfrm1 ( )
protected

Definition at line 44 of file transform_test.cpp.

45{
46 int numbers[6] = { -5, -1, 0, 1, 6, 11 };
47
48 int result[6];
49 transform((int*)numbers, (int*)numbers + 6, (int*)result, negate_int);
50
54 CPPUNIT_ASSERT(result[3]==-1);
55 CPPUNIT_ASSERT(result[4]==-6);
56 CPPUNIT_ASSERT(result[5]==-11);
57}
static int negate_int(int a_)
GLuint64EXT * result
Definition: glext.h:11304

◆ trnsfrm2()

void TransformTest::trnsfrm2 ( )
protected

Definition at line 58 of file transform_test.cpp.

59{
60#if defined (__MVS__)
61 int trans[] = {-11, 4, -6, -6, -18, 0, 18, -14, 6, 0, -1, -59};
62#else
63 int trans[] = {-4, 4, -6, -6, -10, 0, 10, -6, 6, 0, -1, -77};
64#endif
65 char n[] = "Larry Mullen";
66 const size_t count = ::strlen(n);
67
68 string res;
70 CPPUNIT_ASSERT( res == "Hello World!" )
71}
back_insert_iterator< _Container > _STLP_CALL back_inserter(_Container &__x)
Definition: _iterator.h:187
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static char map_char(char a_, int b_)
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
GLuint res
Definition: glext.h:9613

The documentation for this class was generated from the following file: