ReactOS 0.4.16-dev-340-g0540c21
queue_test.cpp
Go to the documentation of this file.
1#include <vector>
2#include <algorithm>
3#include <list>
4#include <deque>
5#include <queue>
6
8
9#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
10using namespace std;
11#endif
12
13//
14// TestCase class
15//
16class QueueTest : public CPPUNIT_NS::TestCase
17{
22
23protected:
24 void pqueue1();
25 void queue1();
26};
27
29
30//
31// tests implementation
32//
34{
36 q.push(42);
37 q.push(101);
38 q.push(69);
39
40 CPPUNIT_ASSERT( q.top()==101 );
41 q.pop();
42 CPPUNIT_ASSERT( q.top()==69 );
43 q.pop();
44 CPPUNIT_ASSERT( q.top()==42 );
45 q.pop();
46
47 CPPUNIT_ASSERT(q.empty());
48}
50{
52 q.push(42);
53 q.push(101);
54 q.push(69);
55
56 CPPUNIT_ASSERT( q.front()==42 );
57 q.pop();
58 CPPUNIT_ASSERT( q.front()==101 );
59 q.pop();
60 CPPUNIT_ASSERT( q.front()==69 );
61 q.pop();
62
63 CPPUNIT_ASSERT(q.empty());
64}
void queue1()
Definition: queue_test.cpp:49
void pqueue1()
Definition: queue_test.cpp:33
CPPUNIT_TEST_SUITE(QueueTest)
CPPUNIT_TEST(queue1)
CPPUNIT_TEST_SUITE_END()
CPPUNIT_TEST(pqueue1)
Definition: _queue.h:67
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
Definition: cppunit_mini.h:193
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
Definition: features.h:417