summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/23_containers/unordered_map
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/unordered_map')
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc19
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc22
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc (renamed from libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc)0
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc28
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc24
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc31
6 files changed, 66 insertions, 58 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc
index b8f9d502a0d..a00635a568f 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc
@@ -19,24 +19,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-
#include <unordered_map>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
- bool test __attribute__((unused)) = true;
-
- std::unordered_map<int, int> um;
- um[1] = 1;
- VERIFY( um.cbegin() == um.begin() );
- VERIFY( um.cend() == um.end() );
- VERIFY( um.cbegin() != um.cend() );
-}
+#include <testsuite_containers.h>
int main()
{
- test01();
+ typedef std::unordered_map<int, int> test_type;
+ __gnu_test::citerator<test_type> test;
return 0;
}
+
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc
index a6729a314be..3cad0a16a06 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc
@@ -19,26 +19,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-
#include <unordered_map>
-#include <testsuite_hooks.h>
-
-// DR 691.
-void test01()
-{
- bool test __attribute__((unused)) = true;
-
- typedef std::unordered_map<int, int> um_type;
- um_type um;
- um[1] = 1;
- VERIFY( um.cbegin(0) == um.begin(0) );
- VERIFY( um.cend(0) == um.end(0) );
- const um_type::size_type bn = um.bucket(1);
- VERIFY( um.cbegin(bn) != um.cend(bn) );
-}
+#include <testsuite_containers.h>
int main()
{
- test01();
+ typedef std::unordered_map<int, int> test_type;
+ typedef typename test_type::value_type value_type;
+ value_type v(1, 1);
+ __gnu_test::forward_members_unordered<test_type> test(v);
return 0;
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc
index 9027fdcc144..9027fdcc144 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc
new file mode 100644
index 00000000000..f6b5fe37274
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc
@@ -0,0 +1,28 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+typedef __gnu_test::NonDefaultConstructible inst_type;
+template class std::unordered_map<inst_type, inst_type>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
new file mode 100644
index 00000000000..695fa6f58e3
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
@@ -0,0 +1,24 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_map>
+
+using namespace std;
+template class unordered_map<int, int, hash<int>, equal_to<int>, allocator<char>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc
index 6985a9b565b..9b978cebc20 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc
@@ -1,9 +1,7 @@
-// { dg-do compile }
// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
-// 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
-
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -20,27 +18,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+#include <testsuite_containers.h>
#include <unordered_map>
-void test01()
-{
- // Check for required typedefs
- typedef std::unordered_map<int, int> test_type;
-
- typedef test_type::key_type key_type;
- typedef test_type::value_type value_type;
- typedef test_type::mapped_type mapped_type;
- typedef test_type::hasher hasher;
- typedef test_type::key_equal key_equal;
- typedef test_type::allocator_type allocator_type;
- typedef test_type::pointer pointer;
- typedef test_type::const_pointer const_pointer;
- typedef test_type::reference reference;
- typedef test_type::const_reference const_reference;
- typedef test_type::size_type size_type;
- typedef test_type::difference_type difference_type;
- typedef test_type::iterator iterator;
- typedef test_type::const_iterator const_iterator;
- typedef test_type::local_iterator local_iterator;
- typedef test_type::const_local_iterator const_local_iterator;
-}
+// Check container for required typedefs.
+__gnu_test::types<std::unordered_map<int, long> > t;