Copied: stdcxx/trunk/tests/regress/27.streambuf.buffer.stdcxx-808.cpp (from r678475, stdcxx/branches/4.3.x/tests/regress/27.streambuf.buffer.stdcxx-808.cpp)
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/regress/27.streambuf.buffer.stdcxx-808.cpp?p2=stdcxx/trunk/tests/regress/27.streambuf.buffer.stdcxx-808.cpp&p1=stdcxx/branches/4.3.x/tests/regress/27.streambuf.buffer.stdcxx-808.cpp&r1=678475&r2=681820&rev=681820&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/regress/27.streambuf.buffer.stdcxx-808.cpp (original)
+++ stdcxx/trunk/tests/regress/27.streambuf.buffer.stdcxx-808.cpp Fri Aug 1 13:51:17 2008
@@ -1,3 +1,32 @@
+/***********************************************************************
+ *
+ * 27.streambuf.buffer.stdcxx-808.cpp - regression test for STDCXX-808
+ *
+ * http://issues.apache.org/jira/browse/STDCXX-808
+ *
+ * $Id$
+ *
+ ***********************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 2008 Rogue Wave Software, Inc.
+ *
+ **********************************************************************/
#include <cassert>
#include <iosfwd>
Modified: stdcxx/trunk/tests/src/thread.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/thread.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/src/thread.cpp (original)
+++ stdcxx/trunk/tests/src/thread.cpp Fri Aug 1 13:51:17 2008
@@ -83,6 +83,14 @@
#if defined (_RWSTD_POSIX_THREADS)
+
+# ifdef _RWSTD_EDG_ECCP
+ // disable error #450-D: the type "long long" is nonstandard
+ // issued for uses of the type in Linux system headers (e.g.,
+ // pthreadtypes.h)
+# pragma diag_suppress 450
+# endif // vanilla EDG eccp demo
+
# include <pthread.h>
_TEST_EXPORT int
Modified: stdcxx/trunk/tests/strings/21.string.exceptions.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/strings/21.string.exceptions.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/strings/21.string.exceptions.cpp (original)
+++ stdcxx/trunk/tests/strings/21.string.exceptions.cpp Fri Aug 1 13:51:17 2008
@@ -308,8 +308,6 @@
static void
test_len_ctor ()
{
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
rw_info (0, __FILE__, __LINE__, "21.3.1, p15");
int thrown = 0;
@@ -326,8 +324,6 @@
rw_assert (1 == thrown, __FILE__, __LINE__,
"string::string (InputIterator, InputIterator)"
"failed to use __rw::__rw_throw()");
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
}
/**************************************************************************/
Modified: stdcxx/trunk/tests/utilities/20.auto.ptr.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.auto.ptr.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.auto.ptr.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.auto.ptr.cpp Fri Aug 1 13:51:17 2008
@@ -157,7 +157,7 @@
// exercise 20.4.5, p2 - auto_ptr<> interface
- typedef _TYPENAME std::auto_ptr<T>::element_type element_type;
+ typedef typename std::auto_ptr<T>::element_type element_type;
// verify that element_type is the same as T
element_type *elem = (T*)0;
@@ -192,13 +192,12 @@
FUN (T*, T, release, () _PTR_THROWS (()));
FUN (void, T, reset, (T*) _PTR_THROWS (()));
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-# if !defined(__GNUG__) || __GNUG__ > 3 || __GNUG__ == 3 && __GNUC_MINOR__ > 2
+#if !defined(__GNUG__) || __GNUG__ > 3 || __GNUG__ == 3 && __GNUC_MINOR__ > 2
// g++ 2.95.2 and HP aCC can't take the address of a template member
-# if !defined (__HP_aCC) || _RWSTD_HP_aCC_MAJOR > 5
+# if !defined (__HP_aCC) || _RWSTD_HP_aCC_MAJOR > 5
// SunPro incorrectly warns here (see PR #27276)
FUN (std::auto_ptr<Base>&, Base,
@@ -206,24 +205,22 @@
// SunPro 5.4 can't decide between a ctor template
// and a conversion operator (see PR #24476)
-# if !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x540
+# if !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x540
-# if !defined (_RWSTD_MSVC) || _RWSTD_MSVC > 1310
+# if !defined (_RWSTD_MSVC) || _RWSTD_MSVC > 1310
FUN (std::auto_ptr_ref<Base>, Derived,
operator std::auto_ptr_ref<Base>, () _PTR_THROWS (()));
FUN (std::auto_ptr<Base>, Derived,
operator std::auto_ptr<Base>, () _PTR_THROWS (()));
-# endif // MSVC > 7.1
+# endif // MSVC > 7.1
-# endif // SunPro > 5.4
+# endif // SunPro > 5.4
-# endif // HP aCC > 5
+# endif // HP aCC > 5
-# endif // gcc > 3.2
-
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
+#endif // gcc > 3.2
rw_info (0, 0, 0, "[lib.auto.ptr.cons]");
@@ -291,23 +288,19 @@
ap1 = ap1;
ap1.operator= (ap1);
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
-# if !defined (__HP_aCC) || 6 <= _RWSTD_HP_aCC_MAJOR
+#if !defined (__HP_aCC) || 6 <= _RWSTD_HP_aCC_MAJOR
// working around an HP aCC 3 and 5 bug (STDCXX-655)
ap1.operator=<void>(ap1);
-# endif // !HP aCC or HP aCC 6 and better
+#endif // !HP aCC or HP aCC 6 and better
std::auto_ptr<int> ap4;
ap1 = ap4;
ap1.operator= (ap4);
ap1.operator=<int>(ap4);
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
// operator*() cannot be instantiated
void* pv;
@@ -319,9 +312,7 @@
ap1.reset ();
ap1.reset (pv);
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
-# if !defined (__HP_aCC) || 6 <= _RWSTD_HP_aCC_MAJOR
+#if !defined (__HP_aCC) || 6 <= _RWSTD_HP_aCC_MAJOR
// working around an HP aCC 3 and 5 bug (STDCXX-656)
@@ -331,15 +322,11 @@
_RWSTD_UNUSED (ar);
_RWSTD_UNUSED (ap5);
-# endif // !HP aCC or HP aCC 6 and better
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
+#endif // !HP aCC or HP aCC 6 and better
}
/**************************************************************************/
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
// exercise 20.4.5.4
static std::auto_ptr<Derived>
test_auto_ptr_conversions ()
@@ -422,7 +409,6 @@
}
}
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
/**************************************************************************/
@@ -444,8 +430,6 @@
test_auto_ptr ((double*)0, "double");
test_auto_ptr ((void**)0, "void*");
-#ifndef _RWSTD_NO_MEMBER_TEMPLATES
-
int count = Base::cnt_;
// exercise 20.4.5.4
@@ -458,8 +442,6 @@
rw_assert (count == Base::cnt_, 0, __LINE__,
"autoptr leaked %d objects", Base::cnt_ - count);
-#endif // _RWSTD_NO_MEMBER_TEMPLATES
-
if (!rw_enabled ("void"))
rw_note (0, 0, 0, "auto_ptr<void> test disabled");
else
Modified: stdcxx/trunk/tests/utilities/20.forward.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.forward.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.forward.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.forward.cpp Fri Aug 1 13:51:17 2008
@@ -2,7 +2,7 @@
*
* 20.forward.cpp - tests exercising move/forward helpers
*
- * $Id$
+ * $Id: 20.forward.cpp 673865 2008-07-03 23:26:24Z vitek $
*
***************************************************************************
*
@@ -22,15 +22,20 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2008 Rogue Wave Software.
+ * Copyright 2008 Rogue Wave Software.
*
**************************************************************************/
+#include <rw_driver.h>
+#include <rw/_defs.h>
+
+// compile out all test code if extensions disabled
+#ifndef _RWSTD_NO_EXT_CXX_0X
+
#include <rw/_forward.h>
#include <rw/_meta_rel.h>
#include <rw/_static_assert.h>
-#include <rw_driver.h>
struct Foo
@@ -38,20 +43,19 @@
Foo (int& ) { }
};
-// compile tests
-
-typedef std::identity<Foo> FooIdent;
-typedef std::identity<Foo>::type FooIdentType;
-
-_RWSTD_STATIC_ASSERT ((_RW::__rw_is_same<Foo, FooIdentType>::value),
- "(is_same<Foo, FooIdentType>), got false, "
- "expected true");
static void
test_identity ()
{
rw_info (0, __FILE__, __LINE__, "std::identity<T> class template");
+ typedef std::identity<Foo> FooIdent;
+ typedef std::identity<Foo>::type FooIdentType;
+
+ _RWSTD_STATIC_ASSERT ((_RW::__rw_is_same<Foo, FooIdentType>::value),
+ "is_same<Foo, FooIdentType>::value is false, "
+ "expected true");
+
int i = 1;
FooIdent foo_ident;
Foo foo = foo_ident (i);
@@ -60,6 +64,8 @@
/**************************************************************************/
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
+
// using example from standard as a test case
template <class Type>
@@ -76,7 +82,9 @@
shared_ptr<Type> factory (AType&& at)
{
return shared_ptr<Type> (new Type (std::forward<AType> (at)));
-};
+}
+
+/**************************************************************************/
static void
test_forward ()
@@ -94,21 +102,23 @@
}
+#endif // _RWSTD_NO_RVALUE_REFERENCES
+
/**************************************************************************/
static int
run_test (int /*unused*/, char* /*unused*/ [])
{
+ test_identity ();
#if !defined _RWSTD_NO_RVALUE_REFERENCES
- test_identity ();
test_forward ();
test_move ();
#else // no rvalue references
- rw_info (true, __FILE__, __LINE__,
+ rw_warn (0, 0, __LINE__,
"No compiler support for rvalue references; tests disabled.");
#endif // !defined _RWSTD_NO_RVALUE_REFERENCES
@@ -116,6 +126,17 @@
return 0;
}
+#else // !_RWSTD_NO_EXT_CXX_0X
+
+static int run_test (int, char*[])
+{
+ rw_warn (0, 0, __LINE__,
+ "test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
+ return 0;
+}
+
+#endif // !_RWSTD_NO_EXT_CXX_0X
+
/*extern*/ int
main (int argc, char* argv [])
{
Modified: stdcxx/trunk/tests/utilities/20.function.objects.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.function.objects.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.function.objects.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.function.objects.cpp Fri Aug 1 13:51:17 2008
@@ -401,14 +401,10 @@
{
rw_info (0, 0, __LINE__, "[lib.negators]");
-#ifndef _RWSTD_NO_EXPLICIT
-
// verify that std::unary_negate<>() and std::binary_negate<>()
// ctors are declared explicit
is_explicit (std::logical_not<int>());
-#endif // _RWSTD_NO_EXPLICIT
-
// use std::negate<> as an argument in negator ctors
#undef CTOR_ARG_LIST
#define CTOR_ARG_LIST \
@@ -549,14 +545,10 @@
{
rw_info (0, 0, __LINE__, "[lib.function.pointer.adaptors]");
-#ifndef _RWSTD_NO_EXPLICIT
-
// verify that the pointer to function adapters' ctors are explicit
is_explicit ((int (*)(int))0);
is_explicit ((int (*)(int, int))0);
-#endif // _RWSTD_NO_EXPLICIT
-
// initialize pointer_to_unary_function with the address of square
#undef CTOR_ARG_LIST
#define CTOR_ARG_LIST (&::square)
@@ -641,16 +633,12 @@
{
rw_info (0, 0, __LINE__, "[lib.member.pointer.adaptors]");
-#ifndef _RWSTD_NO_EXPLICIT
-
// verify that the pointer to member adapters' ctors are explicit
is_explicit ((int (Integer::*)())0);
is_explicit ((int (Integer::*)(short))0);
is_explicit ((int (Integer::*)() const)0);
is_explicit ((int (Integer::*)(short) const)0);
-#endif // _RWSTD_NO_EXPLICIT
-
#undef CTOR_ARG_LIST
#define CTOR_ARG_LIST (&Integer::square)
Modified: stdcxx/trunk/tests/utilities/20.meta.help.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.help.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.help.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.help.cpp Fri Aug 1 13:51:17 2008
@@ -28,6 +28,7 @@
**************************************************************************/
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
@@ -107,7 +108,7 @@
// verify that the type typedef is correct
const bool e =
- test_is_same<_TYPENAME integral_constant_type::type,
+ test_is_same<typename integral_constant_type::type,
integral_constant_type>::value;
rw_assert (e, 0, __LINE__,
"integral_constant<%s, %s>::type is%{?}n't%{;} "
@@ -125,7 +126,7 @@
// verify the type of the type typedef
const bool a =
- test_is_same<_TYPENAME integral_constant_type::value_type, bool>::value;
+ test_is_same<typename integral_constant_type::value_type, bool>::value;
rw_assert (a, 0, __LINE__,
"%s::value_type is%{?}n't%{;} same as bool",
name, !a);
@@ -144,7 +145,7 @@
"%s is%{?}n't%{;} of type integral_constant<bool, %s>",
name, !c, value);
- test_integral_constant<_TYPENAME integral_constant_type::value_type,
+ test_integral_constant<typename integral_constant_type::value_type,
Value>("bool", value);
}
Modified: stdcxx/trunk/tests/utilities/20.meta.rel.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.rel.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.rel.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.rel.cpp Fri Aug 1 13:51:17 2008
@@ -30,6 +30,7 @@
#include <type_traits>
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
@@ -66,27 +67,27 @@
};
template <class T>
-struct derived_ : T
+struct derived_t : T
{
};
template <class T>
-struct derived_private_ : private T
+struct derived_private_t : private T
{
};
template <class T>
-struct derived_protected_ : protected T
+struct derived_protected_t : protected T
{
};
template <class T>
-struct derived_with_conversion_ : T
+struct derived_with_conversion_t : T
{
- derived_with_conversion_ (const T&);
+ derived_with_conversion_t (const T&);
};
-class incomplete_;
+class incomplete_t;
union union_C {
int i_; float f_;
@@ -107,8 +108,9 @@
}
#define TEST(Trait,TypeT,TypeU,Expect) \
- test_trait (__LINE__, Trait<TypeT,TypeU>::value, Expect, \
- #Trait, #TypeT, #TypeU)
+ { const bool value = Trait< TypeT, TypeU >::value; \
+ test_trait (__LINE__, value, Expect, #Trait, #TypeT, #TypeU); \
+ } typedef void __dummy
static void test_is_same ()
{
@@ -122,14 +124,16 @@
TEST (std::is_same, enum_A, enum_A, true);
TEST (std::is_same, enum_B, enum_B, true);
-
+
TEST (std::is_same, struct_A, struct_A, true);
- TEST (std::is_same, derived_<struct_A>,
- derived_<struct_A>, true);
+
+ typedef derived_t<struct_A> derived_A;
+ TEST (std::is_same, derived_A, derived_A, true);
TEST (std::is_same, class_B, class_B, true);
- TEST (std::is_same, derived_<class_B>,
- derived_<class_B>, true);
+
+ typedef derived_t<class_B> derived_B;
+ TEST (std::is_same, derived_B, derived_B, true);
// other combinations should fail
TEST (std::is_same, signed char, char, false);
@@ -156,13 +160,18 @@
TEST (std::is_same, enum_A, unsigned int, false);
TEST (std::is_same, enum_A, unsigned long, false);
- TEST (std::is_same, struct_A, derived_<struct_A>, false);
- TEST (std::is_same, class_B, derived_<class_B>, false);
+ TEST (std::is_same, struct_A, derived_t<struct_A>, false);
+ TEST (std::is_same, class_B, derived_t<class_B>, false);
TEST (std::is_same, int[], int*, false);
TEST (std::is_same, int*, int[], false);
}
+#define TEST(Trait,TypeT,TypeU,Expect) \
+ { const bool value = Trait< TypeT, TypeU >::value; \
+ test_trait (__LINE__, value, Expect, #Trait, #TypeT, #TypeU); \
+ } typedef void __dummy
+
static void test_is_base_of ()
{
TEST (std::is_base_of, bool, bool, false);
@@ -177,24 +186,43 @@
TEST (std::is_base_of, enum_B, enum_B, false);
TEST (std::is_base_of, struct_A, struct_A, true);
- TEST (std::is_base_of, derived_<struct_A>,
- derived_<struct_A>, true);
+ TEST (std::is_base_of, derived_t<struct_A>,
+ derived_t<struct_A>, true);
TEST (std::is_base_of, class_B, class_B, true);
- TEST (std::is_base_of, derived_<class_B>,
- derived_<class_B>, true);
+ TEST (std::is_base_of, derived_t<class_B>,
+ derived_t<class_B>, true);
+#if defined (_RWSTD_TT_IS_BASE_OF) \
+ || defined (_RWSTD_TT_IS_CLASS) \
+ || defined (_RWSTD_TT_IS_UNION)
+ // without one of the above, we can't reliably implement
+ // this trait for union type
TEST (std::is_base_of, union_C, union_C, false);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_is_base_of() have been disabled due "
+ "to lack of compiler support.");
+#endif
// public inheritance
- TEST (std::is_base_of, struct_A, derived_<struct_A>, true);
- TEST (std::is_base_of, class_B, derived_<class_B>, true);
+ TEST (std::is_base_of, struct_A, derived_t<struct_A>, true);
+ TEST (std::is_base_of, class_B, derived_t<class_B>, true);
+#if defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x590)
+
+ // for some reason the trick used to detect private and protected
+ // inheritance doesn't work on sunpro-5.9
+ rw_warn (0, 0, __LINE__,
+ "unable to detect private or protected base classes.");
+
+#else
// protected inheritance
- TEST (std::is_base_of, derived_protected_<struct_A> , struct_A , true);
+ TEST (std::is_base_of, struct_A, derived_protected_t<struct_A>, true);
// private inheritance
- TEST (std::is_base_of, derived_private_<struct_A> , struct_A , true);
+ TEST (std::is_base_of, struct_A, derived_private_t<struct_A>, true);
+#endif
// other combinations should fail
TEST (std::is_base_of, signed char, char, false);
@@ -223,17 +251,23 @@
TEST (std::is_base_of, int[], int*, false);
TEST (std::is_base_of, int*, int[], false);
+
+ TEST (std::is_base_of, struct_A, class_B, false);
+ TEST (std::is_base_of, class_B, struct_A, false);
+
+ TEST (std::is_base_of, derived_t<struct_A>, struct_A, false);
+ TEST (std::is_base_of, derived_t<class_B>, class_B, false);
}
static void test_is_convertible ()
{
- TEST (std::is_convertible, derived_<struct_A> , struct_A , true); // slice
- TEST (std::is_convertible, derived_<struct_A>*, struct_A*, true);
- TEST (std::is_convertible, derived_<struct_A>&, struct_A&, true);
-
- TEST (std::is_convertible, derived_<class_B> , class_B , true); // slice
- TEST (std::is_convertible, derived_<class_B>*, class_B*, true);
- TEST (std::is_convertible, derived_<class_B>&, class_B&, true);
+ TEST (std::is_convertible, derived_t<struct_A> , struct_A , true); // slice
+ TEST (std::is_convertible, derived_t<struct_A>*, struct_A*, true);
+ TEST (std::is_convertible, derived_t<struct_A>&, struct_A&, true);
+
+ TEST (std::is_convertible, derived_t<class_B> , class_B , true); // slice
+ TEST (std::is_convertible, derived_t<class_B>*, class_B*, true);
+ TEST (std::is_convertible, derived_t<class_B>&, class_B&, true);
TEST (std::is_convertible, convertible_to_A, struct_A, true);
TEST (std::is_convertible, struct_A, convertible_to_A, false);
@@ -312,7 +346,7 @@
//// from an abstract type is allowed
//TEST (std::is_convertible, abstract_, int, false);
- //TEST (std::is_convertible, derived_<abstract_>, abstract_, false);
+ //TEST (std::is_convertible, derived_t<abstract_>, abstract_, false);
TEST (std::is_convertible, long*, void*, true);
TEST (std::is_convertible, void*, long*, false);
@@ -334,7 +368,25 @@
TEST (std::is_convertible, int*, void*, true);
TEST (std::is_convertible, int (*)(), void*, false);
- //TEST (std::is_convertible, int (*)(derived_<struct_A>::*), int (*)(struct_A::*), true);
+ TEST (std::is_convertible,
+ int (*)(derived_t<struct_A>*),
+ int (*)(struct_A*), false);
+
+ TEST (std::is_convertible,
+ int (*)(struct_A*),
+ int (*)(derived_t<struct_A>*), false);
+
+ // pointer to derived member convertible to
+ // pointer to base member
+ TEST (std::is_convertible,
+ int derived_t<struct_A>::*,
+ int struct_A::*, false);
+
+ // pointer to base member convertible to
+ // pointer to derived member
+ TEST (std::is_convertible,
+ int struct_A::*,
+ int derived_t<struct_A>::*, true);
TEST (std::is_convertible, int, double, true);
TEST (std::is_convertible, const int, double, true);
Modified: stdcxx/trunk/tests/utilities/20.meta.trans.arr.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.trans.arr.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.trans.arr.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.trans.arr.cpp Fri Aug 1 13:51:17 2008
@@ -28,6 +28,7 @@
**************************************************************************/
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
Modified: stdcxx/trunk/tests/utilities/20.meta.trans.cv.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.trans.cv.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.trans.cv.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.trans.cv.cpp Fri Aug 1 13:51:17 2008
@@ -28,6 +28,7 @@
**************************************************************************/
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
Modified: stdcxx/trunk/tests/utilities/20.meta.trans.other.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.trans.other.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.trans.other.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.trans.other.cpp Fri Aug 1 13:51:17 2008
@@ -28,14 +28,18 @@
**************************************************************************/
#include <rw_driver.h>
-#include <rw_printf.h> // for rwsprintfa()
-#include <stdlib.h> // for free()
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
#include <type_traits>
+#include <rw_printf.h> // for rwsprintfa()
+
+#include <stdlib.h> // for free()
+#include <stddef.h> // for size_t
+
/**************************************************************************/
template <class T>
@@ -53,7 +57,7 @@
// this function should available _only_ if T is char
template <class T>
int
-enabled_if_char (_TYPENAME std::enable_if<is_char<T>::val>::type* = 0)
+enabled_if_char (typename std::enable_if<is_char<T>::val>::type* = 0)
{
return 1;
}
@@ -61,7 +65,7 @@
// this function should be available if T is _not_ char
template <class T>
int
-enabled_if_char (_TYPENAME std::enable_if<!is_char<T>::val>::type* = 0)
+enabled_if_char (typename std::enable_if<!is_char<T>::val>::type* = 0)
{
return 0;
}
@@ -150,11 +154,20 @@
static void test_aligned_storage ()
{
+#ifdef _RWSTD_NO_ALIGN_TRAITS
+
+ rw_warn (0, 0, __LINE__,
+ "test_aligned_storage disabled because "
+ "_RWSTD_NO_ALIGN_TRAITS is defined");
+
+#else
+
#define TEST(Size,Align) \
{ \
typedef std::aligned_storage<Size, Align>::type storage_t; \
test_aligned_storage(__LINE__, \
- Size, sizeof (storage_t), Align, __alignof (storage_t)); \
+ Size, sizeof (storage_t), Align, \
+ std::alignment_of<storage_t>::value); \
} typedef void __dummy
TEST (1, 1);
@@ -177,18 +190,19 @@
{ \
typedef std::aligned_storage<Size>::type storage_t; \
test_aligned_storage(__LINE__, \
- Size, sizeof (storage_t), 0, __alignof (storage_t)); \
+ Size, sizeof (storage_t), 0, \
+ std::alignment_of<storage_t>::value); \
} typedef void __dummy
// test default alignment
TEST (1);
- TEST (1);
- TEST (1);
- TEST (1);
-
- TEST (9);
- TEST (9);
- TEST (9);
+ TEST (2);
+ TEST (4);
+ TEST (8);
+
+ TEST (3);
+ TEST (5);
+ TEST (7);
TEST (9);
TEST (55);
@@ -197,10 +211,14 @@
TEST (19);
#undef TEST
+
+#endif // _RWSTD_NO_ALIGN_TRAITS
}
/**************************************************************************/
+#ifndef _RWSTD_NO_ALIGN_TRAITS
+
struct null_t { };
// get the maximum of 8 values
@@ -293,8 +311,19 @@
struct struct_t { };
+#endif // !_RWSTD_NO_ALIGN_TRAITS
+
+
static void test_aligned_union ()
{
+#ifdef _RWSTD_NO_ALIGN_TRAITS
+
+ rw_warn (0, 0, __LINE__,
+ "test_aligned_union disabled because "
+ "_RWSTD_NO_ALIGN_TRAITS is defined");
+
+#else
+
#define TEST(Len,T1) \
aligned_union_tester<Len,T1>::test(__LINE__,#T1)
@@ -336,6 +365,8 @@
TEST (17, void (struct_t::*)(), long, int, void*, char);
#undef TEST
+
+#endif // _RWSTD_NO_ALIGN_TRAITS
}
/**************************************************************************/
@@ -473,4 +504,3 @@
0);
}
-
Modified: stdcxx/trunk/tests/utilities/20.meta.trans.ptr.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.trans.ptr.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.trans.ptr.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.trans.ptr.cpp Fri Aug 1 13:51:17 2008
@@ -28,6 +28,7 @@
**************************************************************************/
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
Modified: stdcxx/trunk/tests/utilities/20.meta.trans.ref.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.trans.ref.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.trans.ref.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.trans.ref.cpp Fri Aug 1 13:51:17 2008
@@ -28,6 +28,7 @@
**************************************************************************/
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
Modified: stdcxx/trunk/tests/utilities/20.meta.trans.sign.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.trans.sign.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.trans.sign.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.trans.sign.cpp Fri Aug 1 13:51:17 2008
@@ -27,15 +27,16 @@
*
**************************************************************************/
-#include <stddef.h>
-
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
#include <type_traits>
+#include <stddef.h>
+
/**************************************************************************/
template <class T, class U>
Modified: stdcxx/trunk/tests/utilities/20.meta.unary.cat.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.unary.cat.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.unary.cat.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.unary.cat.cpp Fri Aug 1 13:51:17 2008
@@ -27,15 +27,16 @@
*
**************************************************************************/
-#include <stddef.h>
-
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
#include <type_traits>
+#include <stddef.h>
+
/**************************************************************************/
static void
@@ -45,7 +46,7 @@
{
// verify that the expected trait is actually working
- if (rw_assert (value != false, 0, __LINE__,
+ if (rw_assert (value != false, 0, line,
"%s<%s>::value was %b, expected true",
trait_name, type_name, value))
{
@@ -192,7 +193,8 @@
TEST(std::is_rvalue_reference, char&&);
#else
rw_warn (0, 0, __LINE__,
- "no compiler support for rvalue references; test disabled");
+ "test_is_rvalue_reference() disabled because "
+ "_RWSTD_NO_RVALUE_REFERENCES is defined");
#endif // _RWSTD_NO_RVALUE_REFERENCES
}
@@ -242,7 +244,16 @@
static void test_is_union ()
{
+#if !defined (_RWSTD_TT_IS_CLASS) && !defined (_RWSTD_TT_IS_UNION)
+
+ rw_warn (0, 0, __LINE__,
+ "test_is_union() disabled because neither of "
+ "_RWSTD_TT_IS_CLASS or _RWSTD_TT_IS_UNION is "
+ "defined");
+
+#else
TEST (std::is_union, union_t);
+#endif
}
static void test_is_class ()
Modified: stdcxx/trunk/tests/utilities/20.meta.unary.comp.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.unary.comp.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.unary.comp.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.unary.comp.cpp Fri Aug 1 13:51:17 2008
@@ -28,6 +28,7 @@
**************************************************************************/
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
Copied: stdcxx/trunk/tests/utilities/20.meta.unary.nothrow.cpp (from r678247, stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp)
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.unary.nothrow.cpp?p2=stdcxx/trunk/tests/utilities/20.meta.unary.nothrow.cpp&p1=stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp&r1=678247&r2=681820&rev=681820&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.unary.nothrow.cpp Fri Aug 1 13:51:17 2008
@@ -593,8 +593,16 @@
static int
-run_test (int, char*[])
+test_has_nothrow_copy ()
{
+#ifndef _RWSTD_TT_HAS_NOTHROW_COPY
+
+ rw_warn (0, 0, __LINE__,
+ "test_has_nothrow_copy() disabled because "
+ "_RWSTD_TT_HAS_NOTHROW_COPY is not defined");
+
+#else
+
// exercise the has_nothrow_copy_constructor trait
#define TEST(T) \
rw_assert (std::has_nothrow_copy_constructor<T>::value == T::value, \
@@ -607,39 +615,47 @@
TEST (A::A3);
TEST (A::A4);
TEST (A::A5);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
TEST (A::A6);
TEST (A::A7);
TEST (A::A8);
TEST (A::A9);
+#endif
TEST (B::B1);
TEST (B::B2);
TEST (B::B3);
TEST (B::B4);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
TEST (B::B5);
TEST (B::B6);
TEST (B::B7);
TEST (B::B8);
+#endif
TEST (C::C1);
TEST (C::C2);
TEST (C::C3);
TEST (C::C4);
TEST (C::C5);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
TEST (C::C6);
TEST (C::C7);
TEST (C::C8);
TEST (C::C9);
+#endif
TEST (D::D1);
TEST (D::D2);
TEST (D::D3);
TEST (D::D4);
TEST (D::D5);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
TEST (D::D6);
TEST (D::D7);
TEST (D::D8);
TEST (D::D9);
+#endif
TEST (E::E1);
TEST (E::E2);
@@ -675,8 +691,12 @@
TEST (J::J4);
TEST (K::K1);
+# ifndef _RWSTD_NO_VARIADIC_TEMPLATES
TEST (K::K2);
+# endif
+# ifndef _RWSTD_NO_RVALUE_REFERENCES
TEST (K::K3);
+# endif
TEST (K::K4);
TEST (K::K5);
@@ -697,6 +717,16 @@
TEST (L::L15);
TEST (L::L16);
+#endif
+
+ return 0;
+}
+
+static int
+run_test (int, char*[])
+{
+ test_has_nothrow_copy ();
+
return 0;
}
Modified: stdcxx/trunk/tests/utilities/20.meta.unary.prop.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.meta.unary.prop.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.meta.unary.prop.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.meta.unary.prop.cpp Fri Aug 1 13:51:17 2008
@@ -27,17 +27,24 @@
*
**************************************************************************/
-#include <stddef.h>
-
#include <rw_driver.h>
+#include <rw/_defs.h>
// compile out all test code if extensions disabled
#ifndef _RWSTD_NO_EXT_CXX_0X
#include <type_traits>
+#include <stddef.h>
+
/**************************************************************************/
+// function with C linkage
+extern "C" typedef void cfun_t ();
+
+// incomplete type (never defined)
+struct incomplete_t;
+
struct struct_t {
int i_; float f_;
};
@@ -136,16 +143,16 @@
};
struct no_trivial_ctor_t {
- no_trivial_ctor_t () { }
+ no_trivial_ctor_t () _THROWS (()) { }
};
struct no_trivial_copy_t {
- no_trivial_copy_t (const no_trivial_copy_t&) { }
+ no_trivial_copy_t (const no_trivial_copy_t&) _THROWS (()) { }
};
struct no_trivial_assign_t {
no_trivial_assign_t&
- operator= (const no_trivial_assign_t&) {
+ operator= (const no_trivial_assign_t&) _THROWS (()) {
return *this;
}
};
@@ -228,7 +235,7 @@
}
#define _TEST(Trait, Type, Expect) \
- test_trait (__LINE__, Trait<Type>::value, Expect, #Trait, #Type)
+ test_trait (__LINE__, Trait< Type >::value, Expect, #Trait, #Type)
#define TEST(Trait, Type, Expect) \
_TEST (Trait, Type, Expect)
@@ -248,6 +255,11 @@
TEST (std::is_const, V void, false);
TEST (std::is_const, CV void, true);
+ // incomplete type other than void
+ TEST (std::is_const, incomplete_t, false);
+ TEST (std::is_const, C incomplete_t, true);
+ TEST (std::is_const, V incomplete_t, false);
+ TEST (std::is_const, CV incomplete_t, true);
TEST (std::is_const, int, false);
TEST (std::is_const, C int, true);
@@ -282,12 +294,30 @@
TEST (std::is_const, CV int&, false);
// array types
+ TEST (std::is_const, int [], false);
+ TEST (std::is_const, C int [], true);
+ TEST (std::is_const, V int [], false);
+ TEST (std::is_const, CV int [], true);
+
TEST (std::is_const, int [2], false);
TEST (std::is_const, C int [2], true);
TEST (std::is_const, V int [2], false);
TEST (std::is_const, CV int [2], true);
+
+ // array of incomplete type
+ TEST (std::is_const, incomplete_t [], false);
+ TEST (std::is_const, C incomplete_t [], true);
+ TEST (std::is_const, V incomplete_t [], false);
+ TEST (std::is_const, CV incomplete_t [], true);
+
+ // C++ function, C function, and pointers to member functions
+ TEST (std::is_const, void (), false);
+ TEST (std::is_const, cfun_t, false);
+ TEST (std::is_const, void (struct_t::*)(), false);
+ TEST (std::is_const, void (struct_t::*)() const, false);
}
+
void test_is_volatile ()
{
TEST (std::is_volatile, void, false);
@@ -295,6 +325,12 @@
TEST (std::is_volatile, V void, true);
TEST (std::is_volatile, CV void, true);
+ // incomplete type other than void
+ TEST (std::is_volatile, incomplete_t, false);
+ TEST (std::is_volatile, C incomplete_t, false);
+ TEST (std::is_volatile, V incomplete_t, true);
+ TEST (std::is_volatile, CV incomplete_t, true);
+
TEST (std::is_volatile, int, false);
TEST (std::is_volatile, C int, false);
TEST (std::is_volatile, V int, true);
@@ -328,12 +364,30 @@
TEST (std::is_volatile, CV int&, false);
// array types
+ TEST (std::is_volatile, int [], false);
+ TEST (std::is_volatile, C int [], false);
+ TEST (std::is_volatile, V int [], true);
+ TEST (std::is_volatile, CV int [], true);
+
TEST (std::is_volatile, int [2], false);
TEST (std::is_volatile, C int [2], false);
TEST (std::is_volatile, V int [2], true);
TEST (std::is_volatile, CV int [2], true);
+
+ // array of incomplete type
+ TEST (std::is_volatile, incomplete_t [], false);
+ TEST (std::is_volatile, C incomplete_t [], false);
+ TEST (std::is_volatile, V incomplete_t [], true);
+ TEST (std::is_volatile, CV incomplete_t [], true);
+
+ // C++ function, C function, and pointers to member functions
+ TEST (std::is_volatile, void (), false);
+ TEST (std::is_volatile, cfun_t, false);
+ TEST (std::is_volatile, void (struct_t::*)(), false);
+ TEST (std::is_volatile, void (struct_t::*)() volatile, false);
}
+
static void test_has_trivial_assign ()
{
TEST (std::has_trivial_assign, long, true);
@@ -346,9 +400,30 @@
TEST (std::has_trivial_assign, V long&, false);
TEST (std::has_trivial_assign, CV long&, false);
- TEST (std::has_trivial_assign, long[2], true);
+ TEST (std::has_trivial_assign, long [2], false);
+#if defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
+ || defined (_RWSTD_TT_IS_POD)
TEST (std::has_trivial_assign, struct_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_assign() have been disabled "
+ "due to lack of compiler support.");
+#endif
+
+ TEST (std::has_trivial_assign, struct_t [2], false);
+ TEST (std::has_trivial_assign, const struct_t, false);
+ TEST (std::has_trivial_assign, struct_t&, false);
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN)
+ TEST (std::has_trivial_assign, no_trivial_ctor_t, true);
+ TEST (std::has_trivial_assign, no_trivial_copy_t, true);
+ TEST (std::has_trivial_assign, no_trivial_dtor_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_assign() have been disabled "
+ "due to lack of compiler support.");
+#endif
TEST (std::has_trivial_assign, no_trivial_assign_t, false);
TEST (std::has_trivial_assign, public_derived_t<no_trivial_assign_t>, false);
@@ -366,15 +441,43 @@
TEST (std::has_nothrow_assign, V long&, false);
TEST (std::has_nothrow_assign, CV long&, false);
- TEST (std::has_nothrow_assign, long[2], true);
+ TEST (std::has_nothrow_assign, long [2], false);
+#if defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN) \
+ || defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
+ || defined (_RWSTD_TT_IS_POD)
TEST (std::has_nothrow_assign, struct_t, true);
- TEST (std::has_nothrow_assign, no_trivial_assign_t, true);
+ TEST (std::has_nothrow_assign, volatile struct_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_nothrow_assign() have been disabled "
+ "due to lack of compiler support.");
+#endif
+
+ TEST (std::has_nothrow_assign, struct_t [2], false);
+ TEST (std::has_nothrow_assign, const struct_t, false);
+ TEST (std::has_nothrow_assign, struct_t&, false);
+
+#if defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN)
+ TEST (std::has_nothrow_assign, no_trivial_ctor_t, true);
+ TEST (std::has_nothrow_assign, no_trivial_copy_t, true);
+ TEST (std::has_nothrow_assign, no_trivial_dtor_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_nothrow_assign() have been disabled "
+ "due to lack of compiler support.");
+#endif
+
TEST (std::has_nothrow_assign, throwing_assign_t, false);
}
static void test_is_trivial ()
{
+ TEST (std::is_trivial, void, false);
+ TEST (std::is_trivial, C void, false);
+ TEST (std::is_trivial, V void, false);
+ TEST (std::is_trivial, CV void, false);
+
TEST (std::is_trivial, long, true);
TEST (std::is_trivial, C long, true);
TEST (std::is_trivial, V long, true);
@@ -385,6 +488,11 @@
TEST (std::is_trivial, V long&, false);
TEST (std::is_trivial, CV long&, false);
+#if ( defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
+ && defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
+ && defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
+ && defined (_RWSTD_TT_HAS_TRIVIAL_DTOR)) \
+ || defined (_RWSTD_TT_IS_POD)
TEST (std::is_trivial, class_t, true);
TEST (std::is_trivial, struct_t, true);
TEST (std::is_trivial, union_t, true);
@@ -394,6 +502,11 @@
TEST (std::is_trivial, non_empty_t, true);
TEST (std::is_trivial, public_derived_t<non_empty_t>, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_is_trivial() have been disabled "
+ "due to lack of compiler support.");
+#endif
TEST (std::is_trivial, abstract_t, false);
TEST (std::is_trivial, public_derived_t<abstract_t>, false);
@@ -413,14 +526,13 @@
#undef TEST
#define TEST(Trait,Type,Expect) \
_TEST(Trait, Type, Expect); \
- _TEST(Trait, std::add_const<Type>::type, Expect); \
- _TEST(Trait, std::add_volatile<Type>::type, Expect); \
- _TEST(Trait, std::add_cv<Type>::type, Expect)
+ _TEST(Trait, std::add_const< Type >::type, Expect); \
+ _TEST(Trait, std::add_volatile< Type >::type, Expect); \
+ _TEST(Trait, std::add_cv< Type >::type, Expect)
static void test_is_standard_layout ()
{
TEST (std::is_standard_layout, long, true);
- TEST (std::is_standard_layout, non_empty_t, true);
// no non-static data members of non-standard-layout type
TEST (std::is_standard_layout, member_t<access_controlled_t>, false);
@@ -454,9 +566,24 @@
typedef public_derived_with_member<empty_t,int> derived_from_empty_with_member;
TEST (std::is_standard_layout, derived_from_empty_with_member, false);
+#if defined (_RWSTD_TT_IS_STANDARD_LAYOUT) \
+ || defined (_RWSTD_TT_IS_POD)
+ TEST (std::is_standard_layout, non_empty_t, true);
+
+# if defined (_RWSTD_TT_STRICT_CXX_0X_CONFORM)
+
// but we are allowed non-static members in one base class
TEST (std::is_standard_layout, public_derived_t<non_empty_t>, true);
- TEST (std::is_standard_layout, public_derived_t<public_derived_t<non_empty_t> >, true);
+ TEST (std::is_standard_layout,
+ public_derived_t<public_derived_t<non_empty_t> >, true);
+
+# endif // _RWSTD_TT_STRICT_CXX_0X_CONFORM
+
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_is_standard_layout() have been disabled "
+ "due to lack of compiler support.");
+#endif
// but not two base classes with non-static members
typedef public_derived_with_member<non_empty_t, int> derived_from_non_empty_with_member;
@@ -476,13 +603,14 @@
TEST (std::is_pod, long, true);
TEST (std::is_pod, long [], true);
TEST (std::is_pod, long [2], true);
- TEST (std::is_pod, long (*)[2], true);
+ TEST (std::is_pod, long (*) [2], true);
TEST (std::is_pod, void*, true);
TEST (std::is_pod, void (*)(), true);
- TEST (std::is_pod, void (*[])(), true);
+ TEST (std::is_pod, void (* [])(), true);
TEST (std::is_pod, void (class_t::*)(), true);
+#if defined (_RWSTD_TT_IS_POD)
// standard layout and trivial
//
TEST (std::is_pod, struct_t, true);
@@ -490,10 +618,18 @@
TEST (std::is_pod, enum_t, true);
TEST (std::is_pod, empty_t, true);
- TEST (std::is_pod, public_derived_t<empty_t>, true);
-
TEST (std::is_pod, non_empty_t, true);
+
+# if defined (_RWSTD_TT_STRICT_CXX_0X_CONFORM)
+ TEST (std::is_pod, public_derived_t<empty_t>, true);
TEST (std::is_pod, public_derived_t<non_empty_t>, true);
+# endif
+
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_is_pod() have been disabled "
+ "due to lack of compiler support.");
+#endif
TEST (std::is_pod, abstract_t, false);
TEST (std::is_pod, public_derived_t<abstract_t>, false);
@@ -520,8 +656,16 @@
TEST (std::is_empty, empty_union, false);
+#if defined(_RWSTD_TT_IS_EMPTY) \
+ || defined (_RWSTD_TT_IS_CLASS) \
+ || defined (_RWSTD_TT_IS_UNION)
TEST (std::is_empty, empty_t, true);
TEST (std::is_empty, public_derived_t<empty_t>, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_is_empty() have been disabled "
+ "due to lack of compiler support.");
+#endif
TEST (std::is_empty, non_empty_t, false);
TEST (std::is_empty, public_derived_t<non_empty_t>, false);
@@ -538,11 +682,27 @@
static void test_is_polymorphic ()
{
+ // if we can reliably detect a class type, the fallback will evaluate
+ // to true for all polymorphic types. otherwise, it will evaluate to
+ // true for all class and union types.
+
+ TEST (std::is_polymorphic, void, false);
+ TEST (std::is_polymorphic, long, false);
+ TEST (std::is_polymorphic, int*, false);
+
TEST (std::is_polymorphic, polymorphic_t, true);
TEST (std::is_polymorphic, public_derived_t<polymorphic_t>, true);
+#if defined (_RWSTD_TT_IS_POLYMORPHIC) \
+ || defined (_RWSTD_TT_IS_CLASS) \
+ || defined (_RWSTD_TT_IS_UNION)
TEST (std::is_polymorphic, non_polymorphic_t, false);
TEST (std::is_polymorphic, public_derived_t<non_polymorphic_t>, false);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_is_polymorphic() have been disabled "
+ "due to lack of compiler support.");
+#endif
TEST (std::is_polymorphic, abstract_t, true);
TEST (std::is_polymorphic, public_derived_t<abstract_t>, true);
@@ -550,19 +710,57 @@
static void test_is_abstract ()
{
+ // if we can reliably detect a class type, the fallback will evaluate
+ // to true for all abstract types. otherwise, it will evaluate to
+ // true for all class and union types.
+
+ TEST (std::is_abstract, void, false);
+ TEST (std::is_abstract, long, false);
+ TEST (std::is_abstract, int*, false);
+
TEST (std::is_abstract, abstract_t, true);
TEST (std::is_abstract, public_derived_t<abstract_t>, true);
+#if defined (_RWSTD_TT_IS_ABSTRACT) \
+ || defined (_RWSTD_TT_IS_CLASS) \
+ || defined (_RWSTD_TT_IS_UNION)
TEST (std::is_abstract, polymorphic_t, false); // polymorphic_t is not an abstract type
TEST (std::is_abstract, public_derived_t<polymorphic_t>, false);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_is_abstract() have been disabled "
+ "due to lack of compiler support.");
+#endif
}
static void test_has_trivial_constructor ()
{
TEST (std::has_trivial_default_constructor, long, true);
+ TEST (std::has_trivial_default_constructor, const long, true);
+ TEST (std::has_trivial_default_constructor, volatile long, true);
TEST (std::has_trivial_default_constructor, long&, false);
- TEST (std::has_trivial_default_constructor, long[2], true);
+ TEST (std::has_trivial_default_constructor, long [2], true);
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
+ || defined (_RWSTD_TT_IS_POD)
TEST (std::has_trivial_default_constructor, struct_t, true);
+ TEST (std::has_trivial_default_constructor, const struct_t, true);
+ TEST (std::has_trivial_default_constructor, volatile struct_t, true);
+ TEST (std::has_trivial_default_constructor, struct_t [2], true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_constructor() have been "
+ "disabled due to lack of compiler support.");
+#endif
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_CTOR)
+ TEST (std::has_trivial_default_constructor, no_trivial_assign_t, true);
+ TEST (std::has_trivial_default_constructor, no_trivial_dtor_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_constructor() have been "
+ "disabled due to lack of compiler support.");
+#endif
TEST (std::has_trivial_default_constructor, no_trivial_ctor_t, false);
TEST (std::has_trivial_default_constructor, public_derived_t<no_trivial_ctor_t>, false);
@@ -571,10 +769,33 @@
static void test_has_trivial_copy ()
{
TEST (std::has_trivial_copy_constructor, long, true);
+ TEST (std::has_trivial_copy_constructor, const long, true);
+ TEST (std::has_trivial_copy_constructor, volatile long, true);
TEST (std::has_trivial_copy_constructor, long&, true);
- TEST (std::has_trivial_copy_constructor, long[2], true);
+ TEST (std::has_trivial_copy_constructor, long [2], false);
+#if defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
+ || defined (_RWSTD_TT_IS_POD)
TEST (std::has_trivial_copy_constructor, struct_t, true);
+ TEST (std::has_trivial_copy_constructor, const struct_t, true);
+ TEST (std::has_trivial_copy_constructor, volatile struct_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_copy() have been "
+ "disabled due to lack of compiler support.");
+#endif
+
+ TEST (std::has_trivial_copy_constructor, struct_t [2], false);
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_COPY)
+ TEST (std::has_trivial_copy_constructor, no_trivial_ctor_t, true);
+ TEST (std::has_trivial_copy_constructor, no_trivial_assign_t, true);
+ TEST (std::has_trivial_copy_constructor, no_trivial_dtor_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_copy() have been "
+ "disabled due to lack of compiler support.");
+#endif
TEST (std::has_trivial_copy_constructor, no_trivial_copy_t, false);
TEST (std::has_trivial_copy_constructor, public_derived_t<no_trivial_copy_t>, false);
@@ -583,9 +804,32 @@
static void test_has_trivial_destructor ()
{
TEST (std::has_trivial_destructor, long, true);
+ TEST (std::has_trivial_destructor, const long, true);
+ TEST (std::has_trivial_destructor, volatile long, true);
TEST (std::has_trivial_destructor, long&, true);
- TEST (std::has_trivial_destructor, long[2], true);
+ TEST (std::has_trivial_destructor, long [2], true);
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_DTOR) \
+ || defined (_RWSTD_TT_IS_POD)
TEST (std::has_trivial_destructor, struct_t, true);
+ TEST (std::has_trivial_destructor, const struct_t, true);
+ TEST (std::has_trivial_destructor, volatile struct_t, true);
+ TEST (std::has_trivial_destructor, struct_t [2], true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_destructor() have been "
+ "disabled due to lack of compiler support.");
+#endif
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_DTOR)
+ TEST (std::has_trivial_destructor, no_trivial_ctor_t, true);
+ TEST (std::has_trivial_destructor, no_trivial_copy_t, true);
+ TEST (std::has_trivial_destructor, no_trivial_assign_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_trivial_destructor() have been "
+ "disabled due to lack of compiler support.");
+#endif
TEST (std::has_trivial_destructor, no_trivial_dtor_t, false);
TEST (std::has_trivial_destructor, public_derived_t<no_trivial_dtor_t>, false);
@@ -594,20 +838,70 @@
static void test_has_nothrow_constructor ()
{
TEST (std::has_nothrow_default_constructor, long, true);
+ TEST (std::has_nothrow_default_constructor, const long, true);
+ TEST (std::has_nothrow_default_constructor, volatile long, true);
TEST (std::has_nothrow_default_constructor, long&, false);
- TEST (std::has_nothrow_default_constructor, long[2], true);
+ TEST (std::has_nothrow_default_constructor, long [2], true);
+#if defined (_RWSTD_TT_HAS_NOTHROW_CTOR) \
+ || defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
+ || defined (_RWSTD_TT_IS_POD)
+ TEST (std::has_nothrow_default_constructor, struct_t, true);
+ TEST (std::has_nothrow_default_constructor, const struct_t, true);
+ TEST (std::has_nothrow_default_constructor, volatile struct_t, true);
+ TEST (std::has_nothrow_default_constructor, struct_t [2], true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_nothrow_constructor() have been "
+ "disabled due to lack of compiler support.");
+#endif
+
+#if defined (_RWSTD_TT_HAS_NOTHROW_CTOR)
+ TEST (std::has_nothrow_default_constructor, no_trivial_ctor_t, true);
+ //TEST (std::has_nothrow_default_constructor, no_trivial_copy_t, true);
+ TEST (std::has_nothrow_default_constructor, no_trivial_assign_t, true);
TEST (std::has_nothrow_default_constructor, struct_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_nothrow_constructor() have been "
+ "disabled due to lack of compiler support.");
+#endif
+
TEST (std::has_nothrow_default_constructor, throwing_ctor_t, false);
}
static void test_has_nothrow_copy ()
{
TEST (std::has_nothrow_copy_constructor, long, true);
+ TEST (std::has_nothrow_copy_constructor, const long, true);
+ TEST (std::has_nothrow_copy_constructor, volatile long, true);
TEST (std::has_nothrow_copy_constructor, long&, true);
- TEST (std::has_nothrow_copy_constructor, long[2], true);
+ TEST (std::has_nothrow_copy_constructor, long [2], false);
+#if defined (_RWSTD_TT_HAS_NOTHROW_COPY) \
+ || defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
+ || defined (_RWSTD_TT_IS_POD)
TEST (std::has_nothrow_copy_constructor, struct_t, true);
+ TEST (std::has_nothrow_copy_constructor, const struct_t, true);
+ TEST (std::has_nothrow_copy_constructor, volatile struct_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_nothrow_copy() have been "
+ "disabled due to lack of compiler support.");
+#endif
+
+ TEST (std::has_nothrow_copy_constructor, struct_t [2], false);
+
+#if defined (_RWSTD_TT_HAS_NOTHROW_COPY)
+ TEST (std::has_nothrow_copy_constructor, no_trivial_ctor_t, true);
+ TEST (std::has_nothrow_copy_constructor, no_trivial_copy_t, true);
+ TEST (std::has_nothrow_copy_constructor, no_trivial_assign_t, true);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_nothrow_copy() have been "
+ "disabled due to lack of compiler support.");
+#endif
+
TEST (std::has_nothrow_copy_constructor, throwing_copy_t, false);
}
@@ -619,8 +913,16 @@
TEST (std::has_virtual_destructor, polymorphic_t, true);
TEST (std::has_virtual_destructor, public_derived_t<polymorphic_t>, true);
+#if defined (_RWSTD_TT_HAS_VIRTUAL_DTOR) \
+ || defined (_RWSTD_TT_IS_CLASS) \
+ || defined (_RWSTD_TT_IS_UNION)
TEST (std::has_virtual_destructor, non_polymorphic_t, false);
TEST (std::has_virtual_destructor, public_derived_t<non_polymorphic_t>, false);
+#else
+ rw_warn (0, 0, __LINE__,
+ "portions of test_has_virtual_destructor() have been "
+ "disabled due to lack of compiler support.");
+#endif
}
static void test_is_signed ()
@@ -641,14 +943,20 @@
TEST (std::is_signed, float, true);
TEST (std::is_signed, double, true);
+
+#ifndef _RWSTD_NO_LONG_DOUBLE
TEST (std::is_signed, long double, true);
+#endif
TEST (std::is_signed, enum_t, false);
TEST (std::is_signed, struct_t, false);
TEST (std::is_signed, class_t, false);
TEST (std::is_signed, union_t, false);
- // add tests for references, pointers, arrays and functions
+ TEST (std::is_signed, long&, false);
+ TEST (std::is_signed, long*, false);
+ TEST (std::is_signed, long [2], false);
+ TEST (std::is_signed, long (), false);
}
static void test_is_unsigned ()
@@ -669,16 +977,69 @@
TEST (std::is_unsigned, float, false);
TEST (std::is_unsigned, double, false);
+
+#ifndef _RWSTD_NO_LONG_DOUBLE
TEST (std::is_unsigned, long double, false);
+#endif
TEST (std::is_unsigned, enum_t, false);
TEST (std::is_unsigned, struct_t, false);
TEST (std::is_unsigned, class_t, false);
TEST (std::is_unsigned, union_t, false);
+
+ TEST (std::is_unsigned, unsigned long&, false);
+ TEST (std::is_unsigned, unsigned long*, false);
+ TEST (std::is_unsigned, unsigned long [2], false);
+ TEST (std::is_unsigned, unsigned long (), false);
}
static void test_alignment_of ()
{
+#ifdef _RWSTD_NO_ALIGN_TRAITS
+
+ rw_warn (0, 0, __LINE__,
+ "test_alignment_of() disabled because "
+ "_RWSTD_NO_ALIGN_TRAITS is defined");
+
+#else
+
+# undef TEST
+# define TEST(Trait,Type) \
+ test_trait (__LINE__, #Trait, #Type, \
+ Trait<Type>::value, _RWSTD_TT_ALIGN_OF(Type))
+
+ TEST (std::alignment_of, signed char);
+ TEST (std::alignment_of, signed short);
+ TEST (std::alignment_of, signed int);
+ TEST (std::alignment_of, signed long);
+
+ TEST (std::alignment_of, unsigned char);
+ TEST (std::alignment_of, unsigned short);
+ TEST (std::alignment_of, unsigned int);
+ TEST (std::alignment_of, unsigned long);
+
+#ifndef _RWSTD_NO_LONG_LONG
+ TEST (std::alignment_of, signed long long);
+ TEST (std::alignment_of, unsigned long long);
+#endif
+
+ TEST (std::alignment_of, float);
+ TEST (std::alignment_of, double);
+
+#ifndef _RWSTD_NO_LONG_DOUBLE
+ TEST (std::alignment_of, long double);
+#endif
+
+ TEST (std::alignment_of, enum_t);
+ TEST (std::alignment_of, struct_t);
+ TEST (std::alignment_of, class_t);
+ TEST (std::alignment_of, union_t);
+ TEST (std::alignment_of, polymorphic_t);
+
+ TEST (std::alignment_of, void*);
+
+# undef TEST
+#endif // _RWSTD_TT_ALIGN_OF
}
static void test_rank ()
@@ -724,7 +1085,7 @@
#undef TEST
}
-static int run_test (int, char*[])
+static int run_test (int, char* [])
{
test_is_const ();
test_is_volatile ();
@@ -757,7 +1118,7 @@
/**************************************************************************/
-static int run_test (int, char*[])
+static int run_test (int, char* [])
{
rw_warn (0, 0, __LINE__,
"test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
@@ -768,7 +1129,7 @@
/**************************************************************************/
-int main (int argc, char*argv[])
+int main (int argc, char* argv [])
{
return rw_test (argc, argv, __FILE__,
"meta.unary.prop",
Modified: stdcxx/trunk/tests/utilities/20.operators.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.operators.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.operators.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.operators.cpp Fri Aug 1 13:51:17 2008
@@ -397,7 +397,9 @@
typedef RandomAccessIterator I;
- RandomNumberGenerator<typename I::difference_type> rndgen;
+ typedef typename std::iterator_traits<I>::difference_type DiffT;
+
+ RandomNumberGenerator<DiffT> rndgen;
std::random_shuffle (I (), I ());
std::random_shuffle (I (), I (), rndgen);
Modified: stdcxx/trunk/tests/utilities/20.tuple.cnstr.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.tuple.cnstr.cpp?rev=681820&r1=681819&r2=681820&view=diff
==============================================================================
--- stdcxx/trunk/tests/utilities/20.tuple.cnstr.cpp (original)
+++ stdcxx/trunk/tests/utilities/20.tuple.cnstr.cpp Fri Aug 1 13:51:17 2008
@@ -2,7 +2,7 @@
*
* 20.tuple.cnstr.cpp - tests exercising tuple constructors and operators
*
- * $Id$
+ * $Id: 20.tuple.cnstr.cpp 677985 2008-07-18 18:05:55Z elemings $
*
***************************************************************************
*
@@ -22,39 +22,153 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 2008 Rogue Wave Software.
- *
+ * Copyright 2008 Rogue Wave Software, Inc.
+ *
**************************************************************************/
+#include <rw_driver.h>
+
+// compile out all test code if extensions disabled
+#if !defined (_RWSTD_NO_EXT_CXX_0X) \
+ && !defined(_RWSTD_NO_RVALUE_REFERENCES)
+
+#include <climits> // for CHAR_MAX
+#include <cstdlib> // for rand
+#include <cstring> // for strcmp
#include <tuple>
+#include <type_traits> // for decay
+
+#include <rw_valcmp.h> // for rw_fltcmp
+#include <rw_allocator.h> // for UserAlloc
#include "20.tuple.h"
/**************************************************************************/
-#include <rw_driver.h>
+// general test function and underlying abstractions
+
+template <class T, class U = T>
+bool equal (const T& x, const U& y)
+{
+ return x == y;
+}
+
+template <>
+bool equal (const float& x, const float& y)
+{
+ return 0 == rw_fltcmp (x, y);
+}
+
+template <>
+bool equal (const char* const& x, const char* const& y)
+{
+ return 0 == std::strcmp (x, y);
+}
+
+
+template <class T, class U>
+void assert (int line, unsigned index, const char* tuple_name,
+ const T& t, const U& u)
+{
+ const char* fmtT = FMT_SPEC (T);
+ const char* fmtU = FMT_SPEC (U);
+ rw_assert (equal (t, u), __FILE__, line,
+ "get<%d, %s> (); got %{@}, expected %{@}",
+ index, tuple_name, fmtT, t, fmtU, u);
+}
+
+void assert (int line, unsigned index, const char* tuple_name,
+ const UserDefined& t, const UserDefined& u)
+{
+ rw_assert (equal (t, u), __FILE__, line,
+ "get<%d, %s> (); got %p [%d], expected %p [%d]",
+ index, tuple_name, &t, t.value (), &u, u.value ());
+
+ UserDefined::size_type a, e;
+
+#undef CHECK
+#define CHECK(N) \
+ a = UserDefined::actual.N; e = UserDefined::expect.N; \
+ rw_assert (a == e, __FILE__, line, \
+ "UserDefined::" #N "; got %u, expected %u", a, e)
+
+ CHECK (dflt_ctor);
+ CHECK (copy_ctor);
+ CHECK (tmpl_ctor);
+ CHECK (move_ctor);
+ CHECK (copy_asgn);
+ CHECK (tmpl_asgn);
+ CHECK (move_asgn);
+}
+
+template <class T, class U>
+void assert (int line, unsigned index, const char* tuple_name,
+ const std::tuple<T>& t, const std::tuple<U>& u)
+{
+ const char* fmtT = FMT_SPEC (T);
+ const char* fmtU = FMT_SPEC (U);
+ rw_assert (equal (t, u), __FILE__, line,
+ "get<%d, %s> (); got %{@}, expected %{@}",
+ index, tuple_name,
+ fmtT, std::get<0> (t), fmtU, std::get<0> (u));
+}
+
+
+template <unsigned Index, class Tuple, class... Elements>
+/*static*/ void
+test_impl (int line, const Tuple& tuple, const Elements&... values);
+
+// terminating specialization
+template <unsigned Index, class Tuple>
+/*static*/ void
+test_impl (int, const Tuple&) {}
+
+// generic definition
+template <unsigned Index, class Tuple, class Element, class... Elements>
+/*static*/ void
+test_impl (int line, const Tuple& tuple,
+ const Element& value, const Elements&... values)
+{
+ // assume std::get() has been fully tested and works correctly
+ assert (line, Index, TYPE_NAME (Tuple),
+ std::get<Index> (tuple), value);
+
+ test_impl<Index+1> (line, tuple, values...);
+}
+
+template <class Tuple, class... Elements>
+/*static*/ void
+test (int line, const Tuple& tuple, const Elements&... values)
+{
+ test_impl<0> (line, tuple, values...);
+}
+
+/**************************************************************************/
static void
test_default_ctor ()
{
rw_info (0, __FILE__, __LINE__, "default constructor");
- EmptyTuple et; _RWSTD_UNUSED (et);
- IntTuple it; _RWSTD_UNUSED (it);
- ConstIntTuple ct; _RWSTD_UNUSED (ct);
- PairTuple pt; _RWSTD_UNUSED (pt);
- NestedTuple nt; _RWSTD_UNUSED (nt);
- BigTuple bt; _RWSTD_UNUSED (bt);
-
- UserClass::reset_totals ();
- UserTuple ut; _RWSTD_UNUSED (ut);
-
- rw_assert (1 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d default ctors, "
- "expected 1", UserClass::n_total_def_ctor_);
- rw_assert (0 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d copy ctors, "
- "expected 0", UserClass::n_total_copy_ctor_);
+ std::tuple<> et; _RWSTD_UNUSED (et);
+ // TODO: enable this test after implementing empty space optimization
+ //rw_assert (sizeof (et) == 0, __FILE__, __LINE__,
+ //"sizeof (std::tuple<>); got %u, expected 0",
+ //sizeof (et));
+
+ std::tuple<int> it; _RWSTD_UNUSED (it);
+ std::tuple<const int> ct; _RWSTD_UNUSED (ct);
+ // ill-formed for tuples with element types containing references
+ std::tuple<long, const char*> pt; _RWSTD_UNUSED (pt);
+ std::tuple<std::tuple<int> > nt; _RWSTD_UNUSED (nt);
+ std::tuple<bool, char, int, double, void*, UserDefined> bt;
+ _RWSTD_UNUSED (bt);
+
+ UserDefined::reset ();
+ std::tuple<UserDefined> ut; _RWSTD_UNUSED (ut);
+ rw_assert (1 == UserDefined::actual.dflt_ctor, __FILE__, __LINE__,
+ "std::tuple<UserDefined> ut; called %d default ctors, "
+ "expected 1", UserDefined::actual.dflt_ctor);
}
/**************************************************************************/
@@ -64,29 +178,40 @@
{
rw_info (0, __FILE__, __LINE__, "value copy constructor");
- const int i = 1;
- const IntTuple it (i);
- ConstIntTuple ct (i); _RWSTD_UNUSED (ct);
- NestedTuple nt (it);
-
- const long l = 1;
- const char* s = "string";
- PairTuple pt (l, s);
-
- UserClass::reset_totals ();
- const UserClass uc;
- UserTuple ut (uc); _RWSTD_UNUSED (ut);
-
- rw_assert (1 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d default ctors, "
- "expected 1", UserClass::n_total_def_ctor_);
- rw_assert (1 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d copy ctors, "
- "expected 1", UserClass::n_total_copy_ctor_);
+ const int i = std::rand ();
+ std::tuple<int> it1 (i);
+ test (__LINE__, it1, i);
+
+ const std::tuple<int> it2 (i);
+ test (__LINE__, it2, i);
+
+ std::tuple<const int> ct (i);
+ test (__LINE__, ct, i);
+
+ int j = std::rand ();
+ const std::tuple<int&> rt (j);
+ test (__LINE__, rt, j);
+
+ std::tuple<std::tuple<int> > nt (it2);
+ //std::get<0> (it2) = std::rand (); // diliberately cause assertion
+ test (__LINE__, nt, it2);
+
+ const long l = std::rand ();
+ std::tuple<long, const char*> pt (l, "string");
+ test (__LINE__, pt, l, (const char*) "string");
+
+ const UserDefined ud (i);
+ UserDefined::reset ();
+ std::tuple<UserDefined> ut (ud);
+ UserDefined::expect.copy_ctor = 1;
+ test (__LINE__, ut, ud);
const bool b = true; const char c = 'a';
- const double d = 1.2; void* const p = 0;
- BigTuple bt (b, c, i, d, p, uc); _RWSTD_UNUSED (bt);
+ const double d = 3.14159; void* const p = (void*) &i;
+ std::tuple<bool, char, int, double, void*, UserDefined>
+ bt (b, c, i, d, p, ud);
+ ++UserDefined::expect.copy_ctor;
+ test (__LINE__, bt, b, c, i, d, p, ud);
}
/**************************************************************************/
@@ -96,23 +221,48 @@
{
rw_info (0, __FILE__, __LINE__, "value move constructor");
- IntTuple it (1); //_RWSTD_UNUSED (it);
- ConstIntTuple ct (1); _RWSTD_UNUSED (ct);
- PairTuple pt (1L, "string"); _RWSTD_UNUSED (pt);
- //NestedTuple nt (it); _RWSTD_UNUSED (nt);
-
- BigTuple bt (true, 'a', 1, 1.0, (void*)0, UserClass ());
- _RWSTD_UNUSED (bt);
+#define INTEGER_CONSTANT 256
- UserClass::reset_totals ();
- UserTuple ut (UserClass ()); _RWSTD_UNUSED (ut);
-
- rw_assert (0 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d default ctors, "
- "expected 0", UserClass::n_total_def_ctor_);
- rw_assert (0 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d copy ctors, "
- "expected 0", UserClass::n_total_copy_ctor_);
+ std::tuple<int> it1 (INTEGER_CONSTANT);
+ test (__LINE__, it1, INTEGER_CONSTANT);
+ const int c = std::rand ();
+ int i = c; // move semantics can alter source value
+ std::tuple<int> it2 (i); // temporary source value
+ test (__LINE__, it2, c);
+
+ const std::tuple<int> it3 (INTEGER_CONSTANT);
+ test (__LINE__, it3, INTEGER_CONSTANT);
+ i = c;
+ const std::tuple<int> it4 (i);
+ test (__LINE__, it4, c);
+
+ std::tuple<const int> ct1 (INTEGER_CONSTANT);
+ test (__LINE__, ct1, INTEGER_CONSTANT);
+ i = c;
+ std::tuple<const int> ct2 (i);
+ test (__LINE__, ct2, c);
+
+ // ill-formed for tuples with element types containing references
+
+ std::tuple<std::tuple<int> > nt (it1);
+ test (__LINE__, nt, it1);
+
+ std::tuple<long, const char*> pt (123456789L, "string");
+ test (__LINE__, pt, 123456789L, (const char*) "string");
+
+ const UserDefined src (c);
+ UserDefined tmp (src);
+ UserDefined::reset ();
+ std::tuple<UserDefined> ut (tmp);
+ UserDefined::expect.move_ctor = 1;
+ test (__LINE__, ut, src);
+
+ tmp = src; ++UserDefined::expect.copy_asgn;
+ std::tuple<bool, char, int, double, void*, UserDefined>
+ bt (true, 'a', INTEGER_CONSTANT, 3.14159, (void*) 0, tmp);
+ ++UserDefined::expect.move_ctor;
+ test (__LINE__, bt,
+ true, 'a', INTEGER_CONSTANT, 3.14159, (void*) 0, src);
}
/**************************************************************************/
@@ -123,34 +273,44 @@
rw_info (0, __FILE__, __LINE__,
"copy constructor (homogenous tuples)");
- EmptyTuple et1, et2 (et1);
+ std::tuple<> et1, et2 (et1);
_RWSTD_UNUSED (et2);
- const IntTuple it1;
- IntTuple it2 (it1); _RWSTD_UNUSED (it2);
-
- const ConstIntTuple ct1;
- ConstIntTuple ct2 (ct1); _RWSTD_UNUSED (ct2);
-
- PairTuple pt1;
- PairTuple pt2 (pt1); _RWSTD_UNUSED (pt2);
-
- const NestedTuple nt1;
- NestedTuple nt2 (nt1); _RWSTD_UNUSED (nt2);
-
- UserClass::reset_totals ();
- const UserTuple ut1; UserTuple ut2 (ut1);
- _RWSTD_UNUSED (ut1);
-
- rw_assert (1 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d default ctors, "
- "expected 1", UserClass::n_total_def_ctor_);
- rw_assert (1 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d copy ctors, "
- "expected 1", UserClass::n_total_copy_ctor_);
-
- const BigTuple bt1; BigTuple bt2 (bt1);
- _RWSTD_UNUSED (bt1); _RWSTD_UNUSED (bt2);
+ const int ci = std::rand ();
+ const std::tuple<int> it1 (ci);
+ std::tuple<int> it2 (it1);
+ test (__LINE__, it2, ci);
+
+ const std::tuple<const int>& ct1 = it1; // same as copy ctor
+ std::tuple<const int> ct2 (ct1);
+ test (__LINE__, ct2, ci);
+
+ int i = ci;
+ const std::tuple<int&> rt1 (i);
+ std::tuple<int&> rt2 (rt1);
+ test (__LINE__, rt2, ci);
+
+ const std::tuple<std::tuple<int> > nt1 (it1);
+ std::tuple<std::tuple<int> > nt2 (nt1);
+ test (__LINE__, nt2, it1);
+
+ const std::tuple<long, const char*> pt1 (1234567890L, "string");
+ std::tuple<long, const char*> pt2 (pt1);
+ test (__LINE__, pt2, 1234567890L, (const char*) "string");
+
+ UserDefined ud (ci);
+ const std::tuple<UserDefined> ut1 (ud);
+ UserDefined::reset ();
+ std::tuple<UserDefined> ut2 (ut1);
+ ++UserDefined::expect.copy_ctor;
+ test (__LINE__, ut2, ud);
+
+ const std::tuple<bool, char, int, double, void*, UserDefined>
+ bt1 (true, 'a', ci, 3.14159, (void* const) &i, ud);
+ ++UserDefined::expect.move_ctor; // moved ud to bt1
+ std::tuple<bool, char, int, double, void*, UserDefined> bt2 (bt1);
+ ++UserDefined::expect.copy_ctor; // copied to bt2
+ test (__LINE__, bt2, true, 'a', ci, 3.14159, (void* const) &i, ud);
}
/**************************************************************************/
@@ -161,21 +321,40 @@
rw_info (0, __FILE__, __LINE__,
"move constructor (homogenous tuples)");
- EmptyTuple et (EmptyTuple ()); _RWSTD_UNUSED (et);
- IntTuple it (IntTuple ()); _RWSTD_UNUSED (it);
- ConstIntTuple ct (ConstIntTuple ()); _RWSTD_UNUSED (ct);
- PairTuple pt (PairTuple ()); _RWSTD_UNUSED (pt);
- NestedTuple nt (NestedTuple ()); _RWSTD_UNUSED (nt);
- BigTuple bt (BigTuple ());
-
- UserClass::reset_totals ();
- UserTuple ut (UserTuple ());
- rw_assert (0 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d default ctors, "
- "expected 0", UserClass::n_total_def_ctor_);
- rw_assert (0 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d copy ctors, "
- "expected 0", UserClass::n_total_copy_ctor_);
+ std::tuple<> et (std::tuple<> ()); _RWSTD_UNUSED (et);
+
+ const int ci = std::rand ();
+
+ std::tuple<int> it1 (ci);
+ std::tuple<int> it2 (std::move (it1));
+ test (__LINE__, it2, ci);
+
+ std::tuple<const int> ct1 (ci);
+ std::tuple<const int> ct2 = std::move (ct1);
+ test (__LINE__, ct2, ci);
+
+ std::tuple<std::tuple<int> > nt1 (it1);
+ std::tuple<std::tuple<int> > nt2 = std::move (nt1);
+ test (__LINE__, nt2, it1);
+
+ std::tuple<long, const char*> pt1 (1234567890L, "string");
+ std::tuple<long, const char*> pt2 (std::move (pt1));
+ test (__LINE__, pt2, 1234567890L, (const char*) "string");
+
+ const UserDefined ud (ci);
+ std::tuple<UserDefined> ut1 (ud);
+ UserDefined::reset ();
+ std::tuple<UserDefined> ut2 (std::move (ut1));
+ ++UserDefined::expect.move_ctor;
+ test (__LINE__, ut2, ud);
+
+ std::tuple<bool, char, int, double, void*, UserDefined>
+ bt1 (true, 'a', ci, 3.14159, (void*) &ci, ud);
+ ++UserDefined::expect.copy_ctor;
+ std::tuple<bool, char, int, double, void*, UserDefined>
+ bt2 (std::move (bt1));
+ ++UserDefined::expect.move_ctor;
+ test (__LINE__, bt2, true, 'a', ci, 3.14159, (void*) &ci, ud);
}
/**************************************************************************/
@@ -186,24 +365,49 @@
rw_info (0, __FILE__, __LINE__,
"copy assignment operator (homogenous tuples)");
- EmptyTuple et1, et2; et2 = et1;
- IntTuple it1, it2; it2 = it1;
- //ConstIntTuple ct1, ct2; ct2 = ct1; // Can't assign to const element.
- PairTuple pt1, pt2; pt2 = pt1;
- NestedTuple nt1, nt2; nt2 = nt1;
- BigTuple bt1, bt2; bt2 = bt1;
-
- UserClass::reset_totals ();
- UserTuple ut1, ut2; ut1 = ut2;
- rw_assert (2 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d default ctors, "
- "expected 2", UserClass::n_total_def_ctor_);
- rw_assert (0 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d copy ctors, "
- "expected 0", UserClass::n_total_copy_ctor_);
- rw_assert (1 == UserClass::n_total_op_assign_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d assign ops, "
- "expected 1", UserClass::n_total_op_assign_);
+ const std::tuple<> et1 = std::tuple<> ();
+ std::tuple<> et2;
+ et2 = et1;
+ _RWSTD_UNUSED (et2);
+
+ int i = std::rand ();
+ const std::tuple<int> it1 (i);
+ std::tuple<int> it2;
+ it2 = it1;
+ test (__LINE__, it2, i);
+
+ // copy assignment ill-formed for constant element types
+
+ const std::tuple<int&> rt1 (i);
+ int j = -1; // outside range of rand()
+ std::tuple<int&> rt2 (j); // note, different reference
+ rt2 = rt1;
+ test (__LINE__, rt2, i);
+
+ std::tuple<std::tuple<int> > nt1 (it1);
+ std::tuple<std::tuple<int> > nt2;
+ nt2 = nt1;
+ test (__LINE__, nt2, it1);
+
+ const std::tuple<long, const char*> pt1 (long (i), "string");
+ std::tuple<long, const char*> pt2;
+ pt2 = pt1;
+ test (__LINE__, pt2, long (i), (const char*) "string");
+
+ const UserDefined ud (i);
+ const std::tuple<UserDefined> ut1 (ud);
+ std::tuple<UserDefined> ut2;
+ UserDefined::reset ();
+ ut2 = ut1; ++UserDefined::expect.copy_asgn;
+ test (__LINE__, ut2, ud);
+
+ const std::tuple<bool, char, int, double, void*, UserDefined>
+ bt1 (true, 'a', i, 3.14159, (void* const) &i, ud);
+ ++UserDefined::expect.copy_ctor;
+ std::tuple<bool, char, int, double, void*, UserDefined> bt2;
+ ++UserDefined::expect.dflt_ctor;
+ bt2 = bt1; ++UserDefined::expect.copy_asgn;
+ test (__LINE__, bt2, true, 'a', i, 3.14159, (void* const) &i, ud);
}
/**************************************************************************/
@@ -214,45 +418,82 @@
rw_info (0, __FILE__, __LINE__,
"move assignment operator (homogenous tuples)");
- EmptyTuple et1, et2; et2 = et1;
- IntTuple it1, it2; it2 = it1;
- //ConstIntTuple ct1, ct2; ct2 = ct1; // Can't assign to const element.
- PairTuple pt1, pt2; pt2 = pt1;
- NestedTuple nt1, nt2; nt2 = nt1;
- BigTuple bt1, bt2; bt2 = bt1;
-
- UserClass::reset_totals ();
- UserTuple ut1, ut2; ut1 = ut2;
- rw_assert (2 == UserClass::n_total_def_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d default ctors, "
- "expected 2", UserClass::n_total_def_ctor_);
- rw_assert (0 == UserClass::n_total_copy_ctor_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d copy ctors, "
- "expected 0", UserClass::n_total_copy_ctor_);
- rw_assert (1 == UserClass::n_total_op_assign_, __FILE__, __LINE__,
- "tuple<UserClass>::tuple() called %d assign ops, "
- "expected 1", UserClass::n_total_op_assign_);
+ std::tuple<> et1, et2;
+ et2 = std::move (et1);
+ _RWSTD_UNUSED (et2);
+
+ int i = std::rand ();
+
+ std::tuple<int> it1 (i);
+ std::tuple<int> it2;
+ it2 = std::move (it1);
+ test (__LINE__, it2, i);
+
+ // move assignment ill-formed for constant element types
+
+ std::tuple<std::tuple<int> > nt1 (it2);
+ std::tuple<std::tuple<int> > nt2;
+ nt2 = std::move (nt1);
+ test (__LINE__, nt2, it2);
+
+ std::tuple<long, const char*> pt1 (1234567890L, "string");
+ std::tuple<long, const char*> pt2;
+ pt2 = std::move (pt1);
+ test (__LINE__, pt2, 1234567890L, (const char*) "string");
+
+ const UserDefined ud (i);
+ std::tuple<UserDefined> ut1 (ud);
+ std::tuple<UserDefined> ut2;
+ UserDefined::reset ();
+ ut2 = std::move (ut1); ++UserDefined::expect.move_asgn;
+ test (__LINE__, ut2, ud);
+
+ std::tuple<bool, char, int, double, void*, UserDefined>
+ bt1 (true, 'a', i, 3.14159, (void* const) &i, ud);
+ std::tuple<bool, char, int, double, void*, UserDefined> bt2;
+ UserDefined::reset ();
+ bt2 = std::move (bt1); ++UserDefined::expect.move_asgn;
+ test (__LINE__, bt2, true, 'a', i, 3.14159, (void* const) &i, ud);
}
/**************************************************************************/
+// heterogenous tests do not apply to empty tuples so no tests required
+
+#include <string>
+
+// need a string class with implicit conversion to type `const char*'
+struct String: public std::string
+{
+ String (): std::string () {}
+ String (const char* s): std::string (s) {}
+ operator const char* () const { return this->data (); }
+};
+
+
static void
test_hetero_copy_ctor ()
{
rw_info (0, __FILE__, __LINE__,
"copy constructor (heterogenous tuples)");
- const int i1 = 0; const char c = 'a'; const double d = 1.2;
- void* const p = 0; UserClass uc;
- BigTuple bt1 (i1, c, i1, d, p, uc); _RWSTD_UNUSED (bt1);
+ int i = std::rand () % CHAR_MAX;
- const bool b = true; const int i2 = 'a';
- BigTuple bt2 (b, i2, i1, d, p, uc); _RWSTD_UNUSED (bt2);
-
- const float f = 1.2;
- BigTuple bt3 (b, c, i1, f, p, uc); _RWSTD_UNUSED (bt3);
-
- //UserTuple
+ const std::tuple<char> cit (static_cast<char> (i));
+ std::tuple<int> it (cit);
+ test (__LINE__, it, i);
+
+ std::tuple<unsigned, String> cpt (12345U, "string");
+ std::tuple<long, const char*> pt (cpt);
+ test (__LINE__, pt, 12345U, (const char*) "string");
+
+ char s [] = "string"; const UserDefined ud (i);
+ const std::tuple<int, int, short, float, char*, UserDefined>
+ cbt (int (true), int ('a'), short (i), 3.14159f, s, ud);
+ UserDefined::reset ();
+ std::tuple<bool, char, int, double, void*, UserDefined> bt (cbt);
+ ++UserDefined::expect.copy_ctor;
+ test (__LINE__, bt, true, 'a', i, 3.14159f, s, ud);
}
/**************************************************************************/
@@ -263,14 +504,24 @@
rw_info (0, __FILE__, __LINE__,
"move constructor (heterogenous tuples)");
- //EmptyTuple
- //IntTuple
- //ConstIntTuple;
- //PairTuple
- //NestedTuple
+ int i = std::rand () % CHAR_MAX;
- //UserTuple
- // BigTuple
+ std::tuple<char> cit (static_cast<char> (i));
+ std::tuple<int> it (std::move (cit));
+ test (__LINE__, it, i);
+
+ std::tuple<unsigned, String> cpt (12345U, "string");
+ std::tuple<long, const char*> pt (std::move (cpt));
+ test (__LINE__, pt, 12345U, (const char*) "string");
+
+ char s [] = "string"; const UserDefined ud (i);
+ std::tuple<int, int, short, float, char*, UserDefined>
+ cbt (int (true), int ('a'), short (i), 3.14159f, s, ud);
+ UserDefined::reset ();
+ std::tuple<bool, char, int, double, void*, UserDefined>
+ bt (std::move (cbt));
+ ++UserDefined::expect.move_ctor;
+ test (__LINE__, bt, true, 'a', i, 3.14159f, s, ud);
}
/**************************************************************************/
@@ -281,14 +532,25 @@
rw_info (0, __FILE__, __LINE__,
"copy assignment operator (heterogenous tuples)");
- //EmptyTuple
- //IntTuple
- //ConstIntTuple;
- //PairTuple
- //NestedTuple
+ int i = std::rand () % CHAR_MAX;
- //UserTuple
- // BigTuple
+ std::tuple<char> cit (static_cast<char> (i));
+ std::tuple<int> it;
+ it = cit;
+ test (__LINE__, it, i);
+
+ std::tuple<unsigned, String> cpt (12345U, "string");
+ std::tuple<long, const char*> pt;
+ pt = cpt;
+ test (__LINE__, pt, 12345U, (const char*) "string");
+
+ char s [] = "string"; const UserDefined ud (i);
+ std::tuple<int, int, short, float, char*, UserDefined>
+ cbt (int (true), int ('a'), short (i), 3.14159f, s, ud);
+ std::tuple<bool, char, int, double, void*, UserDefined> bt;
+ UserDefined::reset ();
+ bt = cbt; ++UserDefined::expect.copy_asgn;
+ test (__LINE__, bt, true, 'a', i, 3.14159f, s, ud);
}
/**************************************************************************/
@@ -299,20 +561,30 @@
rw_info (0, __FILE__, __LINE__,
"move assignment operator (heterogenous tuples)");
- //EmptyTuple
- //IntTuple
- //ConstIntTuple;
- //PairTuple
- //NestedTuple
+ int i = std::rand () % CHAR_MAX;
- //UserTuple
- // BigTuple
+ std::tuple<char> cit (i);
+ std::tuple<int> it;
+ it = std::move (cit);
+ test (__LINE__, it, i);
+
+ std::tuple<unsigned, String> cpt (12345U, "string");
+ std::tuple<long, const char*> pt;
+ pt = std::move (cpt);
+ test (__LINE__, pt, 12345U, (const char*) "string");
+
+ char s [] = "string"; const UserDefined ud (i);
+ std::tuple<int, int, short, float, char*, UserDefined>
+ cbt (int (true), int ('a'), short (i), 3.14159f, s, ud);
+ std::tuple<bool, char, int, double, void*, UserDefined> bt;
+ ++UserDefined::expect.move_ctor;
+ UserDefined::reset ();
+ bt = std::move (cbt); ++UserDefined::expect.move_asgn;
+ test (__LINE__, bt, true, 'a', i, 3.14159f, s, ud);
}
/**************************************************************************/
-#include <rw_allocator.h> // for UserAlloc
-
static void
test_alloc_ctors ()
{
@@ -324,7 +596,7 @@
/**************************************************************************/
static int
-run_test (int /*unused*/, char* /*unused*/ [])
+run_test (int /*argc*/, char* /*argv*/ [])
{
test_default_ctor ();
@@ -346,6 +618,29 @@
return 0;
}
+#else // _RWSTD_NO_EXT_CXX_0X || _RWSTD_NO_RVALUE_REFERENCES
+
+static int
+run_test (int, char*[])
+{
+#if defined (_RWSTD_NO_EXT_CXX_OX)
+
+ rw_warn (0, 0, __LINE__,
+ "test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
+
+#elif defined (_RWSTD_NO_RVALUE_REFERENCES)
+
+ rw_warn (0, 0, __LINE__,
+ "test disabled because _RWSTD_NO_RVALUE_REFERENCES is "
+ "defined");
+
+#endif
+
+ return 0;
+}
+
+#endif // _RWSTD_NO_EXT_CXX_0X || _RWSTD_NO_RVALUE_REFERENCES
+
/*extern*/ int
main (int argc, char* argv [])
{
|