-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
45 lines (38 loc) · 1.14 KB
/
main.cpp
File metadata and controls
45 lines (38 loc) · 1.14 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
39
40
41
42
43
44
/**
* @file main.cpp
* @brief This file contains the main() function which performs unit tests
* on the UndoArray type.
* @usage Supply 2 arguments on the command line: the file path for the text
* file (e.g. large.txt) and the number of times to repeat the
* parsing process for this file.
*/
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <assert.h>
#include "undo_array.h"
#include "test_driver.h"
// these functions test that all of the public member functions of UndoArray are working properly
int main(int argc, char* argv[])
{
using namespace UndoArray;
using namespace std;
TestDriver testDriver;
testDriver.simpleTest();
cout << "Simple test passed." << endl;
testDriver.testClassType();
cout << "1 passed." << endl;
testDriver.testCopyConstructor();
cout << "2 passed." << endl;
testDriver.testAssignmentOperator();
cout << "3 passed." << endl;
testDriver.testDestructor();
cout << "OCF Method tests passed." << endl;
if (argc > 1)
{
assert (argc == 3);
testDriver.batchTest(argv[1],atoi(argv[2]));
cout << "Batch test completed." << endl;
}
return 0;
}