ReactOS 0.4.15-dev-7788-g1ad9096
test_insert_one< C > Struct Template Reference

#include <test_insert.h>

Collaboration diagram for test_insert_one< C >:

Public Member Functions

 test_insert_one (const C &orig, int pos=-1)
 
void operator() (C &c) const
 

Private Attributes

C::value_type fInsVal
 
const Coriginal
 
size_t fPos
 

Detailed Description

template<class C>
struct test_insert_one< C >

Definition at line 328 of file test_insert.h.

Constructor & Destructor Documentation

◆ test_insert_one()

template<class C >
test_insert_one< C >::test_insert_one ( const C orig,
int  pos = -1 
)
inline

Definition at line 330 of file test_insert.h.

331 : original( orig ), fPos( random_number( orig.size() ))
332 {
334 if ( pos != -1 )
335 {
336 fPos = size_t(pos);
337 if ( pos == 0 )
338 gTestController.SetCurrentTestName("single insertion at begin()");
339 else
340 gTestController.SetCurrentTestName("single insertion at end()");
341 }
342 else
343 gTestController.SetCurrentTestName("single insertion at random position");
344 }
__kernel_size_t size_t
Definition: linux.h:237
TestController gTestController
Definition: nc_alloc.cpp:46
unsigned random_number(size_t range)
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
const C & original
Definition: test_insert.h:360
C::value_type fInsVal
Definition: test_insert.h:359
void MakeRandomValue(bool &b)
Definition: test_insert.h:322

Member Function Documentation

◆ operator()()

template<class C >
void test_insert_one< C >::operator() ( C c) const
inline

Definition at line 346 of file test_insert.h.

347 {
348 prepare_insert_n( c, (size_t)1 );
349 typename C::iterator pos = c.begin();
350 EH_STD::advance( pos, size_t(fPos) );
351 c.insert( pos, fInsVal );
352
353 // Prevent simulated failures during verification
355 // Success. Check results.
357 }
const GLubyte * c
Definition: glext.h:8905
static void CancelFailureCountdown()
Definition: nc_alloc.h:143
void VerifyInsertion(const C &original, const C &result, const SrcIter &firstNew, const SrcIter &lastNew, size_t, associative_container_tag)
Definition: test_insert.h:165
void prepare_insert_n(C &, size_t)
Definition: test_insert.h:318

Member Data Documentation

◆ fInsVal

template<class C >
C::value_type test_insert_one< C >::fInsVal
private

◆ fPos

template<class C >
size_t test_insert_one< C >::fPos
private

◆ original

template<class C >
const C& test_insert_one< C >::original
private

Definition at line 360 of file test_insert.h.

Referenced by test_insert_one< C >::operator()().


The documentation for this struct was generated from the following file: