ReactOS 0.4.15-dev-7846-g8ba6c66
RmCpTest Class Reference
Inheritance diagram for RmCpTest:
Collaboration diagram for RmCpTest:

Protected Member Functions

void remcopy1 ()
 
void remcpif1 ()
 
void remif1 ()
 
void remove1 ()
 
void repcpif1 ()
 
void replace0 ()
 
void replace1 ()
 
void replcpy1 ()
 
void replif1 ()
 
void revcopy1 ()
 
void reverse1 ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (RmCpTest)
 
 CPPUNIT_TEST (remcopy1)
 
 CPPUNIT_TEST (remcpif1)
 
 CPPUNIT_TEST (remif1)
 
 CPPUNIT_TEST (remove1)
 
 CPPUNIT_TEST (repcpif1)
 
 CPPUNIT_TEST (replace0)
 
 CPPUNIT_TEST (replace1)
 
 CPPUNIT_TEST (replcpy1)
 
 CPPUNIT_TEST (replif1)
 
 CPPUNIT_TEST (revcopy1)
 
 CPPUNIT_TEST (reverse1)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 13 of file rm_cp_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/11]

RmCpTest::CPPUNIT_TEST ( remcopy1  )
private

◆ CPPUNIT_TEST() [2/11]

RmCpTest::CPPUNIT_TEST ( remcpif1  )
private

◆ CPPUNIT_TEST() [3/11]

RmCpTest::CPPUNIT_TEST ( remif1  )
private

◆ CPPUNIT_TEST() [4/11]

RmCpTest::CPPUNIT_TEST ( remove1  )
private

◆ CPPUNIT_TEST() [5/11]

RmCpTest::CPPUNIT_TEST ( repcpif1  )
private

◆ CPPUNIT_TEST() [6/11]

RmCpTest::CPPUNIT_TEST ( replace0  )
private

◆ CPPUNIT_TEST() [7/11]

RmCpTest::CPPUNIT_TEST ( replace1  )
private

◆ CPPUNIT_TEST() [8/11]

RmCpTest::CPPUNIT_TEST ( replcpy1  )
private

◆ CPPUNIT_TEST() [9/11]

RmCpTest::CPPUNIT_TEST ( replif1  )
private

◆ CPPUNIT_TEST() [10/11]

RmCpTest::CPPUNIT_TEST ( revcopy1  )
private

◆ CPPUNIT_TEST() [11/11]

RmCpTest::CPPUNIT_TEST ( reverse1  )
private

◆ CPPUNIT_TEST_SUITE()

