os/ossrv/genericopenlibs/cppstdlib/stl/test/eh/test_assign_op.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/test/eh/test_assign_op.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,47 @@
     1.4 +/***********************************************************************************
     1.5 +  test_assign_op.h
     1.6 +
     1.7 +    SUMMARY: Test functor template for assignment operators.
     1.8 +
     1.9 + * Copyright (c) 1997
    1.10 + * Mark of the Unicorn, Inc.
    1.11 + *
    1.12 + * Permission to use, copy, modify, distribute and sell this software
    1.13 + * and its documentation for any purpose is hereby granted without fee,
    1.14 + * provided that the above copyright notice appear in all copies and
    1.15 + * that both that copyright notice and this permission notice appear
    1.16 + * in supporting documentation.  Mark of the Unicorn makes no
    1.17 + * representations about the suitability of this software for any
    1.18 + * purpose.  It is provided "as is" without express or implied warranty.
    1.19 +
    1.20 +***********************************************************************************/
    1.21 +#ifndef test_assign_op_H_
    1.22 +#define test_assign_op_H_
    1.23 +
    1.24 +#include "Prefix.h"
    1.25 +#ifdef EH_NEW_HEADERS
    1.26 +#  include <cassert>
    1.27 +#else
    1.28 +#  include <assert.h>
    1.29 +#endif
    1.30 +#include "nc_alloc.h"
    1.31 +
    1.32 +template <class T>
    1.33 +struct test_assign_op {
    1.34 +  test_assign_op( const T& src )
    1.35 +    : source(src) {
    1.36 +    gTestController.SetCurrentTestName("assignment operator");
    1.37 +  }
    1.38 +
    1.39 +  void operator()( T& t ) const {
    1.40 +    t = source;
    1.41 +
    1.42 +    // Prevent simulated failures during verification
    1.43 +    gTestController.CancelFailureCountdown();
    1.44 +    //EH_ASSERT( source == t );
    1.45 +  }
    1.46 +private:
    1.47 +  const T& source;
    1.48 +};
    1.49 +
    1.50 +#endif // test_assign_op_H_