Added current progress of a better written solution

This commit is contained in:
2023-09-28 14:21:04 -05:00
parent 259e26c257
commit f9b7ff0349
5 changed files with 79 additions and 31 deletions
+11
View File
@@ -0,0 +1,11 @@
10
1 2 2 3 3
2 4 1 5 4
3 6 2
4 8 2
5 9 3
6 8 1
7 9 2
8 10 3
9 10 2
10
+14
View File
@@ -55,11 +55,25 @@ void test_AllEdgesAdded(void) {
TEST_ASSERT_EQUAL_INT(9, testGraph.vertices.at(9).edges.at(1).destination->nodeNumber + 1);
}
void test_BFS(void) {
}
void test_DFS(void) {
testGraph = ReadInGraph("test/input/graphGenerated");
std::vector<Vertex*> solution = CleanSolution(DFS(testGraph, 0, 9));
TEST_ASSERT_EQUAL_INT(9, solution.at(4));
TEST_ASSERT_EQUAL_INT(7, solution.at(3));
TEST_ASSERT_EQUAL_INT(3, solution.at(2));
TEST_ASSERT_EQUAL_INT(1, solution.at(1));
TEST_ASSERT_EQUAL_INT(0, solution.at(0));
}
int main(void) {
UNITY_BEGIN();
RUN_TEST(test_GraphReadsIn);
RUN_TEST(test_AllVerticesAdded);
RUN_TEST(test_AllEdgesAdded);
RUN_TEST(test_DFS);
return UNITY_END();
}