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