ReactOS 0.4.15-dev-7942-gd23573b
RndShuffleTest Class Reference
Inheritance diagram for RndShuffleTest:
Collaboration diagram for RndShuffleTest:

Classes

class  MyRandomGenerator
 

Protected Member Functions

void rndshuf0 ()
 
void rndshuf2 ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (RndShuffleTest)
 
 CPPUNIT_TEST (rndshuf0)
 
 CPPUNIT_TEST (rndshuf2)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 15 of file rndshf_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/2]

RndShuffleTest::CPPUNIT_TEST ( rndshuf0  )
private

◆ CPPUNIT_TEST() [2/2]

RndShuffleTest::CPPUNIT_TEST ( rndshuf2  )
private

◆ CPPUNIT_TEST_SUITE()

RndShuffleTest::CPPUNIT_TEST_SUITE ( RndShuffleTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

RndShuffleTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ rndshuf0()

void RndShuffleTest::rndshuf0 ( )
protected

Definition at line 40 of file rndshf_test.cpp.

41{
42 int numbers[6] = { 1, 2, 3, 4, 5, 6 };
43
44 random_shuffle(numbers, numbers + 6);
45
46 CPPUNIT_ASSERT(count(numbers, numbers+6, 1)==1);
47 CPPUNIT_ASSERT(count(numbers, numbers+6, 2)==1);
48 CPPUNIT_ASSERT(count(numbers, numbers+6, 3)==1);
49 CPPUNIT_ASSERT(count(numbers, numbers+6, 4)==1);
50 CPPUNIT_ASSERT(count(numbers, numbers+6, 5)==1);
51 CPPUNIT_ASSERT(count(numbers, numbers+6, 6)==1);
52}
_STLP_MOVE_TO_STD_NAMESPACE void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:540
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ rndshuf2()

void RndShuffleTest::rndshuf2 ( )
protected

Definition at line 53 of file rndshf_test.cpp.

54{
55 vector <int> v1(10);
56 __iota(v1.begin(), v1.end(), 0);
57
58 MyRandomGenerator r;
59 for(int i = 0; i < 3; i++)
60 {
61 random_shuffle(v1.begin(), v1.end(), r);
62 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 0)==1);
63 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 1)==1);
64 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 2)==1);
65 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 3)==1);
66 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 4)==1);
67 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 5)==1);
68 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 6)==1);
69 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 7)==1);
70 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 8)==1);
71 CPPUNIT_ASSERT(count(v1.begin(), v1.end(), 9)==1);
72 }
73}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLfloat GLfloat v1
Definition: glext.h:6062
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
void __iota(_It __first, _It __last, _Tp __val)
Definition: iota.h:8

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