ReactOS 0.4.16-dev-340-g0540c21
GeneratorTest Class Reference
Inheritance diagram for GeneratorTest:
Collaboration diagram for GeneratorTest:

Protected Member Functions

void gener1 ()
 
void gener2 ()
 
void genern1 ()
 
void genern2 ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (GeneratorTest)
 
 CPPUNIT_TEST (gener1)
 
 CPPUNIT_TEST (gener2)
 
 CPPUNIT_TEST (genern1)
 
 CPPUNIT_TEST (genern2)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 15 of file generator_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/4]

GeneratorTest::CPPUNIT_TEST ( gener1  )
private

◆ CPPUNIT_TEST() [2/4]

GeneratorTest::CPPUNIT_TEST ( gener2  )
private

◆ CPPUNIT_TEST() [3/4]

GeneratorTest::CPPUNIT_TEST ( genern1  )
private

◆ CPPUNIT_TEST() [4/4]

GeneratorTest::CPPUNIT_TEST ( genern2  )
private

◆ CPPUNIT_TEST_SUITE()

GeneratorTest::CPPUNIT_TEST_SUITE ( GeneratorTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

GeneratorTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ gener1()

void GeneratorTest::gener1 ( )
protected

Definition at line 39 of file generator_test.cpp.

40{
41 int numbers[10];
42#if defined(__MVS__)
43 generate(numbers, numbers + 10, ptr_gen(cxxrand));
44#else
45 generate(numbers, numbers + 10, cxxrand);
46#endif
47 // any suggestions?
48}
pointer_to_void_function< Result > ptr_gen(Result(*x)())
Definition: fadapter.h:39
static int cxxrand()
static int generate
Definition: xmllint.c:164

◆ gener2()

void GeneratorTest::gener2 ( )
protected

Definition at line 49 of file generator_test.cpp.

50{
51 vector <int> v1(10);
52 Fibonacci generator;
53 generate(v1.begin(), v1.end(), generator);
54
55 CPPUNIT_ASSERT(v1[0]==1);
56 CPPUNIT_ASSERT(v1[1]==1);
57 CPPUNIT_ASSERT(v1[2]==2);
58 CPPUNIT_ASSERT(v1[3]==3);
59 CPPUNIT_ASSERT(v1[4]==5);
60 CPPUNIT_ASSERT(v1[5]==8);
61 CPPUNIT_ASSERT(v1[6]==13);
62 CPPUNIT_ASSERT(v1[7]==21);
63 CPPUNIT_ASSERT(v1[8]==34);
64 CPPUNIT_ASSERT(v1[9]==55);
65}
Definition: fib.h:4
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLfloat GLfloat v1
Definition: glext.h:6062

◆ genern1()

void GeneratorTest::genern1 ( )
protected

Definition at line 66 of file generator_test.cpp.

67{
68#if !defined (_STLP_MEMBER_POINTER_PARAM_BUG)
69 //*TY 07/18/98 - added conditional
70 // since ptr_gen() is not defined under this condition
71 // (see xfunction.h)
72 vector <int> v1(10);
73 generate_n(v1.begin(), v1.size(), ptr_gen(cxxrand));
74#endif //_STLP_MEMBER_POINTER_PARAM_BUG //*TY 07/18/98 - added
75}
_STLP_INLINE_LOOP void generate_n(_OutputIter __first, _Size __n, _Generator __gen)
Definition: _algo.h:230

◆ genern2()

void GeneratorTest::genern2 ( )
protected

Definition at line 76 of file generator_test.cpp.

77{
78 vector <int> v1(10);
79 Fibonacci generator;
80 generate_n(v1.begin(), v1.size(), generator);
81
82 CPPUNIT_ASSERT(v1[0]==1);
83 CPPUNIT_ASSERT(v1[1]==1);
84 CPPUNIT_ASSERT(v1[2]==2);
85 CPPUNIT_ASSERT(v1[3]==3);
86 CPPUNIT_ASSERT(v1[4]==5);
87 CPPUNIT_ASSERT(v1[5]==8);
88 CPPUNIT_ASSERT(v1[6]==13);
89 CPPUNIT_ASSERT(v1[7]==21);
90 CPPUNIT_ASSERT(v1[8]==34);
91 CPPUNIT_ASSERT(v1[9]==55);
92}

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