RmCpTest::CPPUNIT_TEST_SUITE ( RmCpTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

RmCpTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ remcopy1()

void RmCpTest::remcopy1 ( )
protected

Definition at line 216 of file rm_cp_test.cpp.

217{
218 int numbers[6] = { 1, 2, 3, 1, 2, 3 };
219 int result[6] = { 0, 0, 0, 0, 0, 0 };
220
221 remove_copy((int*)numbers, (int*)numbers + 6, (int*)result, 2);
222
223 CPPUNIT_ASSERT(result[0]==1);
224 CPPUNIT_ASSERT(result[1]==3);
225 CPPUNIT_ASSERT(result[2]==1);
226 CPPUNIT_ASSERT(result[3]==3);
227 CPPUNIT_ASSERT(result[4]==0);
228 CPPUNIT_ASSERT(result[5]==0);
229}
_STLP_INLINE_LOOP _OutputIter remove_copy(_InputIter __first, _InputIter __last, _OutputIter __result, const _Tp &__val)
Definition: _algo.h:239
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint64EXT * result
Definition: glext.h:11304

◆ remcpif1()

void RmCpTest::remcpif1 ( )
protected

Definition at line 231 of file rm_cp_test.cpp.

232{
233 int numbers[6] = { 1, 2, 3, 1, 2, 3 };
234 int result[6] = { 0, 0, 0, 0, 0, 0 };
235
236 remove_copy_if((int*)numbers, (int*)numbers + 6, (int*)result, odd);
237
238 // 2 2 0 0 0 0
239 CPPUNIT_ASSERT(result[0]==2);
240 CPPUNIT_ASSERT(result[1]==2);
241 CPPUNIT_ASSERT(result[2]==0);
242 CPPUNIT_ASSERT(result[3]==0);
243 CPPUNIT_ASSERT(result[4]==0);
244 CPPUNIT_ASSERT(result[5]==0);
245}
_STLP_INLINE_LOOP _OutputIter remove_copy_if(_InputIter __first, _InputIter __last, _OutputIter __result, _Predicate __pred)
Definition: _algo.h:252
Definition: unary.h:11

◆ remif1()

void RmCpTest::remif1 ( )
protected

Definition at line 201 of file rm_cp_test.cpp.

202{
203 int numbers[6] = { 0, 0, 1, 1, 2, 2 };
204
205 remove_if((int*)numbers, (int*)numbers + 6, odd);
206
207 // 0 0 2 2 2 2
208 CPPUNIT_ASSERT(numbers[0]==0);
209 CPPUNIT_ASSERT(numbers[1]==0);
210 CPPUNIT_ASSERT(numbers[2]==2);
211 CPPUNIT_ASSERT(numbers[3]==2);
212 CPPUNIT_ASSERT(numbers[4]==2);
213 CPPUNIT_ASSERT(numbers[5]==2);
214}
_STLP_INLINE_LOOP _ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
Definition: _algo.h:278

◆ remove1()

void RmCpTest::remove1 ( )
protected

Definition at line 187 of file rm_cp_test.cpp.

188{
189 int numbers[6] = { 1, 2, 3, 1, 2, 3 };
190 remove((int*)numbers, (int*)numbers + 6, 1);
191
192 // 2 3 2 3 2 3
193 CPPUNIT_ASSERT(numbers[0]==2);
194 CPPUNIT_ASSERT(numbers[1]==3);
195 CPPUNIT_ASSERT(numbers[2]==2);
196 CPPUNIT_ASSERT(numbers[3]==3);
197 CPPUNIT_ASSERT(numbers[4]==2);
198 CPPUNIT_ASSERT(numbers[5]==3);
199}
int remove
Definition: msacm.c:1366

◆ repcpif1()

void RmCpTest::repcpif1 ( )
protected

Definition at line 153 of file rm_cp_test.cpp.

154{
155 vector <int> v1(10);
156 for (int i = 0; (size_t)i < v1.size(); ++i)
157 v1[i] = i % 5;
158 vector <int> v2(v1.size());
159
160 // 0 1 2 3 4 0 1 2 3 4
161 // 0 1 2 3 4 0 1 2 3 4
162 // 0 42 2 42 4 0 42 2 42 4
163 replace_copy_if(v1.begin(), v1.end(), v2.begin(), odd, 42);
164 CPPUNIT_ASSERT(v1[0]==0);
165 CPPUNIT_ASSERT(v1[1]==1);
166 CPPUNIT_ASSERT(v1[2]==2);
167 CPPUNIT_ASSERT(v1[3]==3);
168 CPPUNIT_ASSERT(v1[4]==4);
169 CPPUNIT_ASSERT(v1[5]==0);
170 CPPUNIT_ASSERT(v1[6]==1);
171 CPPUNIT_ASSERT(v1[7]==2);
172 CPPUNIT_ASSERT(v1[8]==3);
173 CPPUNIT_ASSERT(v1[9]==4);
174
175 CPPUNIT_ASSERT(v2[0]==0);
176 CPPUNIT_ASSERT(v2[1]==42);
177 CPPUNIT_ASSERT(v2[2]==2);
178 CPPUNIT_ASSERT(v2[3]==42);
179 CPPUNIT_ASSERT(v2[4]==4);
180 CPPUNIT_ASSERT(v2[5]==0);
181 CPPUNIT_ASSERT(v2[6]==42);
182 CPPUNIT_ASSERT(v2[7]==2);
183 CPPUNIT_ASSERT(v2[8]==42);
184 CPPUNIT_ASSERT(v2[9]==4);
185}
_STLP_INLINE_LOOP _OutputIter replace_copy_if(_Iterator __first, _Iterator __last, _OutputIter __result, _Predicate __pred, const _Tp &__new_value)
Definition: _algo.h:209
__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

◆ replace0()

void RmCpTest::replace0 ( )
protected

Definition at line 117 of file rm_cp_test.cpp.

118{
119 int numbers[6] = { 0, 1, 2, 0, 1, 2 };
120
121 replace(numbers, numbers + 6, 2, 42);
122
123 // 0 1 42 0 1 42
124 CPPUNIT_ASSERT(numbers[0]==0);
125 CPPUNIT_ASSERT(numbers[1]==1);
126 CPPUNIT_ASSERT(numbers[2]==42);
127 CPPUNIT_ASSERT(numbers[3]==0);
128 CPPUNIT_ASSERT(numbers[4]==1);
129 CPPUNIT_ASSERT(numbers[5]==42);
130}
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47

◆ replace1()

void RmCpTest::replace1 ( )
protected

Definition at line 132 of file rm_cp_test.cpp.

133{
134 vector <int> v1(10);
135 for (int i = 0; (size_t)i < v1.size(); ++i)
136 v1[i] = i % 5;
137 replace(v1.begin(), v1.end(), 2, 42);
138
139 // 0 1 2 3 4 0 1 2 3 4
140 // 0 1 42 3 4 0 1 42 3 4
141 CPPUNIT_ASSERT(v1[0]==0);
142 CPPUNIT_ASSERT(v1[1]==1);
143 CPPUNIT_ASSERT(v1[2]==42);
144 CPPUNIT_ASSERT(v1[3]==3);
145 CPPUNIT_ASSERT(v1[4]==4);
146 CPPUNIT_ASSERT(v1[5]==0);
147 CPPUNIT_ASSERT(v1[6]==1);
148 CPPUNIT_ASSERT(v1[7]==42);
149 CPPUNIT_ASSERT(v1[8]==3);
150 CPPUNIT_ASSERT(v1[9]==4);
151}

◆ replcpy1()

void RmCpTest::replcpy1 ( )
protected

Definition at line 103 of file rm_cp_test.cpp.

104{
105 int numbers[6] = { 0, 1, 2, 0, 1, 2 };
106 int result[6] = { 0, 0, 0, 0, 0, 0 };
107
108 replace_copy((int*)numbers, (int*)numbers + 6, (int*)result, 2, 42);
109 CPPUNIT_ASSERT(result[0]==0);
110 CPPUNIT_ASSERT(result[1]==1);
111 CPPUNIT_ASSERT(result[2]==42);
112 CPPUNIT_ASSERT(result[3]==0);
113 CPPUNIT_ASSERT(result[4]==1);
114 CPPUNIT_ASSERT(result[5]==42);
115}
_STLP_INLINE_LOOP _OutputIter replace_copy(_InputIter __first, _InputIter __last, _OutputIter __result, const _Tp &__old_value, const _Tp &__new_value)
Definition: _algo.h:199

◆ replif1()

void RmCpTest::replif1 ( )
protected

Definition at line 82 of file rm_cp_test.cpp.

83{
84 vector <int> v1(10);
85 for (int i = 0; (size_t)i < v1.size(); ++i)
86 v1[i] = i % 5;
87
88 replace_if(v1.begin(), v1.end(), odd, 42);
89
90 // 0 42 2 42 4 0 42 2 42 4
91 CPPUNIT_ASSERT(v1[0]==0);
92 CPPUNIT_ASSERT(v1[1]==42);
93 CPPUNIT_ASSERT(v1[2]==2);
94 CPPUNIT_ASSERT(v1[3]==42);
95 CPPUNIT_ASSERT(v1[4]==4);
96 CPPUNIT_ASSERT(v1[5]==0);
97 CPPUNIT_ASSERT(v1[6]==42);
98 CPPUNIT_ASSERT(v1[7]==2);
99 CPPUNIT_ASSERT(v1[8]==42);
100 CPPUNIT_ASSERT(v1[9]==4);
101}
_STLP_INLINE_LOOP void replace_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const _Tp &__new_value)
Definition: _algo.h:190

◆ revcopy1()

void RmCpTest::revcopy1 ( )
protected

Definition at line 67 of file rm_cp_test.cpp.

68{
69 int numbers[6] = { 0, 1, 2, 3, 4, 5 };
70
71 int result[6];
72 reverse_copy((int*)numbers, (int*)numbers + 6, (int*)result);
73 // 5 4 3 2 1 0
80}
_STLP_INLINE_LOOP _OutputIter reverse_copy(_BidirectionalIter __first, _BidirectionalIter __last, _OutputIter __result)
Definition: _algo.h:339

◆ reverse1()

void RmCpTest::reverse1 ( )
protected

Definition at line 54 of file rm_cp_test.cpp.

55{
56 int numbers[6] = { 0, 1, 2, 3, 4, 5 };
57
58 reverse(numbers, numbers + 6);
59 CPPUNIT_ASSERT(numbers[0]==5);
60 CPPUNIT_ASSERT(numbers[1]==4);
61 CPPUNIT_ASSERT(numbers[2]==3);
62 CPPUNIT_ASSERT(numbers[3]==2);
63 CPPUNIT_ASSERT(numbers[4]==1);
64 CPPUNIT_ASSERT(numbers[5]==0);
65}
static void reverse(int *pidx, int cch)
Definition: bidi.c:1153

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