You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2008/06/28 00:07:36 UTC

Re: svn commit: r671833 - /stdcxx/branches/4.2.x/tests/regress/23.containers.stdcxx-152.cpp

faridz@apache.org wrote:
> 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  <fa...@apache.com>
> 
> 	* tests/regress/23.containers.stdcxx-152.cpp: New regression test for STDCXX-152 issue.

Can you please keep your ChangeLogs under 80 characters wide?

Thanks!
Martin

> 
> 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
> 
>