ReactOS  0.4.15-dev-2956-g61e7ea5
MultisetTest Class Reference
Inheritance diagram for MultisetTest:
Collaboration diagram for MultisetTest:

Protected Member Functions

void mset1 ()
 
void mset3 ()
 
void mset5 ()
 

Static Protected Member Functions

static bool less_than (int a_, int b_)
 
static bool greater_than (int a_, int b_)
 

Private Types

typedef multiset< int, less< int > > mset
 

Private Member Functions

 CPPUNIT_TEST_SUITE (MultisetTest)
 
 CPPUNIT_TEST (mset1)
 
 CPPUNIT_TEST (mset3)
 
 CPPUNIT_TEST (mset5)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 13 of file multiset_test.cpp.

Member Typedef Documentation

◆ mset

typedef multiset<int, less<int> > MultisetTest::mset
private

Definition at line 15 of file multiset_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/3]

MultisetTest::CPPUNIT_TEST ( mset1  )
private

◆ CPPUNIT_TEST() [2/3]

MultisetTest::CPPUNIT_TEST ( mset3  )
private

◆ CPPUNIT_TEST() [3/3]

MultisetTest::CPPUNIT_TEST ( mset5  )
private

◆ CPPUNIT_TEST_SUITE()

MultisetTest::CPPUNIT_TEST_SUITE ( MultisetTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

MultisetTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ greater_than()

static bool MultisetTest::greater_than ( int  a_,
int  b_ 
)
inlinestaticprotected

Definition at line 33 of file multiset_test.cpp.

34  {
35  return a_ > b_;
36  }

◆ less_than()

static bool MultisetTest::less_than ( int  a_,
int  b_ 
)
inlinestaticprotected

Definition at line 28 of file multiset_test.cpp.

29  {
30  return a_ < b_;
31  }

◆ mset1()

void MultisetTest::mset1 ( )
protected

Definition at line 44 of file multiset_test.cpp.

45 {
46  mset s;
47  CPPUNIT_ASSERT(s.count(42) == 0);
48  s.insert(42);
49  CPPUNIT_ASSERT(s.count(42) == 1);
50  s.insert(42);
51  CPPUNIT_ASSERT(s.count(42) == 2);
52 
53  mset::iterator i = s.find(40);
54  CPPUNIT_ASSERT(i == s.end());
55 
56  i = s.find(42);
57  CPPUNIT_ASSERT(i != s.end());
58  size_t count = s.erase(42);
59  CPPUNIT_ASSERT(count == 2);
60 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
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
multiset< int, less< int > > mset
_Rep_type::iterator iterator
Definition: _set.h:244

◆ mset3()

void MultisetTest::mset3 ( )
protected

Definition at line 61 of file multiset_test.cpp.

62 {
63  int array [] = { 3, 6, 1, 2, 3, 2, 6, 7, 9 };
64 
65  //Check iterator on a mutable set
66  mset s(array, array + 9);
68  i = s.lower_bound(3);
69  CPPUNIT_ASSERT(*i == 3);
70  i = s.upper_bound(3);
71  CPPUNIT_ASSERT(*i == 6);
72  pair<mset::iterator, mset::iterator> p = s.equal_range(5);
73  CPPUNIT_ASSERT(*(p.first) == 6);
74  CPPUNIT_ASSERT(*(p.second) == 6);
75 
76  //Check const_iterator on a mutable multiset
78  ci = s.lower_bound(3);
79  CPPUNIT_ASSERT(*ci == 3);
80  ci = s.upper_bound(3);
81  CPPUNIT_ASSERT(*ci == 6);
83 #ifdef _STLP_MEMBER_TEMPLATES
84  cp = s.equal_range(5);
85  CPPUNIT_ASSERT(*(cp.first) == 6);
86  CPPUNIT_ASSERT(*(cp.second) == 6);
87 #endif
88 
89  //Check const_iterator on a const multiset
90  mset const& crs = s;
91  ci = crs.lower_bound(3);
92  CPPUNIT_ASSERT(*ci == 3);
93  ci = crs.upper_bound(3);
94  CPPUNIT_ASSERT(*ci == 6);
95  cp = crs.equal_range(5);
96  CPPUNIT_ASSERT(*(cp.first) == 6);
97  CPPUNIT_ASSERT(*(cp.second) == 6);
98 }
_Rep_type::const_iterator const_iterator
Definition: _set.h:245
static const WCHAR crs[]
GLdouble s
Definition: gl.h:2039
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
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
multiset< int, less< int > > mset
Definition: _pair.h:47
POINT cp
Definition: magnifier.c:59
_Rep_type::iterator iterator
Definition: _set.h:244
GLfloat GLfloat p
Definition: glext.h:8902

◆ mset5()

void MultisetTest::mset5 ( )
protected

Definition at line 99 of file multiset_test.cpp.

100 {
101  int array [] = { 3, 6, 1, 9 };
102  int j;
103 
105  typedef multiset<int, fn_type, allocator<int> > fn_mset;
106 
107  fn_type f(less_than);
108  fn_mset s1(array+0, array + 4 , f );
109  fn_mset::const_iterator i = s1.begin();
110  for (j = 0; i != s1.end(); ++i, ++j) {
111  CPPUNIT_ASSERT(j != 0 || *i == 1);
112  CPPUNIT_ASSERT(j != 1 || *i == 3);
113  CPPUNIT_ASSERT(j != 2 || *i == 6);
114  CPPUNIT_ASSERT(j != 3 || *i == 9);
115  }
116 
117  fn_type g(greater_than);
118  fn_mset s2(array, array + 4, g);
119  i = s2.begin();
120  for (j = 0; i != s2.end(); ++i, ++j) {
121  CPPUNIT_ASSERT(j != 0 || *i == 9);
122  CPPUNIT_ASSERT(j != 1 || *i == 6);
123  CPPUNIT_ASSERT(j != 2 || *i == 3);
124  CPPUNIT_ASSERT(j != 3 || *i == 1);
125  }
126 
127 }
struct S2 s2
Definition: _set.h:216
static bool greater_than(int a_, int b_)
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 GLint GLint j
Definition: glfuncs.h:250
GLboolean GLboolean g
Definition: glext.h:6204
GLfloat f
Definition: glext.h:7540
struct S1 s1
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
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
#define f
Definition: ke_i.h:83
static bool less_than(int a_, int b_)

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