ReactOS 0.4.15-dev-7958-gcd0bb1a
test_rope.cpp File Reference
#include "Prefix.h"
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include <rope>
Include dependency graph for test_rope.cpp:

Go to the source code of this file.

Macros

#define __STD_STUFF   1
 

Typedefs

typedef STLPORT::rope< char, eh_allocator(char) > TestRope
 

Functions

sequence_container_tag container_category (const TestRope &)
 
void test_rope ()
 

Macro Definition Documentation

◆ __STD_STUFF

#define __STD_STUFF   1

Definition at line 33 of file test_rope.cpp.

Typedef Documentation

◆ TestRope

typedef STLPORT::rope<char, eh_allocator(char) > TestRope

Definition at line 41 of file test_rope.cpp.

Function Documentation

◆ container_category()

sequence_container_tag container_category ( const TestRope )
inline

Definition at line 44 of file test_rope.cpp.

◆ test_rope()

void test_rope ( )

Definition at line 49 of file test_rope.cpp.

50{
51 TestRope testRope, testRope2;
52 size_t ropeSize = random_number(random_base);
53
54 while ( testRope.size() < ropeSize )
55 {
56 TestRope::value_type x = TestRope::value_type(random_number(random_base)); // initialize before use
57 testRope.push_back( x );
58 testRope2.push_back( TestRope::value_type() );
59 }
60 WeakCheck( testRope, test_insert_one<TestRope>(testRope) );
61 WeakCheck( testRope, test_insert_one<TestRope>(testRope, 0) );
62 WeakCheck( testRope, test_insert_one<TestRope>(testRope, (int)testRope.size()) );
63
66 WeakCheck( testRope, test_insert_n<TestRope>(testRope, random_number(random_base), (int)testRope.size() ) );
67
68 size_t insCnt = random_number(random_base);
69 TestRope::value_type *insFirst = new TestRope::value_type[1+insCnt];
70
71 WeakCheck( testRope, insert_range_tester(testRope, insFirst, insFirst+insCnt) );
72 WeakCheck( testRope, insert_range_at_begin_tester(testRope, insFirst, insFirst+insCnt) );
73 WeakCheck( testRope, insert_range_at_end_tester(testRope, insFirst, insFirst+insCnt) );
74
75 ConstCheck( 0, test_construct_pointer_range<TestRope>(insFirst, insFirst+insCnt) );
76 delete[] insFirst;
77
78 WeakCheck( testRope, insert_range_tester(testRope, testRope2.begin(), testRope2.end() ) );
79
80 WeakCheck( testRope, test_push_front<TestRope>(testRope) );
81 WeakCheck( testRope, test_push_back<TestRope>(testRope) );
82
84
85// dwa 1/25/00 - not actually valid for rope, because it doesn't
86// have the constructor in question! The code will compile, but with the
87// wrong result (the constructor that gets used does something different).
88
89// ConstCheck( 0, test_construct_n<TestRope>( random_number(random_base) ) );
90
94
95 WeakCheck( testRope, test_assign_op<TestRope>( testRope2 ) );
96}
void ConstCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:103
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
test_insert_range< C, Iter > insert_range_tester(const C &orig, const Iter &first, const Iter &last)
Definition: test_insert.h:535
test_insert_range< C, Iter > insert_range_at_begin_tester(const C &orig, const Iter &first, const Iter &last)
Definition: test_insert.h:541
test_insert_range< C, Iter > insert_range_at_end_tester(const C &orig, const Iter &first, const Iter &last)
Definition: test_insert.h:547
STLPORT::rope< char, eh_allocator(char) > TestRope
Definition: test_rope.cpp:41

Referenced by main().