ReactOS  0.4.14-dev-115-g4576127
test_insert_n< C > Struct Template Reference

#include <test_insert.h>

Collaboration diagram for test_insert_n< C >:

Public Member Functions

 test_insert_n (const C &orig, size_t insCnt, int pos=-1)
 
void operator() (C &c) const
 

Private Attributes

C::value_type fInsVal
 
const Coriginal
 
size_t fPos
 
size_t fInsCnt
 

Detailed Description

template<class C>
struct test_insert_n< C >

Definition at line 365 of file test_insert.h.

Constructor & Destructor Documentation

◆ test_insert_n()

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

Definition at line 367 of file test_insert.h.

368  : original( orig ), fPos( random_number( orig.size() )), fInsCnt(insCnt)
369  {
371  if (pos!=-1)
372  {
373  fPos=size_t(pos);
374  if (pos==0)
375  gTestController.SetCurrentTestName("n-ary insertion at begin()");
376  else
377  gTestController.SetCurrentTestName("n-ary insertion at end()");
378  }
379  else
380  gTestController.SetCurrentTestName("n-ary insertion at random position");
381  }
TestController gTestController
Definition: nc_alloc.cpp:46
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
__kernel_size_t size_t
Definition: linux.h:237
unsigned random_number(size_t range)
C::value_type fInsVal
Definition: test_insert.h:396
size_t fInsCnt
Definition: test_insert.h:399
void MakeRandomValue(bool &b)
Definition: test_insert.h:322
const C & original
Definition: test_insert.h:397

Member Function Documentation

◆ operator()()

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

Definition at line 383 of file test_insert.h.

384  {
386  typename C::iterator pos = c.begin();
388  c.insert( pos, fInsCnt, fInsVal );
389 
390  // Prevent simulated failures during verification
392  // Success. Check results.
394  }
TestController gTestController
Definition: nc_alloc.cpp:46
void VerifyInsertN(const C &original, const C &result, size_t insCnt, const Value &val, size_t insPos)
Definition: test_insert.h:293
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
C::value_type fInsVal
Definition: test_insert.h:396
size_t fInsCnt
Definition: test_insert.h:399
static void CancelFailureCountdown()
Definition: nc_alloc.h:143
const C & original
Definition: test_insert.h:397

Member Data Documentation

◆ fInsCnt

template<class C >
size_t test_insert_n< C >::fInsCnt
private

Definition at line 399 of file test_insert.h.

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

◆ fInsVal

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

◆ fPos

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

◆ original

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

Definition at line 397 of file test_insert.h.

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


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