-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (55 loc) · 1.89 KB
/
main.cpp
File metadata and controls
64 lines (55 loc) · 1.89 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <fstream>
#include <iostream>
#include <sstream>
#include "Controller.hpp"
void sample() {
FS::Controller controller("saving.bin");
//comment this after first run
// controller.reset();
// std::ifstream in("../test/test-sample-before-restore.txt");
// std::ofstream out("../test/output/output-sample-before.txt");
//uncomment this after first run
std::ifstream in("../test/test-sample-after-restore.txt");
std::ofstream out("../test/output/output-sample-after.txt");
controller.work(in, out);
in.close();
out.close();
}
int main()
{
std::string IN[] = {
"../test/test-fs-overflow.txt", // 0
"../test/test-end-of-file.txt", // 1
"../test/test-sample.txt", // 2
"../test/test-destroy.txt", // 3
"../test/test-close.txt", // 4
"../test/test-buffer-load.txt", // 5
"../test/test-buffer-block-changing.txt", // 6
"../test/test-rewrite.txt"
// "../test/test-fs-overflow.txt" // 7
};
std::string OUT[] = {
"../test/output/output-test-fs-overflow.txt",
"../test/output/output-test-end-of-file.txt",
"../test/output/output-sample.txt",
"../test/output/output-destroy.txt",
"../test/output/output-close.txt",
"../test/output/output-buffer-load.txt",
"../test/output/output-test-buffer-block-changing.txt",
"../test/output/output-rewrite.txt"
//"../test/output/output-test-fs-overflow.txt"
};
FS::Controller controller("saving.bin");
sample();
// for (int i = 0; i < sizeof(IN) / sizeof(*IN); i++)
// {
// controller.reset();
// std::ifstream in(IN[i]);
// std::ofstream out(OUT[i]);
// controller.work(in, out);
//
// in.close();
// out.close();
// }
return 0;
}