Update contrib.
1 /***********************************************************************************
5 * Mark of the Unicorn, Inc.
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.
15 ***********************************************************************************/
16 #ifndef test_construct_H_
17 #define test_construct_H_
20 #if defined (EH_NEW_HEADERS)
30 USING_CSTD_NAME(size_t)
33 struct test_copy_construct {
34 test_copy_construct() {
35 gTestController.SetCurrentTestName("copy constructor");
38 void operator()( const T& t ) const {
40 // Prevent simulated failures during verification
41 gTestController.CancelFailureCountdown();
42 //EH_ASSERT( aCopy == t );
48 struct test_default_construct {
49 test_default_construct() {
50 gTestController.SetCurrentTestName("default constructor");
53 void operator()( int ) const {
60 struct test_construct_n {
61 test_construct_n( size_t _n ) : n(_n+1) {
62 gTestController.SetCurrentTestName("n-size constructor");
65 void operator()( int ) const {
74 struct test_construct_n_instance {
75 test_construct_n_instance( size_t _n ) : n(_n+1) {
76 gTestController.SetCurrentTestName("n-size with instance constructor");
79 void operator()( int ) const {
80 typedef typename T::value_type Value_type;
90 struct test_construct_pointer_range {
91 test_construct_pointer_range( const typename T::value_type *first,
92 const typename T::value_type* last )
93 : fItems( first ), fEnd( last ) {
94 gTestController.SetCurrentTestName("pointer range constructor");
97 void operator()( int ) const {
99 // Prevent simulated failures during verification
100 gTestController.CancelFailureCountdown();
104 const typename T::value_type* fItems, *fEnd;
108 struct test_construct_iter_range {
110 test_construct_iter_range( const T& src ) : fItems( src ) {
111 gTestController.SetCurrentTestName("iterator range constructor");
114 void operator()( int ) const {
115 T t( fItems.begin(), fItems.end() );
116 // Prevent simulated failures during verification
117 gTestController.CancelFailureCountdown();
118 EH_ASSERT( t == fItems );
125 #endif // test_construct_H_