sl@0
|
1 |
/***********************************************************************************
|
sl@0
|
2 |
test_assign_op.h
|
sl@0
|
3 |
|
sl@0
|
4 |
SUMMARY: Test functor template for assignment operators.
|
sl@0
|
5 |
|
sl@0
|
6 |
* Copyright (c) 1997
|
sl@0
|
7 |
* Mark of the Unicorn, Inc.
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Permission to use, copy, modify, distribute and sell this software
|
sl@0
|
10 |
* and its documentation for any purpose is hereby granted without fee,
|
sl@0
|
11 |
* provided that the above copyright notice appear in all copies and
|
sl@0
|
12 |
* that both that copyright notice and this permission notice appear
|
sl@0
|
13 |
* in supporting documentation. Mark of the Unicorn makes no
|
sl@0
|
14 |
* representations about the suitability of this software for any
|
sl@0
|
15 |
* purpose. It is provided "as is" without express or implied warranty.
|
sl@0
|
16 |
|
sl@0
|
17 |
***********************************************************************************/
|
sl@0
|
18 |
#ifndef test_assign_op_H_
|
sl@0
|
19 |
#define test_assign_op_H_
|
sl@0
|
20 |
|
sl@0
|
21 |
#include "Prefix.h"
|
sl@0
|
22 |
#ifdef EH_NEW_HEADERS
|
sl@0
|
23 |
# include <cassert>
|
sl@0
|
24 |
#else
|
sl@0
|
25 |
# include <assert.h>
|
sl@0
|
26 |
#endif
|
sl@0
|
27 |
#include "nc_alloc.h"
|
sl@0
|
28 |
|
sl@0
|
29 |
template <class T>
|
sl@0
|
30 |
struct test_assign_op {
|
sl@0
|
31 |
test_assign_op( const T& src )
|
sl@0
|
32 |
: source(src) {
|
sl@0
|
33 |
gTestController.SetCurrentTestName("assignment operator");
|
sl@0
|
34 |
}
|
sl@0
|
35 |
|
sl@0
|
36 |
void operator()( T& t ) const {
|
sl@0
|
37 |
t = source;
|
sl@0
|
38 |
|
sl@0
|
39 |
// Prevent simulated failures during verification
|
sl@0
|
40 |
gTestController.CancelFailureCountdown();
|
sl@0
|
41 |
//EH_ASSERT( source == t );
|
sl@0
|
42 |
}
|
sl@0
|
43 |
private:
|
sl@0
|
44 |
const T& source;
|
sl@0
|
45 |
};
|
sl@0
|
46 |
|
sl@0
|
47 |
#endif // test_assign_op_H_
|