ReactOS 0.4.15-dev-7131-ge4d03f4
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 

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 }
__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:397
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

Member Function Documentation

◆ operator()()

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

Definition at line 383 of file test_insert.h.

384 {
386 typename C::iterator pos = c.begin();
387 EH_STD::advance( pos, fPos );
388 c.insert( pos, fInsCnt, fInsVal );
390 // Prevent simulated failures during verification
392 // Success. Check results.
394 }
const GLubyte * c
Definition: glext.h:8905
static void CancelFailureCountdown()
Definition: nc_alloc.h:143
void VerifyInsertN(const C &original, const C &result, size_t insCnt, const Value &val, size_t insPos)
Definition: test_insert.h:293
void prepare_insert_n(C &, size_t)
Definition: test_insert.h:318

Member Data Documentation

◆ fInsCnt

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

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

◆ fPos

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

◆ original

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

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: