test_push_front.h

00001 /***********************************************************************************
00002         test_push_front.h
00003         
00004  * Copyright (c) 1997
00005  * Mark of the Unicorn, Inc.
00006  *
00007  * Permission to use, copy, modify, distribute and sell this software
00008  * and its documentation for any purpose is hereby granted without fee,
00009  * provided that the above copyright notice appear in all copies and
00010  * that both that copyright notice and this permission notice appear
00011  * in supporting documentation.  Mark of the Unicorn makes no
00012  * representations about the suitability of this software for any
00013  * purpose.  It is provided "as is" without express or implied warranty.
00014                 
00015 ***********************************************************************************/
00016 #ifndef test_push_front_H_
00017 #define test_push_front_H_
00018 
00019 # if defined (EH_NEW_HEADERS)
00020 #  include <cassert>
00021 # else
00022 #  include <assert.h>
00023 # endif
00024 # include "Prefix.h"
00025 
00026 template <class C>
00027 struct test_push_front
00028 {
00029         test_push_front( const C& orig ) : original( orig ) {
00030             gTestController.SetCurrentTestName("push_front() method");
00031         }
00032         
00033         void operator()( C& c ) const
00034         {
00035       typedef typename C::value_type _value_type;
00036                 c.push_front( _value_type() );
00037                 EH_ASSERT( c.size() == original.size() + 1 );
00038                 typename C::const_iterator next = c.begin();
00039 
00040                 EH_ASSERT( EH_STD::equal( original.begin(), original.end(), ++next ) );
00041         }
00042 private:
00043         const C& original;
00044 };
00045 
00046 #endif // test_push_front_H_

Generated on Mon Jun 5 10:20:48 2006 for Intelligence.kdevelop by  doxygen 1.4.6