ReactOS 0.4.15-dev-8419-g7f0e8a3
SetIntersectionTest Class Reference
Inheritance diagram for SetIntersectionTest:
Collaboration diagram for SetIntersectionTest:

Protected Member Functions

void setintr0 ()
 
void setintr1 ()
 
void setintr2 ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (SetIntersectionTest)
 
 CPPUNIT_TEST (setintr0)
 
 CPPUNIT_TEST (setintr1)
 
 CPPUNIT_TEST (setintr2)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 18 of file setinter_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/3]

SetIntersectionTest::CPPUNIT_TEST ( setintr0  )
private

◆ CPPUNIT_TEST() [2/3]

SetIntersectionTest::CPPUNIT_TEST ( setintr1  )
private

◆ CPPUNIT_TEST() [3/3]

SetIntersectionTest::CPPUNIT_TEST ( setintr2  )
private

◆ CPPUNIT_TEST_SUITE()

SetIntersectionTest::CPPUNIT_TEST_SUITE ( SetIntersectionTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

SetIntersectionTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ setintr0()

void SetIntersectionTest::setintr0 ( )
protected

Definition at line 37 of file setinter_test.cpp.

38{
39 int v1[3] = { 13, 18, 23 };
40 int v2[4] = { 10, 13, 17, 23 };
41 int result[4] = { 0, 0, 0, 0 };
42
43 set_intersection((int*)v1, (int*)v1 + 3, (int*)v2, (int*)v2 + 4, (int*)result);
44
45 CPPUNIT_ASSERT(result[0]==13);
46 CPPUNIT_ASSERT(result[1]==23);
49}
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
Definition: _algo.c:1689
#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

◆ setintr1()

void SetIntersectionTest::setintr1 ( )
protected

Definition at line 51 of file setinter_test.cpp.

52{
53 vector <int> v1(10);
54 __iota(v1.begin(), v1.end(), 0);
55 vector <int> v2(10);
56 __iota(v2.begin(), v2.end(), 7);
57
58 vector<int> inter;
59 set_intersection(v1.begin(), v1.end(), v2.begin(), v2.end(), back_inserter(inter));
60 CPPUNIT_ASSERT( inter.size() == 3 );
61 CPPUNIT_ASSERT( inter[0] == 7 );
62 CPPUNIT_ASSERT( inter[1] == 8 );
63 CPPUNIT_ASSERT( inter[2] == 9 );
64}
back_insert_iterator< _Container > _STLP_CALL back_inserter(_Container &__x)
Definition: _iterator.h:187
void __iota(_It __first, _It __last, _Tp __val)
Definition: iota.h:8
size_type size() const
Definition: _vector.h:192

◆ setintr2()

void SetIntersectionTest::setintr2 ( )
protected

Definition at line 66 of file setinter_test.cpp.

67{
68 const char* word1 = "ABCDEFGHIJKLMNO";
69 const char* word2 = "LMNOPQRSTUVWXYZ";
70
71 string inter;
72 set_intersection(word1, word1 + ::strlen(word1), word2, word2 + ::strlen(word2),
73 back_inserter(inter), less<char>());
74 CPPUNIT_ASSERT( inter.size() == 4 );
75 CPPUNIT_ASSERT( inter[0] == 'L' );
76 CPPUNIT_ASSERT( inter[1] == 'M' );
77 CPPUNIT_ASSERT( inter[2] == 'N' );
78 CPPUNIT_ASSERT( inter[3] == 'O' );
79}
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: