ReactOS  0.4.13-dev-259-g5ca9c9c
test_push_back.h
Go to the documentation of this file.
1 /***********************************************************************************
2  test_push_back.h
3 
4  Interface for the test_push_back class
5 
6  * Copyright (c) 1997
7  * Mark of the Unicorn, Inc.
8  *
9  * Permission to use, copy, modify, distribute and sell this software
10  * and its documentation for any purpose is hereby granted without fee,
11  * provided that the above copyright notice appear in all copies and
12  * that both that copyright notice and this permission notice appear
13  * in supporting documentation. Mark of the Unicorn makes no
14  * representations about the suitability of this software for any
15  * purpose. It is provided "as is" without express or implied warranty.
16 
17 ***********************************************************************************/
18 #ifndef test_push_back_H_
19 #define test_push_back_H_
20 # ifdef EH_NEW_HEADERS
21 # include <cassert>
22 # else
23 # include <assert.h>
24 # endif
25 
26 # include "Prefix.h"
27 #include "nc_alloc.h"
28 
29 template <class C>
31 {
32  test_push_back( const C& orig ) : original( orig )
33  {
34  gTestController.SetCurrentTestName("push_back() method");
35  }
36 
37  void operator()( C& c ) const
38  {
39  typedef typename C::value_type _value_type;
40  c.push_back(_value_type() );
41  // Prevent simulated failures during verification
43  EH_ASSERT( c.size() == original.size() + 1 );
44  EH_ASSERT( EH_STD::equal( original.begin(), original.end(), c.begin() ) );
45  }
46 private:
47  const C& original;
48 };
49 
50 #endif // test_push_back_H_
test_push_back(const C &orig)
TestController gTestController
Definition: nc_alloc.cpp:46
#define equal(x, y)
Definition: reader.cc:56
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
const GLubyte * c
Definition: glext.h:8905
#define EH_ASSERT
Definition: Prefix.h:37
void operator()(C &c) const
const C & original
Definition: ttei6.cpp:27
static void CancelFailureCountdown()
Definition: nc_alloc.h:143