Skip to content

Commit b807208

Browse files
committed
a few more changes
1 parent cb12e32 commit b807208

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/min_cut_test.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,32 @@ static size_t get_seed() {
1717
return s;
1818
}
1919

20+
// Test for constructing mincut and driver. Just to ensure everything work
2021
TEST(MinCutTest, Construction) {
22+
const std::string fname = __FILE__;
23+
size_t pos = fname.find_last_of("\\/");
24+
const std::string curr_dir = (std::string::npos == pos) ? "" : fname.substr(0, pos);
25+
AsciiFileStream stream{curr_dir + "/res/multiples_graph_1024.txt", false};
26+
27+
MinCutSketchAlg mc_alg(1024, get_seed());
28+
GraphSketchDriver<MinCutSketchAlg> driver(&mc_alg, &stream, DriverConfiguration());
29+
}
30+
31+
TEST(MinCutTest, DisconnectedMinCut) {
32+
auto driver_config = DriverConfiguration();
33+
const std::string fname = __FILE__;
34+
size_t pos = fname.find_last_of("\\/");
35+
const std::string curr_dir = (std::string::npos == pos) ? "" : fname.substr(0, pos);
36+
AsciiFileStream stream{curr_dir + "/res/multiples_graph_1024.txt", false};
37+
node_id_t num_nodes = stream.vertices();
38+
2139
MinCutSketchAlg mc_alg(1024, get_seed());
40+
41+
GraphSketchDriver<CCSketchAlg> driver(&cc_alg, &stream, driver_config);
42+
driver.process_stream_until(END_OF_STREAM);
43+
driver.prep_query(MINIMUMCUT);
44+
driver.check_verifier(GraphVerifier(1024, curr_dir + "/res/multiples_graph_1024.txt"));
45+
46+
ASSERT_EQ(0, mc_alg.minimum_cut().value);
2247
}
48+

0 commit comments

Comments
 (0)