forked from TheAlgorithms/C-Plus-Plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_queue.cpp
More file actions
38 lines (36 loc) · 1.08 KB
/
test_queue.cpp
File metadata and controls
38 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <string>
#include "queue.h"
#include "queue.cpp"
using namespace std;
int main()
{
queue<string> q;
cout << "---------------------- Test construct ----------------------" << endl;
q.display();
cout << "---------------------- Test isEmptyQueue ----------------------" << endl;
if(q.isEmptyQueue())
cout << "PASS" <<endl;
else
cout << "FAIL" <<endl;
cout << "---------------------- Test enQueue ----------------------" << endl;
cout << "After Hai, Jeff, Tom, Jkingston go into queue: "<<endl;
q.enQueue("Hai");
q.enQueue("Jeff");
q.enQueue("Tom");
q.enQueue("Jkingston");
q.display();
cout << "---------------------- Test front ----------------------" << endl;
string value = q.front();
if (value == "Hai")
cout << "PASS" <<endl;
else
cout << "FAIL" <<endl;
cout << "---------------------- Test deQueue ----------------------" << endl;
q.display();
q.deQueue();
q.deQueue();
cout << "After Hai, Jeff left the queue: "<< endl;
q.display();
return 0;
}