ReactOS  0.4.14-dev-52-g6116262
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  }
TestController gTestController
Definition: nc_alloc.cpp:46
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
const C & original
Definition: test_insert.h:360
__kernel_size_t size_t
Definition: linux.h:237
unsigned random_number(size_t range)
void MakeRandomValue(bool &b)
Definition: test_insert.h:322
C::value_type fInsVal
Definition: test_insert.h:359

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  }
TestController gTestController
Definition: nc_alloc.cpp:46
void VerifyInsertion(const C &original, const C &result, const SrcIter &firstNew, const SrcIter &lastNew, size_t, associative_container_tag)
Definition: test_insert.h:165
const C & original
Definition: test_insert.h:360
const GLubyte * c
Definition: glext.h:8905
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
void prepare_insert_n(C &, size_t)
Definition: test_insert.h:318
static void CancelFailureCountdown()
Definition: nc_alloc.h:143
C::value_type fInsVal
Definition: test_insert.h:359

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: