ReactOS  0.4.13-dev-66-gc714b7f
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 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
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
void ConstCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:103
unsigned random_base
unsigned random_number(size_t range)
void StrongCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:145

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 }
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
test_insert_range< C, Iter > insert_range_tester(const C &orig, const Iter &first, const Iter &last)
Definition: test_insert.h:535
EH_STD::__hash_set__< TestClass, ThrowHash, ThrowEqual, eh_allocator(TestClass) > TestSet
void ConstCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:103
unsigned random_base
static void testSet(void)
Definition: env.c:170
unsigned random_number(size_t range)
void StrongCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:145

Referenced by main().