1// 2002-06-28 pme
2
3// Copyright (C) 2002 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library.  This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 2, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License along
17// with this library; see the file COPYING.  If not, write to the Free
18// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19// USA.
20
21// 23.2.3 container adaptros
22
23#include <queue>
24#include <stack>
25#include <testsuite_hooks.h>
26
27// libstdc++/7157
28void
29test01()
30{
31  std::queue<int> q;
32
33  q.push(1);
34  q.front();
35  q.pop();
36}
37
38
39// libstdc++/7158
40void
41test02()
42{
43  std::stack<int> st;
44
45  st.push(1);
46  st.top() = 42;
47  st.pop();
48}
49
50
51// libstdc++/7161
52void
53test03()
54{
55  int data[] = {1, 2, 3};
56  std::priority_queue<int> pq;
57  std::size_t size = pq.size();
58
59  for (int i = 0; i < 3; ++i)
60    pq.push(data[i]);
61
62  size = pq.size();
63  pq.top();
64  for (int i = 0; i < 2; ++i)
65    pq.pop();
66
67  while (!pq.empty())
68    pq.pop();
69}
70
71
72int main()
73{
74  test01();
75  test02();
76  test03();
77
78  return 0;
79}
80