ReactOS  0.4.15-dev-1184-g23e04ae
fill_test.cpp
Go to the documentation of this file.
1 #include <vector>
2 #include <algorithm>
3 
5 
6 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
7 using namespace std;
8 #endif
9 
10 //
11 // TestCase class
12 //
13 class FillTest : public CPPUNIT_NS::TestCase
14 {
17  CPPUNIT_TEST(filln1);
19 
20 protected:
21  void fill1();
22  void filln1();
23 };
24 
26 
27 //
28 // tests implementation
29 //
31 {
32  vector <int> v(10);
33  fill(v.begin(), v.end(), 42);
34 
35  CPPUNIT_ASSERT(v[0]==42);
36  CPPUNIT_ASSERT(v[1]==42);
37  CPPUNIT_ASSERT(v[2]==42);
38  CPPUNIT_ASSERT(v[3]==42);
39  CPPUNIT_ASSERT(v[4]==42);
40  CPPUNIT_ASSERT(v[5]==42);
41  CPPUNIT_ASSERT(v[6]==42);
42  CPPUNIT_ASSERT(v[7]==42);
43  CPPUNIT_ASSERT(v[8]==42);
44  CPPUNIT_ASSERT(v[9]==42);
45 }
47 {
48  vector <int> v(10);
49  fill_n(v.begin(), v.size(), 42);
50 
51  CPPUNIT_ASSERT(v[0]==42);
52  CPPUNIT_ASSERT(v[1]==42);
53  CPPUNIT_ASSERT(v[2]==42);
54  CPPUNIT_ASSERT(v[3]==42);
55  CPPUNIT_ASSERT(v[4]==42);
56  CPPUNIT_ASSERT(v[5]==42);
57  CPPUNIT_ASSERT(v[6]==42);
58  CPPUNIT_ASSERT(v[7]==42);
59  CPPUNIT_ASSERT(v[8]==42);
60  CPPUNIT_ASSERT(v[9]==42);
61 }
void filln1()
Definition: fill_test.cpp:46
CPPUNIT_TEST_SUITE_REGISTRATION(FillTest)
#define CPPUNIT_TEST_SUITE(X)
Definition: cppunit_mini.h:142
#define CPPUNIT_TEST(X)
Definition: cppunit_mini.h:182
Definition: features.h:417
#define CPPUNIT_TEST_SUITE_END()
Definition: cppunit_mini.h:191
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algobase.h:449
_STLP_MOVE_TO_STD_NAMESPACE void fill_n(_OutputIter __first, _Size __n, const _Tp &__val)
Definition: _algobase.h:511
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
const GLdouble * v
Definition: gl.h:2040
GLuint64EXT GLuint GLuint GLenum GLenum GLuint GLuint GLenum GLuint fill1
Definition: glext.h:10608
void fill1()
Definition: fill_test.cpp:30