[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-stdcxx-commits
Subject:    svn commit: r671833 -
From:       faridz () apache ! org
Date:       2008-06-26 9:13:23
Message-ID: 20080626091323.F3A4B2388A2B () eris ! apache ! org
[Download RAW message or body]

Author: faridz
Date: Thu Jun 26 02:13:23 2008
New Revision: 671833

URL: http://svn.apache.org/viewvc?rev=671833&view=rev
Log:
2008-06-26  Farid Zaripov  <faridz@apache.com>

	* tests/regress/23.containers.stdcxx-152.cpp: New regression test for STDCXX-152 \
issue.

Added:
    stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp   (with props)

Added: stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp?rev=671833&view=auto
 ==============================================================================
--- stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp (added)
+++ stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp Thu Jun 26 \
02:13:23 2008 @@ -0,0 +1,97 @@
+/***************************************************************************
+ *
+ * 23.containers.stdcxx-152.cpp - regression test for STDCXX-152
+ *
+ * $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.
+ *
+ **************************************************************************/
+
+#include <map>
+#include <set>
+#include <string>
+#include <utility>
+
+using namespace std;
+
+template <class T>
+struct TestMap
+{
+    typedef map<T, TestMap> Map;
+    typedef typename Map::value_type value_type;
+    Map data;
+};
+
+
+template <class T>
+struct TestMultiMap
+{
+    typedef multimap<T, TestMultiMap> MultiMap;
+    typedef typename MultiMap::value_type value_type;
+    MultiMap data;
+};
+
+
+template <class T>
+struct TestSet
+{
+    typedef set<pair<T, TestSet> > Set;
+    typedef typename Set::value_type value_type;
+    Set data;
+};
+
+bool operator< (const pair<string, TestSet<string> >& lhs,
+                const pair<string, TestSet<string> >& rhs)
+{
+    return lhs.first < rhs.first;
+}
+
+
+template <class T>
+struct TestMultiSet
+{
+    typedef multiset<pair<T, TestMultiSet> > MultiSet;
+    typedef typename MultiSet::value_type value_type;
+    MultiSet data;
+};
+
+bool operator< (const pair<string, TestMultiSet<string> >& lhs,
+                const pair<string, TestMultiSet<string> >& rhs)
+{
+    return lhs.first < rhs.first;
+}
+
+
+int main ()
+{
+    TestMap<string> test1;
+    test1.data.insert (make_pair ("test1", test1));
+
+    TestMultiMap<string> test2;
+    test2.data.insert (make_pair ("test2", test2));
+
+    TestSet<string> test3;
+    test3.data.insert (make_pair ("test3", test3));
+
+    TestMultiSet<string> test4;
+    test4.data.insert (make_pair ("test4", test4));
+
+    return 0;
+}

Propchange: stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp
------------------------------------------------------------------------------
    svn:keywords = Id


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic