stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elemi...@apache.org
Subject svn commit: r669655 - /stdcxx/branches/4.3.x/tests/utilities/20.tuple.helpers.cpp
Date Thu, 19 Jun 2008 19:05:04 GMT
Author: elemings
Date: Thu Jun 19 12:05:04 2008
New Revision: 669655

URL: http://svn.apache.org/viewvc?rev=669655&view=rev
Log:
2008-06-19  Eric Lemings <eric.lemings@roguewave.com>

	STDCXX-958
	* tests/utilities/20.tuple.helpers.cpp (test_tuple_size): Add
	TEST() macro and update existing tests to utilize macro.
	(test_tuple_element): Remove using directives and explicitly
	reference `std' namespace members.


Modified:
    stdcxx/branches/4.3.x/tests/utilities/20.tuple.helpers.cpp

Modified: stdcxx/branches/4.3.x/tests/utilities/20.tuple.helpers.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.tuple.helpers.cpp?rev=669655&r1=669654&r2=669655&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.tuple.helpers.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.tuple.helpers.cpp Thu Jun 19 12:05:04 2008
@@ -39,30 +39,27 @@
 {
     rw_info (0, __FILE__, __LINE__, "tuple_size");
 
-    using std::tuple_size;
+#define STRING(x)   #x
+#define TEST(T, S)  \
+    rw_assert (std::tuple_size<T>::value == S, __FILE__, __LINE__, \
+               "tuple_size<" #T ">::value, got %d, expected " \
+               STRING (S), std::tuple_size<T>::value)
+
+    TEST (EmptyTuple, 0);
+
+    TEST (IntTuple, 1);
+    TEST (ConstIntTuple, 1);
+    TEST (UserTuple, 1);
+    TEST (NestedTuple, 1);
 
-    rw_assert (tuple_size<EmptyTuple>::value == 0, __FILE__, __LINE__,
-               "tuple_size<EmptyTuple>::value != 0");
+    TEST (PairTuple, 2);
 
-    rw_assert (tuple_size<IntTuple>::value == 1, __FILE__, __LINE__,
-               "tuple_size<IntTuple>::value != 1");
-    rw_assert (tuple_size<ConstIntTuple>::value == 1, __FILE__, __LINE__,
-               "tuple_size<ConstIntTuple>::value != 1");
-    rw_assert (tuple_size<UserTuple>::value == 1, __FILE__, __LINE__,
-               "tuple_size<UserTuple>::value != 1");
-    rw_assert (tuple_size<NestedTuple>::value == 1, __FILE__, __LINE__,
-               "tuple_size<NestedTuple>::value != 1");
-
-    rw_assert (tuple_size<PairTuple>::value == 2, __FILE__, __LINE__,
-               "tuple_size<Tuple>::value == 2");
-
-    rw_assert (tuple_size<BigTuple>::value == BigListSize,
-                __FILE__, __LINE__, "tuple_size<>::value == 0");
+    TEST (BigTuple, BigListSize);
 }
 
 /**************************************************************************/
 
-#include <type_traits>          // for is_same
+#include <rw/_meta_rel.h>
 
 #include <rw_any.h>
 
@@ -105,15 +102,15 @@
 {
     rw_info (0, __FILE__, __LINE__, "tuple_element");
 
-    using std::is_same;
-    using std::tuple_element;
-
+#define IS_SAME(T,U) \
+        _RW::__rw_is_same<T, U>::value
 #define TYPE_NAME(T) \
         (any_t (T ())).type_name ()
 
+#undef TEST
 #define TEST(N, T, E) \
-    typedef tuple_element<N, T>::type T ## N; \
-    rw_assert (is_same<T ## N, E>::value, __FILE__, __LINE__, \
+    typedef std::tuple_element<N, T>::type T ## N; \
+    rw_assert (IS_SAME(T ## N, E), __FILE__, __LINE__, \
                "tuple_element<0, " #T ">::type, got type \"%s\", " \
                "expected type \"" #E "\"", TYPE_NAME (T##N))
 



Mime
View raw message