-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cpp
220 lines (220 loc) · 4.81 KB
/
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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
//#include <catch2/catch_test_macros.hpp>
//#include <iostream>
//
//// change if you choose to use a different header name
//#include "C:\DSAProject2Catch\Page-Rank-Project\src\main.cpp"
//
//using namespace std;
//
////catch template from project 2 catch github
//
//TEST_CASE("Four Power Iterations", "[flag]"){
// string input = R"(7 4
//google.com gmail.com
//google.com maps.com
//facebook.com ufl.edu
//ufl.edu google.com
//ufl.edu gmail.com
//maps.com facebook.com
//gmail.com maps.com)";
//
// string expectedOutput = R"(facebook 0.20
//gmail 0.20
//google 0.10
//maps 0.30
//ufl 0.20
//)";
//
// string actualOutput;
//
// adjacencyList a;
// a.addToVect("google", "gmail");
// a.addToVect("google", "maps");
// a.addToVect("facebook", "ufl");
// a.addToVect("ufl", "google");
// a.addToVect("ufl", "gmail");
// a.addToVect("ufl", "gmail");
// a.addToVect("gmail", "maps");
//
// a.findRT();
// a.firstRValues();
// a.pageRank(4);
// actualOutput = a.returnValues();
//
// REQUIRE(actualOutput == expectedOutput);
//}
//
//TEST_CASE("One line", "[flag]"){
//string input = R"(1 2
//google facebook)";
//
//string expectedOutput = R"(facebook 0.50
//google 0.00
//)";
//
//string actualOutput;
//
//adjacencyList a;
//a.addToVect("google", "facebook");
//
//a.findRT();
//a.firstRValues();
//a.pageRank(2);
//actualOutput = a.returnValues();
//
//REQUIRE(actualOutput == expectedOutput);
//}
//
//TEST_CASE("Ten Lines, One Power Iteration", "[flag]"){
// string input = R"(10 1
//google gmail
//gmail ufl
//ufl maps
//maps facebook
//facebook google
//google ufl
//ufl google
//google facebook
//gmail facebook
//ufl facebook
//)";
//
// string expectedOutput = R"(facebook 0.20
//gmail 0.20
//google 0.20
//maps 0.20
//ufl 0.20
//)";
//
// string actualOutput;
//
// adjacencyList a;
// a.addToVect("google", "gmail");
// a.addToVect("gmail", "ufl");
// a.addToVect("ufl", "maps");
// a.addToVect("maps", "facebook");
// a.addToVect("facebook", "google");
// a.addToVect("google", "ufl");
// a.addToVect("ufl", "google");
// a.addToVect("google", "facebook");
// a.addToVect("gmail", "facebook");
// a.addToVect("ufl", "facebook");
//
// a.findRT();
// a.firstRValues();
// a.pageRank(1);
// actualOutput = a.returnValues();
//
// REQUIRE(actualOutput == expectedOutput);
//}
//
//TEST_CASE("Ten Lines, One Power Iteration", "[flag]"){
// string input = R"(10 1
//google gmail
//gmail ufl
//ufl maps
//maps facebook
//facebook google
//google ufl
//ufl google
//google facebook
//gmail facebook
//ufl facebook
//)";
//
// string expectedOutput = R"(facebook 0.20
//gmail 0.20
//google 0.20
//maps 0.20
//ufl 0.20
//)";
//
// string actualOutput;
//
// adjacencyList a;
// a.addToVect("google", "gmail");
// a.addToVect("gmail", "ufl");
// a.addToVect("ufl", "maps");
// a.addToVect("maps", "facebook");
// a.addToVect("facebook", "google");
// a.addToVect("google", "ufl");
// a.addToVect("ufl", "google");
// a.addToVect("google", "facebook");
// a.addToVect("gmail", "facebook");
// a.addToVect("ufl", "facebook");
//
// a.findRT();
// a.firstRValues();
// a.pageRank(1);
// actualOutput = a.returnValues();
//
// REQUIRE(actualOutput == expectedOutput);
//}
//
//TEST_CASE("Nodes pointing to each other", "[flag]"){
// string input = R"(4 2
//google gmail
//gmail google
//facebook ufl
//ufl facebook
//)";
//
// string expectedOutput = R"(facebook 0.25
//gmail 0.25
//google 0.25
//ufl 0.25
//)";
//
// string actualOutput;
//
// adjacencyList a;
// a.addToVect("google", "gmail");
// a.addToVect("gmail", "google");
// a.addToVect("facebook", "ufl");
// a.addToVect("ufl", "facebook");
//
// a.findRT();
// a.firstRValues();
// a.pageRank(2);
// actualOutput = a.returnValues();
//
// REQUIRE(actualOutput == expectedOutput);
//}
//
//TEST_CASE("High power iteration", "[flag]"){
// string input = R"(7 10
//google gmail
//gmail facebook
//maps ufl
//ufl gmail
//google maps
//ufl maps
//maps facebook
//)";
//
// string expectedOutput = R"(facebook 0.00
//gmail 0.00
//google 0.00
//maps 0.00
//ufl 0.00
//)";
//
// string actualOutput;
//
// adjacencyList a;
// a.addToVect("google", "gmail");
// a.addToVect("gmail", "facebook");
// a.addToVect("maps", "ufl");
// a.addToVect("ufl", "gmail");
// a.addToVect("google", "maps");
// a.addToVect("ufl", "maps");
// a.addToVect("maps", "facebook");
//
// a.findRT();
// a.firstRValues();
// a.pageRank(50);
// actualOutput = a.returnValues();
//
// REQUIRE(actualOutput == expectedOutput);
//}
//