ReactOS  0.4.14-dev-1314-gacf135d
CountTest Class Reference
Inheritance diagram for CountTest:
Collaboration diagram for CountTest:

Protected Member Functions

void count0 ()
 
void count1 ()
 
void countif1 ()
 

Static Protected Member Functions

static int odd (int a_)
 

Private Member Functions

 CPPUNIT_TEST_SUITE (CountTest)
 
 CPPUNIT_TEST (count0)
 
 CPPUNIT_TEST (count1)
 
 CPPUNIT_TEST (countif1)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 12 of file count_test.cpp.

Member Function Documentation

◆ count0()

void CountTest::count0 ( )
protected

Definition at line 32 of file count_test.cpp.

33 {
34  int numbers[10] = { 1, 2, 4, 1, 2, 4, 1, 2, 4, 1 };
35 
36  int result = count(numbers, numbers + 10, 1);
38 #if defined (STLPORT) && !defined (_STLP_NO_ANACHRONISMS)
39  result = 0;
40  count(numbers, numbers + 10, 1, result);
42 #endif
43 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint64EXT * result
Definition: glext.h:11304

◆ count1()

void CountTest::count1 ( )
protected

Definition at line 44 of file count_test.cpp.

45 {
46  vector <int> numbers(100);
47  for(int i = 0; i < 100; i++)
48  numbers[i] = i % 3;
49  int elements = count(numbers.begin(), numbers.end(), 2);
50  CPPUNIT_ASSERT(elements==33);
51 #if defined (STLPORT) && !defined (_STLP_NO_ANACHRONISMS)
52  elements = 0;
53  count(numbers.begin(), numbers.end(), 2, elements);
54  CPPUNIT_ASSERT(elements==33);
55 #endif
56 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
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 CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200

◆ countif1()

void CountTest::countif1 ( )
protected

Definition at line 57 of file count_test.cpp.

58 {
59  vector <int> numbers(100);
60  for(int i = 0; i < 100; i++)
61  numbers[i] = i % 3;
62  int elements = count_if(numbers.begin(), numbers.end(), odd);
63  CPPUNIT_ASSERT(elements==33);
64 #if defined (STLPORT) && !defined (_STLP_NO_ANACHRONISMS)
65  elements = 0;
66  count_if(numbers.begin(), numbers.end(), odd, elements);
67  CPPUNIT_ASSERT(elements==33);
68 #endif
69 }
_STLP_INLINE_LOOP void count_if(_InputIter __first, _InputIter __last, _Predicate __pred, _Size &__n)
Definition: _algo.h:115
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
static int odd(int a_)
Definition: count_test.cpp:70
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200

◆ CPPUNIT_TEST() [1/3]

CountTest::CPPUNIT_TEST ( count0  )
private

◆ CPPUNIT_TEST() [2/3]

CountTest::CPPUNIT_TEST ( count1  )
private

◆ CPPUNIT_TEST() [3/3]

CountTest::CPPUNIT_TEST ( countif1  )
private

◆ CPPUNIT_TEST_SUITE()

CountTest::CPPUNIT_TEST_SUITE ( CountTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

CountTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ odd()

int CountTest::odd ( int  a_)
staticprotected

Definition at line 70 of file count_test.cpp.

71 {
72  return a_ % 2;
73 }

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