stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r667365 [3/3] - in /stdcxx/branches/4.3.x: etc/config/src/ include/ include/rw/ tests/utilities/
Date Fri, 13 Jun 2008 05:53:52 GMT
Added: stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.ref.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.ref.cpp?rev=667365&view=auto
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.ref.cpp (added)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.ref.cpp Thu Jun 12 22:53:51 2008
@@ -0,0 +1,143 @@
+// -*- C++ -*-
+/***************************************************************************
+ *
+ * 20.meta.trans.ref.cpp - test exercising meta.trans.ref
+ *
+ * $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 1999-2008 Rogue Wave Software, Inc.
+ *
+ **************************************************************************/
+
+#include <rw_driver.h>
+
+// compile out all test code if extensions disabled
+#ifndef _RWSTD_NO_EXT_CXX_0X
+
+#include <type_traits>
+
+/**************************************************************************/
+
+class class_t;
+
+void test_trait (int line, const char* trait,
+                 const char* typeT, const char* typeU,
+                 bool success)
+{
+    rw_assert (success, 0, line,
+               "%s<%s>::type is %{?}exactly%{:}not%{;} %s",
+               trait, typeT, success, typeU);
+}
+
+#define TEST(Trait,TypeT,TypeU)                                      \
+    test_trait(__LINE__, #Trait, #TypeT, #TypeU,                     \
+               std::is_same<Trait<TypeT>::type, TypeU>::value)
+
+/**************************************************************************/
+
+static void test_add_lvalue_reference ()
+{
+    TEST (std::add_lvalue_reference, int, int&);
+    TEST (std::add_lvalue_reference, int&, int&);
+
+    TEST (std::add_lvalue_reference, void, void);
+
+    TEST (std::add_lvalue_reference, int const     [1], int const (&) [1]);
+    TEST (std::add_lvalue_reference, int const (&) [1], int const (&) [1]);
+
+    TEST (std::add_lvalue_reference, int const * volatile,
+                                      int const * volatile &);
+    TEST (std::add_lvalue_reference, int const * volatile &,
+                                      int const * volatile &);
+
+    TEST (std::add_lvalue_reference, int (), int (&)());
+    TEST (std::add_lvalue_reference, int (&)(), int (&)());
+
+    TEST (std::add_lvalue_reference, int (class_t::*), int (class_t::*&));
+    TEST (std::add_lvalue_reference, int (class_t::*)(), int (class_t::*&)());
+}
+
+static void test_add_rvalue_reference ()
+{
+#ifndef _RWSTD_NO_RVALUE_REFERENCE
+
+#else
+    rw_warn (0, 0, __LINE__,
+             "rvalue references are not supported");
+#endif   // _RWSTD_NO_RVALUE_REFERENCE
+}
+
+static void test_remove_reference ()
+{
+    TEST(std::remove_reference, int, int);
+    TEST(std::remove_reference, int&, int);
+    
+    TEST(std::remove_reference, int const [], int const []);
+    TEST(std::remove_reference, int const (&) [1], int const [1]);
+
+    TEST(std::remove_reference, int const * volatile,
+                                 int const * volatile);
+    TEST(std::remove_reference, int const * volatile &,
+                                 int const * volatile);
+
+    TEST (std::remove_reference, int (), int ());
+    TEST (std::remove_reference, int (&)(), int ());
+
+    TEST (std::remove_reference, int (class_t::*&), int (class_t::*));
+    TEST (std::remove_reference, int (class_t::*&)(), int (class_t::*)());
+}
+
+/**************************************************************************/
+
+static int run_test (int, char*[])
+{
+    test_add_lvalue_reference ();
+    test_add_rvalue_reference ();
+    test_remove_reference ();
+
+    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
+
+/**************************************************************************/
+
+int main (int argc, char *argv[])
+{
+    return rw_test (argc, argv, __FILE__,
+                    "meta.trans.ref",
+                    0 /* no comment */,
+                    run_test,
+                    0);
+}

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.ref.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.ref.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Added: stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.sign.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.sign.cpp?rev=667365&view=auto
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.sign.cpp (added)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.sign.cpp Thu Jun 12 22:53:51 2008
@@ -0,0 +1,295 @@
+// -*- C++ -*-
+/***************************************************************************
+ *
+ * 20.meta.trans.sign.cpp - test exercising meta.trans.sign
+ *
+ * $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 1999-2008 Rogue Wave Software, Inc.
+ *
+ **************************************************************************/
+
+#include <rw_driver.h>
+
+// compile out all test code if extensions disabled
+#ifndef _RWSTD_NO_EXT_CXX_0X
+
+#include <type_traits>
+
+/**************************************************************************/
+
+template <class T, class U>
+struct test_is_same
+{
+    enum { value = 0 };
+};
+
+template <class T>
+struct test_is_same<T,T>
+{
+    enum { value = 1 };
+};
+
+template <class T>
+int test_cv_qual (T&) {
+    return 0;
+}
+
+template <class T>
+int test_cv_qual (const T&) {
+    return 1;
+}
+
+template <class T>
+int test_cv_qual (volatile T&) {
+    return 2;
+}
+
+template <class T>
+int test_cv_qual (const volatile T&) {
+    return 3;
+}
+
+enum enum_SS { Ess_v = _RWSTD_SCHAR_MAX };
+enum enum_MS { Ems_v = _RWSTD_INT_MAX   };
+enum enum_LS { Els_v = _RWSTD_LONG_MAX  };
+
+enum enum_SU { Esu_v = _RWSTD_UCHAR_MAX };
+enum enum_MU { Emu_v = _RWSTD_UINT_MAX  };
+enum enum_LU { Elu_v = _RWSTD_ULONG_MAX };
+
+/**************************************************************************/
+
+const char* get_type_name (const volatile void*)
+{
+    return "unknown";
+};
+
+#define _RETURN_TYPE_NAME(T)                                         \
+    const char* get_type_name (T*) { return #T; }
+
+#define _RETURN_TYPE_NAME_CV(T)                                      \
+    _RETURN_TYPE_NAME(T)                                             \
+    _RETURN_TYPE_NAME(const T)                                       \
+    _RETURN_TYPE_NAME(volatile T)                                    \
+    _RETURN_TYPE_NAME(const volatile T)
+
+_RETURN_TYPE_NAME_CV(bool)
+_RETURN_TYPE_NAME_CV(char)
+
+#ifndef _RWSTD_NO_WCHAR_T
+_RETURN_TYPE_NAME_CV(wchar_t)
+#endif // _RWSTD_NO_WCHAR_T
+
+_RETURN_TYPE_NAME_CV(  signed char)
+_RETURN_TYPE_NAME_CV(unsigned char)
+
+_RETURN_TYPE_NAME_CV(  signed short)
+_RETURN_TYPE_NAME_CV(unsigned short)
+
+_RETURN_TYPE_NAME_CV(  signed int)
+_RETURN_TYPE_NAME_CV(unsigned int)
+
+_RETURN_TYPE_NAME_CV(  signed long)
+_RETURN_TYPE_NAME_CV(unsigned long)
+
+#ifndef _RWSTD_NO_LONG_LONG
+_RETURN_TYPE_NAME_CV(  signed long long)
+_RETURN_TYPE_NAME_CV(unsigned long long)
+#endif // _RWSTD_NO_LONG_LONG
+
+void test_trait (int line, bool same,
+                 const char* trait,
+                 const char* typeT,
+                 const char* typeU,
+                 const char* typeV)
+{
+    rw_assert (same, 0, line,
+               "%s<%s>::type is%{?}n't%{;} %s; got %s",
+               trait, typeT, !same, typeU, typeV);
+}
+
+#define _TEST(Trait,TypeT,TypeU)                                     \
+    test_trait(__LINE__,                                             \
+               std::is_same<Trait<TypeT>::type, TypeU>::value,       \
+               #Trait, #TypeT, #TypeU, get_type_name((Trait<TypeT>::type*)0))
+
+#define TEST(Trait,TypeT,TypeU)                                      \
+    _TEST(Trait, TypeT, TypeU);                                      \
+    _TEST(Trait, const TypeT, const TypeU);                          \
+    _TEST(Trait, volatile TypeT, volatile TypeU);                    \
+    _TEST(Trait, const volatile TypeT, const volatile TypeU)
+
+
+
+void test_sign_and_cv (int line,
+                       const char* trait_name,
+                       const char* type_name,
+                       size_t got_size, size_t exp_size,
+                       bool got_sign, bool exp_sign,
+                       bool got_c, bool exp_c,
+                       bool got_v, bool exp_v)
+{
+    const char* qualifiers[] = {
+        "unqualified", "const", "volatile", "cv-qualified"
+    };
+
+    const unsigned got_cv = got_c + (got_v << 1);
+    const unsigned exp_cv = exp_c + (exp_v << 1);
+
+    const bool success =    got_size == exp_size
+                         && got_cv   == exp_cv
+                         && got_sign == exp_sign;
+
+    rw_assert (success, 0, line,
+        "%s<%s>::type is a %zu-byte %s %{?}un%{;}signed type, "
+               "expected a %zu-byte %s %{?}un%{;}signed type.",
+        trait_name, type_name,
+        got_size, qualifiers[got_cv], !got_sign,
+        exp_size, qualifiers[exp_cv], !exp_sign);
+}
+
+#define _TEST_SIGN_AND_CV(Trait,Type,Signed)                         \
+    test_sign_and_cv(__LINE__, #Trait, #Type,                        \
+        sizeof (Trait<Type>::type),                                  \
+        sizeof (Type),                                               \
+        std::is_signed<Trait<Type>::type>::value,                    \
+        Signed,                                                      \
+        std::is_const<Trait<Type>::type>::value,                     \
+        std::is_const<Type>::value,                                  \
+        std::is_volatile<Trait<Type>::type>::value,                  \
+        std::is_volatile<Type>::value)
+
+#define TEST_MAKE_SIGNED(Type)                                         \
+    _TEST_SIGN_AND_CV (std::make_signed, Type, true);                  \
+    _TEST_SIGN_AND_CV (std::make_signed, const Type, true);            \
+    _TEST_SIGN_AND_CV (std::make_signed, volatile Type, true);         \
+    _TEST_SIGN_AND_CV (std::make_signed, const volatile Type, true)
+
+#define TEST_MAKE_UNSIGNED(Type)                                       \
+    _TEST_SIGN_AND_CV (std::make_unsigned, Type, false);               \
+    _TEST_SIGN_AND_CV (std::make_unsigned, const Type, false);         \
+    _TEST_SIGN_AND_CV (std::make_unsigned, volatile Type, false);      \
+    _TEST_SIGN_AND_CV (std::make_unsigned, const volatile Type, false)
+
+/**************************************************************************/
+
+static void test_make_signed ()
+{
+    TEST (std::make_signed,   signed char, signed char);
+    TEST (std::make_signed, unsigned char, signed char);
+
+    TEST (std::make_signed,   signed short, signed short);
+    TEST (std::make_signed, unsigned short, signed short);
+
+    TEST (std::make_signed,   signed int, signed int);
+    TEST (std::make_signed, unsigned int, signed int);
+
+    TEST (std::make_signed,   signed long, signed long);
+    TEST (std::make_signed, unsigned long, signed long);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::make_signed,   signed long long, signed long long);
+    TEST (std::make_signed, unsigned long long, signed long long);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    TEST_MAKE_SIGNED (char);
+
+#ifndef _RWSTD_NO_NATIVE_WCHAR_T
+    TEST_MAKE_SIGNED (wchar_t);
+#endif   // _RWSTD_NO_NATIVE_WCHAR_T
+
+    TEST_MAKE_SIGNED (enum_SS);
+    TEST_MAKE_SIGNED (enum_MS);
+    TEST_MAKE_SIGNED (enum_LS);
+    TEST_MAKE_SIGNED (enum_SU);
+    TEST_MAKE_SIGNED (enum_MU);
+    TEST_MAKE_SIGNED (enum_LU);
+}
+
+static void test_make_unsigned ()
+{
+    TEST (std::make_unsigned,   unsigned char, unsigned char);
+    TEST (std::make_unsigned, ununsigned char, unsigned char);
+
+    TEST (std::make_unsigned,   unsigned short, unsigned short);
+    TEST (std::make_unsigned, ununsigned short, unsigned short);
+
+    TEST (std::make_unsigned,   unsigned int, unsigned int);
+    TEST (std::make_unsigned, ununsigned int, unsigned int);
+
+    TEST (std::make_unsigned,   unsigned long, unsigned long);
+    TEST (std::make_unsigned, ununsigned long, unsigned long);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::make_unsigned,   unsigned long long, unsigned long long);
+    TEST (std::make_unsigned, ununsigned long long, unsigned long long);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    TEST_MAKE_UNSIGNED (char);
+
+#ifndef _RWSTD_NO_NATIVE_WCHAR_T
+    TEST_MAKE_UNSIGNED (wchar_t);
+#endif   // _RWSTD_NO_NATIVE_WCHAR_T
+
+    TEST_MAKE_UNSIGNED (enum_SS);
+    TEST_MAKE_UNSIGNED (enum_MS);
+    TEST_MAKE_UNSIGNED (enum_LS);
+    TEST_MAKE_UNSIGNED (enum_SU);
+    TEST_MAKE_UNSIGNED (enum_MU);
+    TEST_MAKE_UNSIGNED (enum_LU);
+}
+
+/**************************************************************************/
+
+static int run_test (int, char*[])
+{
+    test_make_signed ();
+    test_make_unsigned ();
+
+    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
+
+/**************************************************************************/
+
+int main (int argc, char *argv[])
+{
+    return rw_test (argc, argv, __FILE__,
+                    "meta.trans.sign",
+                    0 /* no comment */,
+                    run_test,
+                    0);
+}

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.sign.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.sign.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Added: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp?rev=667365&view=auto
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp (added)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp Thu Jun 12 22:53:51 2008
@@ -0,0 +1,307 @@
+// -*- C++ -*-
+/***************************************************************************
+ *
+ * 20.meta.unary.cat.cpp - test exercising meta.unary.cat
+ *
+ * $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 1999-2008 Rogue Wave Software, Inc.
+ *
+ **************************************************************************/
+
+#include <rw_driver.h>
+
+// compile out all test code if extensions disabled
+#ifndef _RWSTD_NO_EXT_CXX_0X
+
+#include <type_traits>
+
+/**************************************************************************/
+
+static void
+test_trait (int line,
+            const char* trait_name, const char* type_name,
+            size_t count, bool value)
+{
+    // verify that the expected trait is actually working
+
+    if (rw_assert (value != false, 0, __LINE__,
+                   "%s<%s>::value was %b, expected true",
+                   trait_name, type_name, value))
+    {
+
+        // [meta.unary.cat p3] for any given type T, exactly one of the
+        // primary type categories has a value member that evaluates to
+        // true
+
+        rw_assert (count == 1, 0, line,
+                   "%s evaluated true for %zu traits, expected 1",
+                   type_name, count);
+    }
+}
+
+#define _TEST(Trait,Type)                                            \
+    test_trait(__LINE__, #Trait, #Type,                              \
+          std::is_void<Type>::value                                  \
+        + std::is_integral<Type>::value                              \
+        + std::is_floating_point<Type>::value                        \
+        + std::is_array<Type>::value                                 \
+        + std::is_pointer<Type>::value                               \
+        + std::is_lvalue_reference<Type>::value                      \
+        + std::is_rvalue_reference<Type>::value                      \
+        + std::is_member_object_pointer<Type>::value                 \
+        + std::is_member_function_pointer<Type>::value               \
+        + std::is_enum<Type>::value                                  \
+        + std::is_union<Type>::value                                 \
+        + std::is_class<Type>::value                                 \
+        + std::is_function<Type>::value,                             \
+        Trait<Type>::value)
+
+#if 0
+
+#define TEST(Trait,Type)                                             \
+    _TEST(Trait, Type);                                              \
+    _TEST(Trait, std::add_const<Type>::type);                        \
+    _TEST(Trait, std::add_volatile<Type>::type);                     \
+    _TEST(Trait, std::add_cv<Type>::type)
+
+#else
+
+#define TEST(Trait,Type)                                             \
+    _TEST(Trait, Type)
+
+#endif
+
+/**************************************************************************/
+
+class class_t {
+    int i_; float f_;
+};
+
+struct struct_t {
+    int i_; float f_;
+};
+
+union union_t {
+    int i_; float f_;
+};
+
+enum enum_t {
+    E_a, E_b, E_c
+};
+
+/**************************************************************************/
+
+static void test_is_void ()
+{
+    TEST(std::is_void, void);
+}
+
+static void test_is_integral ()
+{
+    TEST(std::is_integral, bool);
+    TEST(std::is_integral, char);
+
+#ifndef _RWSTD_NO_WCHAR_T
+    TEST(std::is_integral, wchar_t);
+#endif   // _RWSTD_NO_WCHAR_T
+
+    TEST(std::is_integral,   signed char);
+    TEST(std::is_integral, unsigned char);
+
+    TEST(std::is_integral,   signed short);
+    TEST(std::is_integral, unsigned short);
+
+    TEST(std::is_integral,   signed int);
+    TEST(std::is_integral, unsigned int);
+
+    TEST(std::is_integral,   signed long);
+    TEST(std::is_integral, unsigned long);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST(std::is_integral,   signed long long);
+    TEST(std::is_integral, unsigned long long);
+#endif   // _RWSTD_NO_LONG_LONG
+}
+
+static void test_is_floating_point ()
+{
+    TEST(std::is_floating_point, float);
+    TEST(std::is_floating_point, double);
+    TEST(std::is_floating_point, long double);
+}
+
+static void test_is_array ()
+{
+    TEST(std::is_array, char []);
+    TEST(std::is_array, char [10]);
+    TEST(std::is_array, char [][10]);
+    TEST(std::is_array, char [10][10]);
+}
+
+static void test_is_pointer ()
+{
+    TEST(std::is_pointer, char* const);
+    TEST(std::is_pointer, char const*);
+    TEST(std::is_pointer, const char*);
+
+    TEST(std::is_pointer, char*);
+    TEST(std::is_pointer, char (*)[]);
+    TEST(std::is_pointer, char (*)());
+}
+
+static void test_is_lvalue_reference ()
+{
+    TEST(std::is_lvalue_reference, char&);            // reference
+
+    TEST(std::is_lvalue_reference, void (&)());       // function reference
+    TEST(std::is_lvalue_reference, void (&)(int));    // function reference
+
+#ifdef _ILL_FORMED
+    TEST(std::is_lvalue_reference, long (&)[]);       // array reference
+    TEST(std::is_lvalue_reference, long (&)[][10]);   // array reference
+#endif
+
+    TEST(std::is_lvalue_reference, long (&)[10]);     // array reference
+    TEST(std::is_lvalue_reference, long (&)[10][10]); // array reference
+}
+
+static void test_is_rvalue_reference ()
+{
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
+    TEST(std::is_rvalue_reference, char&&);
+#else
+    rw_warn (0, 0, __LINE__,
+             "no compiler support for rvalue references; test disabled");
+#endif   // _RWSTD_NO_RVALUE_REFERENCES
+}
+
+static void test_is_member_object_pointer ()
+{
+    TEST (std::is_member_object_pointer, long (class_t::*));
+    TEST (std::is_member_object_pointer, long (struct_t::*));
+    TEST (std::is_member_object_pointer, long (union_t::*));
+}
+
+static void test_is_member_function_pointer ()
+{
+    // arity 0
+    TEST (std::is_member_function_pointer, long (class_t:: *)());
+    TEST (std::is_member_function_pointer, long (struct_t::*)());
+    TEST (std::is_member_function_pointer, long (union_t:: *)());
+
+    // arity 1
+    TEST (std::is_member_function_pointer, long (class_t:: *)(int));
+    TEST (std::is_member_function_pointer, long (struct_t::*)(int));
+    TEST (std::is_member_function_pointer, long (union_t:: *)(int));
+
+    // arity 2
+    TEST (std::is_member_function_pointer, 
+             long (class_t:: *)(int, char));
+    TEST (std::is_member_function_pointer,
+             long (struct_t::*)(int, char));
+    TEST (std::is_member_function_pointer,
+             long (union_t:: *)(int, char));
+
+    // arity 12
+    TEST (std::is_member_function_pointer,
+             long (class_t:: *)(char, short, int, long, float, double,
+                                char, short, int, long, float, double));
+    TEST (std::is_member_function_pointer,
+             long (struct_t::*)(char, short, int, long, float, double,
+                                char, short, int, long, float, double));
+    TEST (std::is_member_function_pointer,
+             long (union_t:: *)(char, short, int, long, float, double,
+                                char, short, int, long, float, double));
+}
+
+static void test_is_enum ()
+{
+    TEST (std::is_enum, enum_t);
+}
+
+static void test_is_union ()
+{
+    TEST (std::is_union, union_t);
+}
+
+static void test_is_class ()
+{
+    TEST (std::is_class, class_t);
+    TEST (std::is_class, struct_t);
+}
+
+static void test_is_function ()
+{
+    TEST (std::is_function, void ());
+    TEST (std::is_function, long (int));
+    TEST (std::is_function, long (int, char));
+    TEST (std::is_function, long (int, char));
+}
+
+
+/**************************************************************************/
+
+static int run_test (int, char*[])
+{
+    test_is_void ();
+    test_is_integral ();
+    test_is_floating_point ();
+    test_is_array ();
+    test_is_pointer ();
+    test_is_lvalue_reference ();
+    test_is_rvalue_reference ();
+    test_is_member_object_pointer ();
+    test_is_member_function_pointer ();
+    test_is_enum ();
+    test_is_union ();
+    test_is_class ();
+    test_is_function ();
+
+    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
+
+/**************************************************************************/
+
+int main (int argc, char *argv[])
+{
+    return rw_test (argc, argv, __FILE__,
+                    "meta.unary.cat",
+                    0 /* no comment */,
+                    run_test,
+                    0);
+}
+

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Added: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.comp.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.comp.cpp?rev=667365&view=auto
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.comp.cpp (added)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.comp.cpp Thu Jun 12 22:53:51 2008
@@ -0,0 +1,675 @@
+// -*- C++ -*-
+/***************************************************************************
+ *
+ * 20.meta.unary.comp.cpp - test exercising meta.unary.comp
+ *
+ * $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 1999-2008 Rogue Wave Software, Inc.
+ *
+ **************************************************************************/
+
+#include <rw_driver.h>
+
+// compile out all test code if extensions disabled
+#ifndef _RWSTD_NO_EXT_CXX_0X
+
+#include <type_traits>
+
+/**************************************************************************/
+
+class class_t {
+    long l_; float f_;
+};
+
+struct struct_t {
+    long l_; float f_;
+};
+
+union union_t {
+    long l_; float f_;
+};
+
+enum enum_t {
+    E_a, E_b, E_c
+};
+
+/**************************************************************************/
+
+void test_trait (int line, bool value, bool expect,
+                 const char* trait, const char* type)
+{
+    rw_assert (value == expect, 0, line,
+               "%s<%s> is %b, expected %b",
+               trait, type, value, expect);
+}
+
+#define _TEST(Trait,Type,Expect)                                     \
+    test_trait (__LINE__, Trait<Type>::value, Expect, #Trait, #Type)                  
+
+#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)
+
+/**************************************************************************/
+
+void test_is_arithmetic ()
+{
+    // void
+    TEST (std::is_arithmetic, void, false);
+
+    // integral
+    TEST (std::is_arithmetic,          bool, true);
+
+    TEST (std::is_arithmetic,          char, true);
+    TEST (std::is_arithmetic,   signed char, true);
+    TEST (std::is_arithmetic, unsigned char, true);
+
+#ifndef _RWSTD_NO_WCHAR_T
+    TEST (std::is_arithmetic,       wchar_t, true);
+#endif   // _RWSTD_NO_WCHAR_T
+
+    TEST (std::is_arithmetic,          short, true);
+    TEST (std::is_arithmetic,   signed short, true);
+    TEST (std::is_arithmetic, unsigned short, true);
+
+    TEST (std::is_arithmetic,          int, true);
+    TEST (std::is_arithmetic,   signed int, true);
+    TEST (std::is_arithmetic, unsigned int, true);
+
+    TEST (std::is_arithmetic,          long, true);
+    TEST (std::is_arithmetic,   signed long, true);
+    TEST (std::is_arithmetic, unsigned long, true);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_arithmetic,          long long, true);
+    TEST (std::is_arithmetic,   signed long long, true);
+    TEST (std::is_arithmetic, unsigned long long, true);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    // floating point
+    TEST (std::is_arithmetic,       float, true);
+    TEST (std::is_arithmetic,      double, true);
+    TEST (std::is_arithmetic, long double, true);
+
+    // array
+    TEST (std::is_arithmetic, long [4], false);
+    TEST (std::is_arithmetic, float [3][3], false);
+    TEST (std::is_arithmetic, char* [4], false);
+    TEST (std::is_arithmetic, class_t [], false);
+    TEST (std::is_arithmetic, struct_t [][2], false);
+
+    // pointer
+    TEST (std::is_arithmetic, long*, false);
+    TEST (std::is_arithmetic, char**, false);
+
+    // reference
+    TEST (std::is_arithmetic, int&, false);
+    TEST (std::is_arithmetic, union_t&, false);
+    TEST (std::is_arithmetic, class_t&, false);
+    TEST (std::is_arithmetic, union_t&, false);
+    TEST (std::is_arithmetic, class_t&, false);
+    TEST (std::is_arithmetic, double&, false);
+
+    // pointer to member
+    TEST (std::is_arithmetic, long (class_t::*), false);
+    TEST (std::is_arithmetic, int (struct_t::*), false);
+
+    // pointer to member function
+    TEST (std::is_arithmetic, double (class_t::*)(), false);
+    TEST (std::is_arithmetic, long (class_t::*)(float), false);
+    TEST (std::is_arithmetic, double (struct_t::*)(), false);
+    TEST (std::is_arithmetic, long (struct_t::*)(float), false);
+    
+    // enumeration
+    TEST (std::is_arithmetic, enum_t, false);
+
+    // union
+    TEST (std::is_arithmetic, union_t, false);
+
+    // class
+    TEST (std::is_arithmetic, class_t, false);
+    TEST (std::is_arithmetic, struct_t, false);
+
+    // function
+    TEST (std::is_arithmetic, long (), false);
+    TEST (std::is_arithmetic, float (char), false);
+
+    // function pointer
+    TEST (std::is_arithmetic, long (*)(), false);
+    TEST (std::is_arithmetic, double (*)(int), false);
+
+    // function reference
+    TEST (std::is_arithmetic, long (&)(), false);
+
+    // member function reference
+    //TEST (std::is_arithmetic, long (class_t::&), false);
+}
+
+void test_is_fundamental ()
+{
+    // void
+    TEST (std::is_fundamental, void, true);
+
+    // integral
+    TEST (std::is_fundamental,          bool, true);
+
+    TEST (std::is_fundamental,          char, true);
+    TEST (std::is_fundamental,   signed char, true);
+    TEST (std::is_fundamental, unsigned char, true);
+
+#ifndef _RWSTD_NO_WCHAR_T
+    TEST (std::is_fundamental,       wchar_t, true);
+#endif   // _RWSTD_NO_WCHAR_T
+
+    TEST (std::is_fundamental,          short, true);
+    TEST (std::is_fundamental,   signed short, true);
+    TEST (std::is_fundamental, unsigned short, true);
+
+    TEST (std::is_fundamental,          int, true);
+    TEST (std::is_fundamental,   signed int, true);
+    TEST (std::is_fundamental, unsigned int, true);
+
+    TEST (std::is_fundamental,          long, true);
+    TEST (std::is_fundamental,   signed long, true);
+    TEST (std::is_fundamental, unsigned long, true);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_fundamental,          long long, true);
+    TEST (std::is_fundamental,   signed long long, true);
+    TEST (std::is_fundamental, unsigned long long, true);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    // floating point
+    TEST (std::is_fundamental,       float, true);
+    TEST (std::is_fundamental,      double, true);
+    TEST (std::is_fundamental, long double, true);
+
+    // array
+    TEST (std::is_fundamental, long [4], false);
+    TEST (std::is_fundamental, float [3][3], false);
+    TEST (std::is_fundamental, char* [4], false);
+    TEST (std::is_fundamental, class_t [], false);
+    TEST (std::is_fundamental, struct_t [][2], false);
+
+    // pointer
+    TEST (std::is_fundamental, long*, false);
+    TEST (std::is_fundamental, char**, false);
+
+    // reference
+    TEST (std::is_fundamental, int&, false);
+    TEST (std::is_fundamental, union_t&, false);
+    TEST (std::is_fundamental, class_t&, false);
+    TEST (std::is_fundamental, union_t&, false);
+    TEST (std::is_fundamental, class_t&, false);
+    TEST (std::is_fundamental, double&, false);
+
+    // pointer to member
+    TEST (std::is_fundamental, long (class_t::*), false);
+    TEST (std::is_fundamental, int (struct_t::*), false);
+
+    // pointer to member function
+    TEST (std::is_fundamental, double (class_t::*)(), false);
+    TEST (std::is_fundamental, long (class_t::*)(float), false);
+    TEST (std::is_fundamental, double (struct_t::*)(), false);
+    TEST (std::is_fundamental, long (struct_t::*)(float), false);
+    
+    // enumeration
+    TEST (std::is_fundamental, enum_t, false);
+
+    // union
+    TEST (std::is_fundamental, union_t, false);
+
+    // class
+    TEST (std::is_fundamental, class_t, false);
+    TEST (std::is_fundamental, struct_t, false);
+
+    // function
+    TEST (std::is_fundamental, long (), false);
+    TEST (std::is_fundamental, float (char), false);
+
+    // function pointer
+    TEST (std::is_fundamental, long (*)(), false);
+    TEST (std::is_fundamental, double (*)(int), false);
+
+    // function reference
+    TEST (std::is_fundamental, long (&)(), false);
+
+    // member function reference
+    //TEST (std::is_fundamental, long (class_t::&), false);
+}
+
+void test_is_object ()
+{
+    // void
+    TEST (std::is_object, void, false);
+
+    // integral
+    TEST (std::is_object,          bool, false);
+
+    TEST (std::is_object,          char, true);
+    TEST (std::is_object,   signed char, true);
+    TEST (std::is_object, unsigned char, true);
+
+#ifndef _RWSTD_NO_WCHAR_T
+    TEST (std::is_object,       wchar_t, true);
+#endif   // _RWSTD_NO_WCHAR_T
+
+    TEST (std::is_object,          short, true);
+    TEST (std::is_object,   signed short, true);
+    TEST (std::is_object, unsigned short, true);
+
+    TEST (std::is_object,          int, true);
+    TEST (std::is_object,   signed int, true);
+    TEST (std::is_object, unsigned int, true);
+
+    TEST (std::is_object,          long, true);
+    TEST (std::is_object,   signed long, true);
+    TEST (std::is_object, unsigned long, true);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_object,          long long, true);
+    TEST (std::is_object,   signed long long, true);
+    TEST (std::is_object, unsigned long long, true);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    // floating point
+    TEST (std::is_object,       float, true);
+    TEST (std::is_object,      double, true);
+    TEST (std::is_object, long double, true);
+
+    // array
+    TEST (std::is_object, long [4], true);
+    TEST (std::is_object, float [3][3], true);
+    TEST (std::is_object, char* [4], true);
+    TEST (std::is_object, class_t [], true);
+    TEST (std::is_object, struct_t [][2], true);
+
+    // pointer
+    TEST (std::is_object, long*, true);
+    TEST (std::is_object, char**, true);
+
+    // reference
+    TEST (std::is_object, int&, false);
+    TEST (std::is_object, union_t&, false);
+    TEST (std::is_object, class_t&, false);
+    TEST (std::is_object, union_t&, false);
+    TEST (std::is_object, class_t&, false);
+    TEST (std::is_object, double&, false);
+
+    // pointer to member
+    TEST (std::is_object, long (class_t::*), true);
+    TEST (std::is_object, int (struct_t::*), true);
+
+    // pointer to member function
+    TEST (std::is_object, double (class_t::*)(), true);
+    TEST (std::is_object, long (class_t::*)(float), true);
+    TEST (std::is_object, double (struct_t::*)(), true);
+    TEST (std::is_object, long (struct_t::*)(float), true);
+    
+    // enumeration
+    TEST (std::is_object, enum_t, true);
+
+    // union
+    TEST (std::is_object, union_t, true);
+
+    // class
+    TEST (std::is_object, class_t, true);
+    TEST (std::is_object, struct_t, true);
+
+    // function
+    TEST (std::is_object, long (), false);
+    TEST (std::is_object, float (char), false);
+
+    // function pointer
+    TEST (std::is_object, long (*)(), true);
+    TEST (std::is_object, double (*)(int), true);
+
+    // function reference
+    TEST (std::is_object, long (&)(), false);
+
+    // member function reference
+    //TEST (std::is_object, long (class_t::&), false);
+}
+
+void test_is_scalar ()
+{
+    // void
+    TEST (std::is_scalar, void, false);
+
+    // integral
+    TEST (std::is_scalar,          bool, true);
+
+    TEST (std::is_scalar,          char, true);
+    TEST (std::is_scalar,   signed char, true);
+    TEST (std::is_scalar, unsigned char, true);
+
+#ifndef _RWSTD_NO_WCHAR_T
+    TEST (std::is_scalar,       wchar_t, true);
+#endif   // _RWSTD_NO_WCHAR_T
+
+    TEST (std::is_scalar,          short, true);
+    TEST (std::is_scalar,   signed short, true);
+    TEST (std::is_scalar, unsigned short, true);
+
+    TEST (std::is_scalar,          int, true);
+    TEST (std::is_scalar,   signed int, true);
+    TEST (std::is_scalar, unsigned int, true);
+
+    TEST (std::is_scalar,          long, true);
+    TEST (std::is_scalar,   signed long, true);
+    TEST (std::is_scalar, unsigned long, true);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_scalar,          long long, true);
+    TEST (std::is_scalar,   signed long long, true);
+    TEST (std::is_scalar, unsigned long long, true);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    // floating point
+    TEST (std::is_scalar,       float, true);
+    TEST (std::is_scalar,      double, true);
+    TEST (std::is_scalar, long double, true);
+
+    // array
+    TEST (std::is_scalar, long [4], false);
+    TEST (std::is_scalar, float [3][3], false);
+    TEST (std::is_scalar, char* [4], false);
+    TEST (std::is_scalar, class_t [], false);
+    TEST (std::is_scalar, struct_t [][2], false);
+
+    // pointer
+    TEST (std::is_scalar, long*, true);
+    TEST (std::is_scalar, char**, true);
+
+    // reference
+    TEST (std::is_scalar, int&, false);
+    TEST (std::is_scalar, union_t&, false);
+    TEST (std::is_scalar, class_t&, false);
+    TEST (std::is_scalar, union_t&, false);
+    TEST (std::is_scalar, class_t&, false);
+    TEST (std::is_scalar, double&, false);
+
+    // pointer to member
+    TEST (std::is_scalar, long (class_t::*), false);
+    TEST (std::is_scalar, int (struct_t::*), false);
+
+    // pointer to member function
+    TEST (std::is_scalar, double (class_t::*)(), true);
+    TEST (std::is_scalar, long (class_t::*)(float), true);
+    TEST (std::is_scalar, double (struct_t::*)(), true);
+    TEST (std::is_scalar, long (struct_t::*)(float), true);
+    
+    // enumeration
+    TEST (std::is_scalar, enum_t, true);
+
+    // union
+    TEST (std::is_scalar, union_t, false);
+
+    // class
+    TEST (std::is_scalar, class_t, false);
+    TEST (std::is_scalar, struct_t, false);
+
+    // function
+    TEST (std::is_scalar, long (), false);
+    TEST (std::is_scalar, float (char), false);
+
+    // function pointer
+    TEST (std::is_scalar, long (*)(), false);
+    TEST (std::is_scalar, double (*)(int), false);
+
+    // function reference
+    TEST (std::is_scalar, long (&)(), false);
+
+    // member function reference
+    //TEST (std::is_scalar, long (class_t::&), false);
+}
+
+void test_is_compound ()
+{
+// arrays, functions, pointers, references, classes, unions,
+// enumerations, pointer to non-static class members
+
+    // void
+    TEST (std::is_compound, void, false);
+
+    // integral
+    TEST (std::is_compound,          bool, false);
+
+    TEST (std::is_compound,          char, false);
+    TEST (std::is_compound,   signed char, false);
+    TEST (std::is_compound, unsigned char, false);
+
+#ifndef _RWSTD_NO_WCHAR_T
+    TEST (std::is_compound,       wchar_t, false);
+#endif   // _RWSTD_NO_WCHAR_T
+
+    TEST (std::is_compound,          short, false);
+    TEST (std::is_compound,   signed short, false);
+    TEST (std::is_compound, unsigned short, false);
+
+    TEST (std::is_compound,          int, false);
+    TEST (std::is_compound,   signed int, false);
+    TEST (std::is_compound, unsigned int, false);
+
+    TEST (std::is_compound,          long, false);
+    TEST (std::is_compound,   signed long, false);
+    TEST (std::is_compound, unsigned long, false);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_compound,          long long, false);
+    TEST (std::is_compound,   signed long long, false);
+    TEST (std::is_compound, unsigned long long, false);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    // floating point
+    TEST (std::is_compound,       float, false);
+    TEST (std::is_compound,      double, false);
+    TEST (std::is_compound, long double, false);
+
+    // array
+    TEST (std::is_compound, long [4], false);
+    TEST (std::is_compound, float [3][3], false);
+    TEST (std::is_compound, char* [4], false);
+    TEST (std::is_compound, class_t [], false);
+    TEST (std::is_compound, struct_t [][2], false);
+
+    // pointer
+    TEST (std::is_compound, long*, true);
+    TEST (std::is_compound, char**, true);
+
+    // reference
+    TEST (std::is_compound, int&, true);
+    TEST (std::is_compound, union_t&, true);
+    TEST (std::is_compound, class_t&, true);
+    TEST (std::is_compound, union_t&, true);
+    TEST (std::is_compound, class_t&, true);
+    TEST (std::is_compound, double&, true);
+
+    // pointer to member
+    TEST (std::is_compound, long (class_t::*), true);
+    TEST (std::is_compound, int (struct_t::*), true);
+
+    // pointer to member function
+    TEST (std::is_compound, double (class_t::*)(), true);
+    TEST (std::is_compound, long (class_t::*)(float), true);
+    TEST (std::is_compound, double (struct_t::*)(), true);
+    TEST (std::is_compound, long (struct_t::*)(float), true);
+    
+    // enumeration
+    TEST (std::is_compound, enum_t, true);
+
+    // union
+    TEST (std::is_compound, union_t, true);
+
+    // class
+    TEST (std::is_compound, class_t, true);
+    TEST (std::is_compound, struct_t, true);
+
+    // function
+    TEST (std::is_compound, long (), true);
+    TEST (std::is_compound, float (char), true);
+
+    // function pointer
+    TEST (std::is_compound, long (*)(), false);
+    TEST (std::is_compound, double (*)(int), false);
+
+    // function reference
+    TEST (std::is_compound, long (&)(), false);
+
+    // member function reference
+    //TEST (std::is_compound, long (class_t::&), false);
+}
+
+void test_is_member_pointer ()
+{
+    // void
+    TEST (std::is_member_pointer, void, false);
+
+    // integral
+    TEST (std::is_member_pointer,          bool, false);
+
+    TEST (std::is_member_pointer,          char, false);
+    TEST (std::is_member_pointer,   signed char, false);
+    TEST (std::is_member_pointer, unsigned char, false);
+
+#ifndef _RWSTD_NO_WCHAR_T
+    TEST (std::is_member_pointer,       wchar_t, false);
+#endif   // _RWSTD_NO_WCHAR_T
+
+    TEST (std::is_member_pointer,          short, false);
+    TEST (std::is_member_pointer,   signed short, false);
+    TEST (std::is_member_pointer, unsigned short, false);
+
+    TEST (std::is_member_pointer,          int, false);
+    TEST (std::is_member_pointer,   signed int, false);
+    TEST (std::is_member_pointer, unsigned int, false);
+
+    TEST (std::is_member_pointer,          long, false);
+    TEST (std::is_member_pointer,   signed long, false);
+    TEST (std::is_member_pointer, unsigned long, false);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_member_pointer,          long long, false);
+    TEST (std::is_member_pointer,   signed long long, false);
+    TEST (std::is_member_pointer, unsigned long long, false);
+#endif   // _RWSTD_NO_LONG_LONG
+
+    // floating point
+    TEST (std::is_member_pointer,       float, false);
+    TEST (std::is_member_pointer,      double, false);
+    TEST (std::is_member_pointer, long double, false);
+
+    // array
+    TEST (std::is_member_pointer, long [4], false);
+    TEST (std::is_member_pointer, float [3][3], false);
+    TEST (std::is_member_pointer, char* [4], false);
+    TEST (std::is_member_pointer, class_t [], false);
+    TEST (std::is_member_pointer, struct_t [][2], false);
+
+    // pointer
+    TEST (std::is_member_pointer, long*, false);
+    TEST (std::is_member_pointer, char**, false);
+
+    // reference
+    TEST (std::is_member_pointer, int&, false);
+    TEST (std::is_member_pointer, union_t&, false);
+    TEST (std::is_member_pointer, class_t&, false);
+    TEST (std::is_member_pointer, union_t&, false);
+    TEST (std::is_member_pointer, class_t&, false);
+    TEST (std::is_member_pointer, double&, false);
+
+    // pointer to member
+    TEST (std::is_member_pointer, long (class_t::*), true);
+    TEST (std::is_member_pointer, int (struct_t::*), true);
+
+    // pointer to member function
+    TEST (std::is_member_pointer, double (class_t::*)(), true);
+    TEST (std::is_member_pointer, long (class_t::*)(float), true);
+    TEST (std::is_member_pointer, double (struct_t::*)(), true);
+    TEST (std::is_member_pointer, long (struct_t::*)(float), true);
+    
+    // enumeration
+    TEST (std::is_member_pointer, enum_t, false);
+
+    // union
+    TEST (std::is_member_pointer, union_t, false);
+
+    // class
+    TEST (std::is_member_pointer, class_t, false);
+    TEST (std::is_member_pointer, struct_t, false);
+
+    // function
+    TEST (std::is_member_pointer, long (), false);
+    TEST (std::is_member_pointer, float (char), false);
+
+    // function pointer
+    TEST (std::is_member_pointer, long (*)(), false);
+    TEST (std::is_member_pointer, double (*)(int), false);
+
+    // function reference
+    TEST (std::is_member_pointer, long (&)(), false);
+
+    // member function reference
+    //TEST (std::is_member_pointer, long (class_t::&), false);    
+}
+
+/**************************************************************************/
+
+static int run_test (int, char*[])
+{
+    test_is_arithmetic ();
+    test_is_fundamental ();
+    test_is_object ();
+    test_is_scalar ();
+    test_is_compound ();
+    test_is_member_pointer ();
+
+    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
+
+/**************************************************************************/
+
+int main (int argc, char*argv[])
+{
+    return rw_test (argc, argv, __FILE__,
+                    "meta.unary.comp",
+                    0 /* no comment*/,
+                    run_test,
+                    0);
+}

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.comp.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.comp.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Added: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp?rev=667365&view=auto
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp (added)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp Thu Jun 12 22:53:51 2008
@@ -0,0 +1,726 @@
+// -*- C++ -*-
+/***************************************************************************
+ *
+ * 20.meta.unary.prop.cpp - test exercising meta.unary.prop
+ *
+ * $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 1999-2008 Rogue Wave Software, Inc.
+ *
+ **************************************************************************/
+
+#include <rw_driver.h>
+
+// compile out all test code if extensions disabled
+#ifndef _RWSTD_NO_EXT_CXX_0X
+
+#include <type_traits>
+
+/**************************************************************************/
+
+struct struct_t {
+    int i_; float f_;
+};
+
+class class_t {
+    int i_; float f_;
+};
+
+union union_t {
+    int i_; float f_;
+};
+
+union empty_union {
+};
+
+enum enum_t {
+    E_a, E_b, E_c
+};
+
+// for is_empty
+struct empty_t
+{
+};
+
+struct non_empty_t
+{
+    char c;
+};
+
+// for is_polymorphic
+struct polymorphic_t
+{
+    virtual ~polymorphic_t() { } // need not be defined
+    virtual void vfunc ();
+};
+
+struct non_polymorphic_t
+{
+    void vfunc ();
+};
+
+// for is_abstract
+struct abstract_t
+{
+    virtual ~abstract_t () { }
+    virtual void vfunc () = 0;
+};
+
+template <class T>
+struct member_t
+{
+    T val;
+};
+
+// used by is_polymorphic and is_abstract
+template <class T>
+struct public_derived_t : T
+{
+};
+
+template <class T, class U>
+struct public_derived_with_member : T
+{
+    U val;
+};
+
+template <class T>
+struct protected_derived_t : protected T
+{
+};
+
+template <class T>
+struct private_derived_t : private T
+{
+};
+
+struct access_controlled_t 
+{
+    // just to avoid warning without a ctor
+    static access_controlled_t make (char, char);
+private:
+    char pc1;
+protected:
+    char pc2;
+};
+
+template <class T>
+struct special_case_t : public_derived_t<T>
+{
+    T val;
+};
+
+template <class T>
+struct virtual_derived_t : virtual T
+{
+};
+
+struct no_trivial_ctor_t {
+    no_trivial_ctor_t () { }
+};
+
+struct no_trivial_copy_t {
+    no_trivial_copy_t (const no_trivial_copy_t&) { }
+};
+
+struct no_trivial_assign_t {
+    no_trivial_assign_t&
+    operator= (const no_trivial_assign_t&) {
+        return *this;
+    }
+};
+
+struct no_trivial_dtor_t {
+    ~no_trivial_dtor_t () { }
+};
+
+struct throwing_assign_t
+{
+    throwing_assign_t (int v)
+        : val_ (v) { }
+
+    throwing_assign_t&
+    operator= (const throwing_assign_t& rhs)
+    {
+        if (rhs.val_ != 0)
+            throw empty_t ();
+        return *this;
+    }
+
+    int val_;
+};
+
+struct throwing_ctor_t
+{
+    throwing_ctor_t (int v)
+        : val_ (v)
+    {
+        if (val_)
+            throw empty_t ();
+    }
+
+    int val_;
+};
+
+struct throwing_copy_t
+{
+    throwing_copy_t (int v)
+        : val_ (v) { }
+
+    throwing_copy_t(const throwing_copy_t& rhs)
+        : val_ (rhs.val_)
+    {
+        if (rhs.val_ != 0)
+            throw empty_t ();
+    }
+
+    int val_;
+};
+
+
+/**************************************************************************/
+
+void test_trait (int line, bool value, bool expect,
+                 const char* trait, const char* type)
+{
+    rw_assert (value == expect, 0, line,
+               "%s<%s>::value is %b, expected %b",
+               trait, type, value, expect);
+}
+
+void test_trait (int line,
+                 const char* trait, const char* type,
+                 size_t value, size_t expect)
+{
+    rw_assert (value == expect, 0, line,
+               "%s<%s>::value is %zu, expected %zu",
+               trait, type, value, expect);
+}
+
+void test_trait (int line, size_t depth, size_t value, size_t expect,
+                 const char* trait, const char* type)
+{
+    rw_assert (value == expect, 0, line,
+               "%s<%s,%zu>::value is %zu, expected %zu",
+               trait, type, depth,
+               value, expect);
+}
+
+#define _TEST(Trait, Type, Expect)                                   \
+    test_trait (__LINE__, Trait<Type>::value, Expect, #Trait, #Type)
+
+#define TEST(Trait, Type, Expect)                                    \
+    _TEST (Trait, Type, Expect)
+
+/**************************************************************************/
+
+#define C  const
+#define V  volatile
+#define CV const volatile
+
+/**************************************************************************/
+
+void test_is_const ()
+{
+    TEST (std::is_const,    void, false);
+    TEST (std::is_const, C  void, true);
+    TEST (std::is_const,  V void, false);
+    TEST (std::is_const, CV void, true);
+
+
+    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);
+
+    // pointer types
+    TEST (std::is_const,    int*, false);
+    TEST (std::is_const, C  int*, false);
+    TEST (std::is_const,  V int*, false);
+    TEST (std::is_const, CV int*, false);
+
+    TEST (std::is_const,    int* C, true);
+    TEST (std::is_const, C  int* C, true);
+    TEST (std::is_const,  V int* C, true);
+    TEST (std::is_const, CV int* C, true);
+
+    TEST (std::is_const,    int*  V, false);
+    TEST (std::is_const, C  int*  V, false);
+    TEST (std::is_const,  V int*  V, false);
+    TEST (std::is_const, CV int*  V, false);
+
+    TEST (std::is_const,    int* CV, true);
+    TEST (std::is_const, C  int* CV, true);
+    TEST (std::is_const,  V int* CV, true);
+    TEST (std::is_const, CV int* CV, true);
+
+    // reference types
+    TEST (std::is_const,    int&, false);
+    TEST (std::is_const, C  int&, false);
+    TEST (std::is_const,  V int&, false);
+    TEST (std::is_const, CV int&, false);
+
+    // array types
+    TEST (std::is_const,    int [2], false);
+    TEST (std::is_const, C  int [2], false);
+    TEST (std::is_const,  V int [2], false);
+    TEST (std::is_const, CV int [2], false);
+}
+
+void test_is_volatile ()
+{
+    TEST (std::is_volatile,    void, false);
+    TEST (std::is_volatile, C  void, false);
+    TEST (std::is_volatile,  V void, true);
+    TEST (std::is_volatile, CV void, true);
+
+    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);
+
+    // pointer types
+    TEST (std::is_volatile,    int*, false);
+    TEST (std::is_volatile, C  int*, false);
+    TEST (std::is_volatile,  V int*, false);
+    TEST (std::is_volatile, CV int*, false);
+
+    TEST (std::is_volatile,    int* C, false);
+    TEST (std::is_volatile, C  int* C, false);
+    TEST (std::is_volatile,  V int* C, false);
+    TEST (std::is_volatile, CV int* C, false);
+
+    TEST (std::is_volatile,    int*  V, true);
+    TEST (std::is_volatile, C  int*  V, true);
+    TEST (std::is_volatile,  V int*  V, true);
+    TEST (std::is_volatile, CV int*  V, true);
+
+    TEST (std::is_volatile,    int* CV, true);
+    TEST (std::is_volatile, C  int* CV, true);
+    TEST (std::is_volatile,  V int* CV, true);
+    TEST (std::is_volatile, CV int* CV, true);
+
+    // reference types
+    TEST (std::is_volatile,    int&, false);
+    TEST (std::is_volatile, C  int&, false);
+    TEST (std::is_volatile,  V int&, false);
+    TEST (std::is_volatile, CV int&, false);
+
+    // array types
+    TEST (std::is_volatile,    int [2], false);
+    TEST (std::is_volatile, C  int [2], false);
+    TEST (std::is_volatile,  V int [2], false);
+    TEST (std::is_volatile, CV int [2], false);
+}
+
+// use traits to avoid warnings on gcc when adding qualifiers to some
+// types
+#undef TEST
+#define TEST(Trait,Type,Expect)                                      \
+    _TEST(Trait, Type, Expect);                                      \
+    _TEST(Trait, _TYPENAME std::add_const<Type>::type, Expect);      \
+    _TEST(Trait, _TYPENAME std::add_volatile<Type>::type, Expect);   \
+    _TEST(Trait, _TYPENAME std::add_cv<Type>::type, Expect)
+
+static void test_is_standard_layout ()
+{
+    TEST (std::is_standard_layout, long, true);
+
+    // no non-static data members of non-standard-layout type
+    TEST (std::is_standard_layout, member_t<access_controlled_t>, false);
+    TEST (std::is_standard_layout, member_t<public_derived_t<polymorphic_t> >, false);
+
+    // no reference member
+    TEST (std::is_standard_layout, member_t<int&>, false);
+
+    // no virtual function
+    TEST (std::is_standard_layout, abstract_t, false);
+    TEST (std::is_standard_layout, polymorphic_t, false);
+
+    // no virtual base
+    TEST (std::is_standard_layout, virtual_derived_t<empty_t>, false);
+    TEST (std::is_standard_layout, virtual_derived_t<non_empty_t>, false);
+
+    // no access control changes for non-statics
+    TEST (std::is_standard_layout, access_controlled_t, false);
+
+    // no non-standard layout base classes
+    TEST (std::is_standard_layout, public_derived_t<member_t<access_controlled_t> >, false);
+    TEST (std::is_standard_layout, public_derived_t<member_t<public_derived_t<polymorphic_t> > >, false);
+    TEST (std::is_standard_layout, public_derived_t<member_t<int&> >, false);
+    TEST (std::is_standard_layout, public_derived_t<abstract_t>, false);
+    TEST (std::is_standard_layout, public_derived_t<polymorphic_t>, false);
+    TEST (std::is_standard_layout, public_derived_t<virtual_derived_t<empty_t> >, false);
+    TEST (std::is_standard_layout, public_derived_t<virtual_derived_t<non_empty_t> >, false);
+    TEST (std::is_standard_layout, public_derived_t<access_controlled_t>, false);
+
+    // no non-static data members in the most-derived class
+    typedef public_derived_with_member<empty_t,int> derived_from_empty_with_member;
+    TEST (std::is_standard_layout, derived_from_empty_with_member, false);
+
+    // 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);
+
+    // but not two base classes with non-static members
+    typedef public_derived_with_member<non_empty_t, int> derived_from_non_empty_with_member;
+    TEST (std::is_standard_layout, derived_from_non_empty_with_member, false);
+
+    // no base classes of the same type as the first non-static data member
+    TEST (std::is_standard_layout, special_case_t<empty_t>, false);
+    TEST (std::is_standard_layout, special_case_t<non_empty_t>, false);
+
+    // everything else should be good to go
+    TEST (std::is_standard_layout, member_t<int>, false);
+    TEST (std::is_standard_layout, member_t<member_t<int> >, false);
+}
+
+static void test_is_trivial ()
+{
+    TEST (std::is_trivial, class_t, true);
+    TEST (std::is_trivial, struct_t, true);
+    TEST (std::is_trivial, union_t, true);
+
+    TEST (std::is_trivial, empty_t, true);
+    TEST (std::is_trivial, public_derived_t<empty_t>, true);
+
+    TEST (std::is_trivial, non_empty_t, true);
+    TEST (std::is_trivial, public_derived_t<non_empty_t>, true);
+
+    TEST (std::is_trivial, abstract_t, false);
+    TEST (std::is_trivial, public_derived_t<abstract_t>, false);
+
+    TEST (std::is_trivial, polymorphic_t, false);
+    TEST (std::is_trivial, public_derived_t<polymorphic_t>, false);
+
+    TEST (std::is_trivial, no_trivial_ctor_t, false);
+    TEST (std::is_trivial, no_trivial_copy_t, false);
+    TEST (std::is_trivial, no_trivial_assign_t, false);
+    TEST (std::is_trivial, no_trivial_dtor_t, false);
+}
+
+static void test_is_pod ()
+{
+    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, void*, true);
+    TEST (std::is_pod, void (*)(), true);
+    TEST (std::is_pod, void (*[])(), true);
+    TEST (std::is_pod, void (class_t::*)(), true);
+
+    // standard layout and trivial
+    // 
+    TEST (std::is_pod, struct_t, true);
+    TEST (std::is_pod, union_t, true);
+    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);
+    TEST (std::is_pod, public_derived_t<non_empty_t>, true);
+
+    TEST (std::is_pod, abstract_t, false);
+    TEST (std::is_pod, public_derived_t<abstract_t>, false);
+
+    TEST (std::is_pod, polymorphic_t, false);
+    TEST (std::is_pod, public_derived_t<polymorphic_t>, false);
+
+    TEST (std::is_pod, no_trivial_ctor_t, false);
+    TEST (std::is_pod, no_trivial_copy_t, false);
+    TEST (std::is_pod, no_trivial_assign_t, false);
+    TEST (std::is_pod, no_trivial_dtor_t, false);
+
+    TEST (std::is_pod, access_controlled_t, false);
+}
+
+static void test_is_empty ()
+{
+    TEST (std::is_empty, void, false);
+
+    TEST (std::is_empty, struct_t, false);
+    TEST (std::is_empty, class_t, false);
+    TEST (std::is_empty, union_t, false);
+    TEST (std::is_empty, enum_t, false);
+
+    TEST (std::is_empty, empty_union, false);
+
+    TEST (std::is_empty, empty_t, true);
+    TEST (std::is_empty, public_derived_t<empty_t>, true);
+
+    TEST (std::is_empty, non_empty_t, false);
+    TEST (std::is_empty, public_derived_t<non_empty_t>, false);
+
+    TEST (std::is_empty, abstract_t, false);
+    TEST (std::is_empty, public_derived_t<abstract_t>, false);
+
+    TEST (std::is_empty, polymorphic_t, false);
+    TEST (std::is_empty, public_derived_t<polymorphic_t>, false);
+
+    TEST (std::is_empty, virtual_derived_t<empty_t>, false);
+    TEST (std::is_empty, virtual_derived_t<non_empty_t>, false);
+}
+
+static void test_is_polymorphic ()
+{
+    TEST (std::is_polymorphic, polymorphic_t, true);
+    TEST (std::is_polymorphic, public_derived_t<polymorphic_t>, true);
+
+    TEST (std::is_polymorphic, non_polymorphic_t, false);
+    TEST (std::is_polymorphic, public_derived_t<non_polymorphic_t>, false);
+
+    TEST (std::is_polymorphic, abstract_t, true);
+    TEST (std::is_polymorphic, public_derived_t<abstract_t>, true);
+}
+
+static void test_is_abstract ()
+{
+    TEST (std::is_abstract, abstract_t, true);
+    TEST (std::is_abstract, public_derived_t<abstract_t>, true);
+
+    TEST (std::is_abstract, polymorphic_t, false); // polymorphic_t is not an abstract type
+    TEST (std::is_abstract, public_derived_t<polymorphic_t>, false);
+}
+
+static void test_has_trivial_constructor ()
+{
+    TEST (std::has_trivial_default_constructor, long, false);
+    TEST (std::has_trivial_default_constructor, struct_t, true);
+
+    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);
+}   
+
+static void test_has_trivial_copy ()
+{
+    TEST (std::has_trivial_copy_constructor, long, false);
+    TEST (std::has_trivial_copy_constructor, struct_t, true);
+
+    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);
+}
+
+static void test_has_trivial_assign ()
+{
+    TEST (std::has_trivial_assign, long, false);
+    TEST (std::has_trivial_assign, struct_t, true);
+
+    TEST (std::has_trivial_assign, no_trivial_assign_t, false);
+    TEST (std::has_trivial_assign, public_derived_t<no_trivial_assign_t>, false);
+}
+
+static void test_has_trivial_destructor ()
+{
+    TEST (std::has_trivial_destructor, long, false);
+    TEST (std::has_trivial_destructor, struct_t, true);
+
+    TEST (std::has_trivial_destructor, no_trivial_dtor_t, false);
+    TEST (std::has_trivial_destructor, public_derived_t<no_trivial_dtor_t>, false);
+}
+
+static void test_has_nothrow_constructor ()
+{
+    TEST (std::has_nothrow_default_constructor, long, false);
+    TEST (std::has_nothrow_default_constructor, struct_t, true);
+    TEST (std::has_nothrow_default_constructor, throwing_ctor_t, false);
+}
+
+static void test_has_nothrow_copy ()
+{
+    TEST (std::has_nothrow_copy_constructor, long, false);
+    TEST (std::has_nothrow_copy_constructor, struct_t, true);
+    TEST (std::has_nothrow_copy_constructor, throwing_copy_t, false);
+}
+
+static void test_has_nothrow_assign ()
+{
+    TEST (std::has_nothrow_assign, struct_t, true);
+    TEST (std::has_nothrow_assign, throwing_assign_t, false);
+}
+
+static void test_has_virtual_destructor ()
+{
+    TEST (std::has_virtual_destructor, abstract_t, true);
+    TEST (std::has_virtual_destructor, public_derived_t<abstract_t>, true);
+
+    TEST (std::has_virtual_destructor, polymorphic_t, true);
+    TEST (std::has_virtual_destructor, public_derived_t<polymorphic_t>, true);
+
+    TEST (std::has_virtual_destructor, non_polymorphic_t, false);
+    TEST (std::has_virtual_destructor, public_derived_t<non_polymorphic_t>, false);
+}
+
+static void test_is_signed ()
+{
+    TEST (std::is_signed, char, char(-1) < char(0));
+
+    TEST (std::is_signed, signed char, true);
+    TEST (std::is_signed, signed short, true);
+    TEST (std::is_signed, signed int, true);
+    TEST (std::is_signed, signed long, true);
+    TEST (std::is_signed, signed long long, true);
+
+    TEST (std::is_signed, unsigned char, false);
+    TEST (std::is_signed, unsigned short, false);
+    TEST (std::is_signed, unsigned int, false);
+    TEST (std::is_signed, unsigned long, false);
+    TEST (std::is_signed, unsigned long long, false);
+
+    TEST (std::is_signed, float, true);
+    TEST (std::is_signed, double, true);
+    TEST (std::is_signed, long double, true);
+
+    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
+}
+
+static void test_is_unsigned ()
+{
+    TEST (std::is_unsigned, char, char(0) < char(-1));
+
+    TEST (std::is_unsigned, signed char, false);
+    TEST (std::is_unsigned, signed short, false);
+    TEST (std::is_unsigned, signed int, false);
+    TEST (std::is_unsigned, signed long, false);
+    TEST (std::is_unsigned, signed long long, false);
+
+    TEST (std::is_unsigned, unsigned char, true);
+    TEST (std::is_unsigned, unsigned short, true);
+    TEST (std::is_unsigned, unsigned int, true);
+    TEST (std::is_unsigned, unsigned long, true);
+    TEST (std::is_unsigned, unsigned long long, true);
+
+    TEST (std::is_unsigned, float, false);
+    TEST (std::is_unsigned, double, false);
+    TEST (std::is_unsigned, long double, false);
+
+    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);
+}
+
+static void test_alignment_of ()
+{
+}
+
+static void test_rank ()
+{
+#undef TEST
+#define TEST(Trait, Type, Expect)                                   \
+    test_trait (__LINE__, #Trait, #Type, Trait<Type>::value, Expect)
+
+    TEST (std::rank, int, 0ul);
+    TEST (std::rank, int [2], 1ul);
+    TEST (std::rank, int [][4], 2ul);
+    TEST (std::rank, int [4][4], 2ul);
+
+    TEST (std::rank, void, 0ul);
+    TEST (std::rank, void*, 0ul);
+
+#undef TEST
+}
+
+static void test_extent ()
+{
+#undef TEST
+#define TEST(Trait, Type, Depth, Expect)                             \
+    test_trait (__LINE__, Depth, Trait<Type,Depth>::value, Expect,         \
+                #Trait, #Type)
+
+    TEST (std::extent, int, 0, 0ul);
+    TEST (std::extent, int [2], 0, 2ul);
+    TEST (std::extent, int [2][4], 0, 2ul);
+    TEST (std::extent, int [][4], 0, 0ul);
+
+    TEST (std::extent, int, 1, 0ul);
+    TEST (std::extent, int [2], 1, 0ul);
+
+    TEST (std::extent, int [2][4], 0, 2ul);
+    TEST (std::extent, int [2][4], 1, 4ul);
+    TEST (std::extent, int [2][4], 2, 0ul);
+    
+    TEST (std::extent, int [][4], 0, 0ul);
+    TEST (std::extent, int [][4], 1, 4ul);
+    TEST (std::extent, int [][4], 2, 0ul);
+
+#undef TEST
+}
+
+static int run_test (int, char*[])
+{
+    test_is_const ();
+    test_is_volatile ();
+    test_is_trivial ();
+    test_is_standard_layout ();
+    test_is_pod ();
+    test_is_empty ();
+    test_is_polymorphic ();
+    test_is_abstract ();
+    test_has_trivial_constructor ();
+    test_has_trivial_copy ();
+    test_has_trivial_assign ();
+    test_has_trivial_destructor ();
+    test_has_nothrow_constructor ();
+    test_has_nothrow_copy ();
+    test_has_nothrow_assign ();
+    test_has_virtual_destructor ();
+    test_is_signed ();
+    test_is_unsigned ();
+    test_alignment_of ();
+    test_rank ();
+    test_extent ();
+
+    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
+
+/**************************************************************************/
+
+int main (int argc, char*argv[])
+{
+    return rw_test (argc, argv, __FILE__,
+                    "meta.unary.prop",
+                    0 /* no comment*/,
+                    run_test,
+                    0);
+}

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message