-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
85 lines (71 loc) · 1.69 KB
/
main.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "main.hpp"
static void vectorTests() {
std::ofstream outfile;
outfile.open(VECTORFILE);
vectorAccessOperator(outfile);
vectorAssign(outfile);
vectorAt(outfile);
vectorBack(outfile);
vectorBegin(outfile);
vectorCapacity(outfile);
vectorClear(outfile);
vectorConstructor(outfile);
vectorEmpty(outfile);
vectorEnd(outfile);
vectorErase(outfile);
vectorFront(outfile);
vectorInsert(outfile);
vectorMaxSize(outfile);
vectorOperatorEqual(outfile);
vectorPopBack(outfile);
vectorPushBack(outfile);
vectorRbegin(outfile);
vectorRend(outfile);
vectorResize(outfile);
outfile.close();
}
static void stackTests() {
std::ofstream outfile;
outfile.open(STACKFILE);
stackAccessOperator(outfile);
stackAssign(outfile);
stackEmpty(outfile);
stackEnd(outfile);
stackErase(outfile);
stackOperatorEqual(outfile);
stackPop(outfile);
stackPush(outfile);
outfile.close();
}
static void mapTests() {
std::ofstream outfile;
outfile.open(MAPFILE);
mapAccessOperator(outfile);
mapAt(outfile);
mapBegin(outfile);
mapClear(outfile);
mapCount(outfile);
mapEmpty(outfile);
mapErase(outfile);
mapEqualRange(outfile);
mapFind(outfile);
mapInsert(outfile);
outfile.close();
}
int main(int ac, char **av) {
std::string input;
if (ac != 2) {
std::cout << "missing arg" << std::endl;
return (0);
}
input = av[1];
if (input.compare("vector") == 0)
vectorTests();
else if (input.compare("stack") == 0)
stackTests();
else if (input.compare("map") == 0)
mapTests();
else
std::cout << "bad argument" << std::endl;
return (0);
}