ReactOS 0.4.15-dev-5893-g1bb4167
test_set.cpp File Reference
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
#include <set>
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include "ThrowCompare.h"
Include dependency graph for test_set.cpp:

Go to the source code of this file.

Typedefs

typedef EH_STD::__multiset__< TestClass, ThrowCompare, eh_allocator(TestClass) > TestMultiSet
 
typedef EH_STD::__set__< TestClass, ThrowCompare, eh_allocator(TestClass) > TestSet
 

Functions

void test_multiset ()
 
multiset_tag container_category (const TestMultiSet &)
 
set_tag container_category (const TestSet &)
 
void test_set ()
 

Typedef Documentation

◆ TestMultiSet

◆ TestSet

Function Documentation

◆ container_category() [1/2]

multiset_tag container_category ( const TestMultiSet )
inline

Definition at line 37 of file test_set.cpp.

37 {
38 return multiset_tag();
39}

◆ container_category() [2/2]

set_tag container_category ( const TestSet )
inline

Definition at line 71 of file test_set.cpp.

71 {
72 return set_tag();
73}

◆ test_multiset()

void test_multiset ( )

Definition at line 41 of file test_set.cpp.

41 {
42 TestMultiSet testMultiSet, testMultiSet2;
43
44 const size_t setSize = random_number(random_base);
45
46 while (testMultiSet.size() < setSize) {
47 TestMultiSet::value_type x;
48 testMultiSet.insert( x );
49 testMultiSet2.insert( TestMultiSet::value_type() );
50 }
51
52 StrongCheck( testMultiSet, test_insert_value<TestMultiSet>(testMultiSet) );
53
54 size_t insCnt = random_number(random_base);
55 TestMultiSet::value_type *insFirst = new TestMultiSet::value_type[1+insCnt];
56 WeakCheck( testMultiSet, insert_range_tester(testMultiSet, insFirst, insFirst+insCnt) );
57 ConstCheck( 0, test_construct_pointer_range<TestMultiSet>(insFirst, insFirst+insCnt) );
58 delete[] insFirst;
59 WeakCheck( testMultiSet, insert_range_tester(testMultiSet, testMultiSet2.begin(), testMultiSet2.end() ) );
60
64
65 WeakCheck( testMultiSet, test_assign_op<TestMultiSet>( testMultiSet2 ) );
66}
void ConstCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:103
void StrongCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:145
void WeakCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:65
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
unsigned random_number(size_t range)
unsigned random_base
EH_STD::__hash_multiset__< TestClass, ThrowHash, ThrowEqual, eh_allocator(TestClass) > TestMultiSet
test_insert_range< C, Iter > insert_range_tester(const C &orig, const Iter &first, const Iter &last)
Definition: test_insert.h:535

Referenced by main().

◆ test_set()

void test_set ( )

Definition at line 75 of file test_set.cpp.

75 {
76 TestSet testSet, testSet2;
77
78 const size_t setSize = random_number(random_base);
79
80 while ( testSet.size() < setSize ) {
81 TestSet::value_type x;
82 testSet.insert( x );
83 testSet2.insert( TestSet::value_type() );
84 }
86
87 size_t insCnt = random_number(random_base);
88 TestSet::value_type *insFirst = new TestSet::value_type[1+insCnt];
89
90 WeakCheck( testSet, insert_range_tester(testSet, insFirst, insFirst+insCnt) );
91
92 ConstCheck( 0, test_construct_pointer_range<TestSet>(insFirst, insFirst+insCnt) );
93 delete[] insFirst;
94 WeakCheck( testSet, insert_range_tester(testSet, testSet2.begin(), testSet2.end() ) );
95
100}
static void testSet(void)
Definition: env.c:170
EH_STD::__hash_set__< TestClass, ThrowHash, ThrowEqual, eh_allocator(TestClass) > TestSet

Referenced by main().