test_push_back.h

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

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