ReactOS 0.4.15-dev-8219-ge8b88cf
SetUnionTest Class Reference
Inheritance diagram for SetUnionTest:
Collaboration diagram for SetUnionTest:

Protected Member Functions

void setunon0 ()
 
void setunon1 ()
 
void setunon2 ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (SetUnionTest)
 
 CPPUNIT_TEST (setunon0)
 
 CPPUNIT_TEST (setunon1)
 
 CPPUNIT_TEST (setunon2)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 18 of file setunion_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/3]

SetUnionTest::CPPUNIT_TEST ( setunon0  )
private

◆ CPPUNIT_TEST() [2/3]

SetUnionTest::CPPUNIT_TEST ( setunon1  )
private

◆ CPPUNIT_TEST() [3/3]

SetUnionTest::CPPUNIT_TEST ( setunon2  )
private

◆ CPPUNIT_TEST_SUITE()

SetUnionTest::CPPUNIT_TEST_SUITE ( SetUnionTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

SetUnionTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ setunon0()

void SetUnionTest::setunon0 ( )
protected

Definition at line 37 of file setunion_test.cpp.

38{
39 int v1[3] = { 13, 18, 23 };
40 int v2[4] = { 10, 13, 17, 23 };
41 int result[7] = { 0, 0, 0, 0, 0, 0, 0 };
42
43 set_union((int*)v1, (int*)v1 + 3, (int*)v2, (int*)v2 + 4, (int*)result);
44
45 CPPUNIT_ASSERT(result[0]==10);
46 CPPUNIT_ASSERT(result[1]==13);
47 CPPUNIT_ASSERT(result[2]==17);
48 CPPUNIT_ASSERT(result[3]==18);
49 CPPUNIT_ASSERT(result[4]==23);
52}
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
Definition: _algo.c:1646
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLfloat GLfloat v1
Definition: glext.h:6062
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
GLuint64EXT * result
Definition: glext.h:11304

◆ setunon1()

void SetUnionTest::setunon1 ( )
protected

Definition at line 54 of file setunion_test.cpp.

55{
56 vector <int> v1(10);
57 __iota(v1.begin(), v1.end(), 0);
58 vector <int> v2(10);
59 __iota(v2.begin(), v2.end(), 7);
60
61 vector<int> diff;
62 set_union(v1.begin(), v1.end(), v2.begin(), v2.end(), back_inserter(diff));
63 CPPUNIT_ASSERT( diff.size() == 17 );
64 for (int i = 0; i < 17; ++i) {
65 CPPUNIT_ASSERT( diff[i] == i );
66 }
67}
back_insert_iterator< _Container > _STLP_CALL back_inserter(_Container &__x)
Definition: _iterator.h:187
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
size_type size() const
Definition: _vector.h:192

◆ setunon2()

void SetUnionTest::setunon2 ( )
protected

Definition at line 69 of file setunion_test.cpp.

70{
71 const char* word1 = "ABCDEFGHIJKLMNO";
72 const char* word2 = "LMNOPQRSTUVWXYZ";
73
74 string diff;
75 set_union(word1, word1 + ::strlen(word1), word2, word2 + ::strlen(word2),
76 back_inserter(diff), less<char>());
77 CPPUNIT_ASSERT( diff.size() == 26 );
78 for (int i = 0; i < 26; ++i) {
79 CPPUNIT_ASSERT( diff[i] == ('A' + i) );
80 }
81}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
size_type size() const
Definition: _string.h:400

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