ReactOS 0.4.15-dev-7907-g95bf896
CopyTest Class Reference
Inheritance diagram for CopyTest:
Collaboration diagram for CopyTest:

Protected Member Functions

void copy_array ()
 
void copy_volatile ()
 
void copy_vector ()
 
void copy_insert ()
 
void copy_back ()
 
void copy_back_array ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (CopyTest)
 
 CPPUNIT_TEST (copy_array)
 
 CPPUNIT_TEST (copy_volatile)
 
 CPPUNIT_TEST (copy_vector)
 
 CPPUNIT_TEST (copy_insert)
 
 CPPUNIT_TEST (copy_back)
 
 CPPUNIT_TEST (copy_back_array)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 15 of file copy_test.cpp.

Member Function Documentation

◆ copy_array()

void CopyTest::copy_array ( )
protected

Definition at line 40 of file copy_test.cpp.

41{
42 char string[23] = "A string to be copied.";
43 char result[23];
44 copy(string, string + 23, result);
45 CPPUNIT_ASSERT(!strncmp(string, result, 23));
46}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint64EXT * result
Definition: glext.h:11304

◆ copy_back()

void CopyTest::copy_back ( )
protected

Definition at line 107 of file copy_test.cpp.

108{
109 vector<int> v1(10);
110 for (int i = 0; (size_t)i < v1.size(); ++i)
111 v1[i] = i;
112 vector<int> v2(v1.size());
113 copy_backward(v1.begin(), v1.end(), v2.end());
114
115 CPPUNIT_ASSERT( v2 == v1 );
116}
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result)
Definition: _algobase.h:328
__kernel_size_t size_t
Definition: linux.h:237
GLfloat GLfloat v1
Definition: glext.h:6062
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

◆ copy_back_array()

void CopyTest::copy_back_array ( )
protected

Definition at line 118 of file copy_test.cpp.

119{
120 int numbers[5] = { 1, 2, 3, 4, 5 };
121
122 int result[5];
123 copy_backward(numbers, numbers + 5, (int*)result + 5);
124 CPPUNIT_ASSERT(result[0]==numbers[0]);
125 CPPUNIT_ASSERT(result[1]==numbers[1]);
126 CPPUNIT_ASSERT(result[2]==numbers[2]);
127 CPPUNIT_ASSERT(result[3]==numbers[3]);
128 CPPUNIT_ASSERT(result[4]==numbers[4]);
129}

◆ copy_insert()

void CopyTest::copy_insert ( )
protected

Definition at line 96 of file copy_test.cpp.

96 {
97 vector<int> v1(10);
98 for (int loc = 0; (size_t)loc < v1.size(); ++loc)
99 v1[loc] = loc;
102 copy(v1.begin(), v1.end(), i);
103
104 CPPUNIT_ASSERT( v2 == v1 );
105}

◆ copy_vector()

void CopyTest::copy_vector ( )
protected

Definition at line 84 of file copy_test.cpp.

85{
86 vector<int> v1(10);
87 for (int i = 0; (size_t)i < v1.size(); ++i)
88 v1[i] = i;
89
90 vector<int> v2(v1.size());
91 copy(v1.begin(), v1.end(), v2.begin());
92
93 CPPUNIT_ASSERT( v2 == v1 );
94}

◆ copy_volatile()

void CopyTest::copy_volatile ( )
protected

Definition at line 48 of file copy_test.cpp.

49{
50 {
51 int a[] = {0, 1, 2, 3, 4, 5};
52 const size_t size = sizeof(a) / sizeof(a[0]);
53 volatile int va[size];
54 copy(a, a + size, va);
55 for (size_t i = 0; i != size; ++i) {
56 CPPUNIT_ASSERT( a[i] == va[i] );
57 }
58 }
59
60 {
61 const int a[] = {0, 1, 2, 3, 4, 5};
62 const size_t size = sizeof(a) / sizeof(a[0]);
63 volatile int va[size];
64 copy(a, a + size, va);
65 for (size_t i = 0; i != size; ++i) {
66 CPPUNIT_ASSERT( a[i] == va[i] );
67 }
68 }
69
70 // Following code can be activated to check that it doesn't compiled
71#if 0
72 {
73 int a[] = {0, 1, 2, 3, 4, 5};
74 const size_t size = sizeof(a) / sizeof(a[0]);
75 const volatile int va[size] = {5, 4, 3, 2, 1, 0};
76 copy(a, a + size, va);
77 for (size_t i = 0; i != size; ++i) {
78 CPPUNIT_ASSERT( a[i] == va[i] );
79 }
80 }
81#endif
82}
GLsizeiptr size
Definition: glext.h:5919
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define a
Definition: ke_i.h:78

◆ CPPUNIT_TEST() [1/6]

CopyTest::CPPUNIT_TEST ( copy_array  )
private

◆ CPPUNIT_TEST() [2/6]

CopyTest::CPPUNIT_TEST ( copy_back  )
private

◆ CPPUNIT_TEST() [3/6]

CopyTest::CPPUNIT_TEST ( copy_back_array  )
private

◆ CPPUNIT_TEST() [4/6]

CopyTest::CPPUNIT_TEST ( copy_insert  )
private

◆ CPPUNIT_TEST() [5/6]

CopyTest::CPPUNIT_TEST ( copy_vector  )
private

◆ CPPUNIT_TEST() [6/6]

CopyTest::CPPUNIT_TEST ( copy_volatile  )
private

◆ CPPUNIT_TEST_SUITE()

CopyTest::CPPUNIT_TEST_SUITE ( CopyTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

CopyTest::CPPUNIT_TEST_SUITE_END ( )
private

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