ReactOS 0.4.15-dev-7788-g1ad9096
test_push_front.h
Go to the documentation of this file.
1/***********************************************************************************
2 test_push_front.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_push_front_H_
17#define test_push_front_H_
18
19# if defined (EH_NEW_HEADERS)
20# include <cassert>
21# else
22# include <assert.h>
23# endif
24# include "Prefix.h"
25
26template <class C>
28{
29 test_push_front( const C& orig ) : original( orig ) {
30 gTestController.SetCurrentTestName("push_front() method");
31 }
32
33 void operator()( C& c ) const
34 {
35 typedef typename C::value_type _value_type;
36 c.push_front( _value_type() );
37 EH_ASSERT( c.size() == original.size() + 1 );
38 typename C::const_iterator next = c.begin();
39
40 EH_ASSERT( EH_STD::equal( original.begin(), original.end(), ++next ) );
41 }
42private:
43 const C& original;
44};
45
46#endif // test_push_front_H_
#define EH_ASSERT
Definition: Prefix.h:37
Definition: terminate.cpp:24
const GLubyte * c
Definition: glext.h:8905
TestController gTestController
Definition: nc_alloc.cpp:46
static unsigned __int64 next
Definition: rand_nt.c:6
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
test_push_front(const C &orig)
void operator()(C &c) const
const C & original