ReactOS  0.4.14-dev-41-g31d7680
test_string.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 <string>
Include dependency graph for test_string.cpp:

Go to the source code of this file.

Typedefs

typedef EH_STD::basic_string< char, EH_STD::char_traits< char >, eh_allocator(char) > TestString
 

Functions

sequence_container_tag container_category (const TestString &)
 
void test_string ()
 

Typedef Documentation

◆ TestString

typedef EH_STD::basic_string<char, EH_STD::char_traits<char>, eh_allocator(char) > TestString

Definition at line 30 of file test_string.cpp.

Function Documentation

◆ container_category()

sequence_container_tag container_category ( const TestString )
inline

Definition at line 33 of file test_string.cpp.

34 {
35  return sequence_container_tag();
36 }

◆ test_string()

void test_string ( )

Definition at line 38 of file test_string.cpp.

38  {
39  TestString testString, testString2;
40  size_t ropeSize = random_number(random_base);
41 
42  while ( testString.size() < ropeSize ) {
43  TestString::value_type x = TestString::value_type(random_number(random_base)) ; // initialize before use
44  testString.append(1, x );
45  testString2.append(1, TestString::value_type() );
46  }
47  WeakCheck( testString, test_insert_one<TestString>(testString) );
48  WeakCheck( testString, test_insert_one<TestString>(testString, 0) );
49  WeakCheck( testString, test_insert_one<TestString>(testString, (int)testString.size()) );
50 
51  WeakCheck( testString, test_insert_n<TestString>(testString, random_number(random_base) ) );
52  WeakCheck( testString, test_insert_n<TestString>(testString, random_number(random_base), 0 ) );
53  WeakCheck( testString, test_insert_n<TestString>(testString, random_number(random_base), (int)testString.size() ) );
54 
55  size_t insCnt = random_number(random_base);
56  TestString::value_type *insFirst = new TestString::value_type[1+insCnt];
57 
58  WeakCheck( testString, insert_range_tester(testString, insFirst, insFirst+insCnt) );
59  WeakCheck( testString, insert_range_at_begin_tester(testString, insFirst, insFirst+insCnt) );
60  WeakCheck( testString, insert_range_at_end_tester(testString, insFirst, insFirst+insCnt) );
61 
62  ConstCheck( 0, test_construct_pointer_range<TestString>(insFirst, insFirst+insCnt) );
63  delete[] insFirst;
64 
65  WeakCheck( testString, insert_range_tester(testString, testString2.begin(), testString2.end() ) );
66  /*
67  WeakCheck( testString, test_push_front<TestString>(testString) );
68  WeakCheck( testString, test_push_back<TestString>(testString) );
69  */
71  // requires _Reserve_t ConstCheck( 0, test_construct_n<TestString>( random_number(random_base) ) );
75 
76  WeakCheck( testString, test_assign_op<TestString>( testString2 ) );
77 }
EH_STD::basic_string< char, EH_STD::char_traits< char >, eh_allocator(char) > TestString
Definition: test_string.cpp:30
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
test_insert_range< C, Iter > insert_range_at_end_tester(const C &orig, const Iter &first, const Iter &last)
Definition: test_insert.h:547
void ConstCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:103
unsigned random_base
test_insert_range< C, Iter > insert_range_at_begin_tester(const C &orig, const Iter &first, const Iter &last)
Definition: test_insert.h:541
unsigned random_number(size_t range)

Referenced by main(), test_callback(), test_convert(), test_EM_GETTEXTLENGTHEX(), test_propertytovariant(), test_readfileex_pending(), test_rsa_round_trip(), test_RtlUnicodeToUTF8N(), test_RtlUTF8ToUnicodeN(), and test_varianttoproperty().