-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.cpp
36 lines (34 loc) · 959 Bytes
/
Test.cpp
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
#include <iostream>
#include "Maze.h"
#include "Stack.h"
using namespace std;
void testStack(){
int coords[2] = {0, 0};
Stack test(coords);
cout << "creating stack with value (0, 0)" << endl;
test.show();
cout << "Pushing (5, 10) to it" << endl;
coords[0] = 5;
coords[1] = 10;
test.push(coords);
test.show();
cout << "Peeking at top value (5, 10)" << endl;
int* newCoords = test.peek();
cout << newCoords[0] << " " << newCoords[1] << endl;
cout << "Popping top value (5, 10)" << endl;
newCoords = test.pop();
test.show();
cout << newCoords[0] << " " << newCoords[1] << endl;
cout << "Test is empty - false, true" << endl;
cout << test.isEmpty() << endl;
test.pop();
cout << test.isEmpty() << endl;
cout << "Length: 0, 1, 2, 3" << endl;
for ( int i = 0; i<4; i++){
cout << test.length() << endl;
test.push(coords);
}
}
int main(){
testStack();
}