ReactOS 0.4.15-dev-8434-g155a7c7
test_hash_resize.h
Go to the documentation of this file.
1/***********************************************************************************
2 test_hash_resize.h
3
4 * Copyright (c) 1997
5 * Mark of the Unicorn, Inc.
6 *
7 * Permission to use, copy, modify, distribute and sell this software
8 * and its documentation for any purpose is hereby granted without fee,
9 * provided that the above copyright notice appear in all copies and
10 * that both that copyright notice and this permission notice appear
11 * in supporting documentation. Mark of the Unicorn makes no
12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied warranty.
14
15***********************************************************************************/
16#ifndef test_hash_resize__
17#define test_hash_resize__
18
19#include "random_number.h"
20#include "nc_alloc.h"
21
22template <class T>
24{
26 {
28 }
29
30 void operator()( T& t ) const
31 {
32 t.resize( 1+random_number(random_base) + t.bucket_count() );
33 }
34};
35
36template <class T>
38{
40 : fItems( src )
41 {
42 gTestController.SetCurrentTestName("iterator range n-size constructor");
43 }
44
45 void operator()( int ) const
46 {
47 T t( fItems.begin(), fItems.end(), fItems.size() );
48 // prevent simulated failures during verification
51 }
52
53 const T& fItems;
54};
55
56#endif //__test_hash_resize__
EH_END_NAMESPACE void CheckInvariant(const C &)
Definition: LeakCheck.h:52
GLdouble GLdouble t
Definition: gl.h:2047
GLenum src
Definition: glext.h:6340
#define T
Definition: mbstring.h:31
TestController gTestController
Definition: nc_alloc.cpp:46
unsigned random_number(size_t range)
unsigned random_base
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
static void CancelFailureCountdown()
Definition: nc_alloc.h:143
test_construct_iter_range_n(const T &src)
void operator()(T &t) const