From 232f288e8a0fca25dca3e548a61b782b17d94591 Mon Sep 17 00:00:00 2001 From: wjf-hs Date: Tue, 22 Apr 2025 14:35:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B1=E4=BA=8E=E7=8E=B0=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E5=85=88=E8=B0=83=E8=8A=82=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=93=E6=9E=84=E3=80=82=E5=9B=A0=E6=AD=A4=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E5=8F=96=E6=B6=88graph=E7=9B=B8=E5=85=B3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=90=8E=E7=BB=AD=E5=86=8D?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graph.c | 14 +++++++------- test/test_graph.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/graph.c b/src/graph.c index 3893c2b..ab1b305 100644 --- a/src/graph.c +++ b/src/graph.c @@ -152,7 +152,7 @@ static bool graph_bfs(struct _graph *self, uint32_t idx) { self->_head->visited[i] = 0; } - printf("bfs start.\n"); + // printf("bfs start.\n"); queue_t queue = queue_new(); queue_init(queue, sizeof(uint32_t)); @@ -171,16 +171,16 @@ static bool graph_bfs(struct _graph *self, uint32_t idx) queue->push(queue, &i); } - self->print_obj((char *)self->_head->obj + idx * self->_obj_size); - printf("->"); - self->print_obj((char *)self->_head->obj + i * self->_obj_size); - printf(", "); + // self->print_obj((char *)self->_head->obj + idx * self->_obj_size); + // printf("->"); + // self->print_obj((char *)self->_head->obj + i * self->_obj_size); + // printf(", "); } } - printf("\n"); + // printf("\n"); } queue_free(&queue); - printf("bfs done.\n"); + // printf("bfs done.\n"); return true; } diff --git a/test/test_graph.c b/test/test_graph.c index b5947e2..91e959f 100644 --- a/test/test_graph.c +++ b/test/test_graph.c @@ -49,7 +49,7 @@ void test_graph_from_matrix(void) // graph->print(graph); graph->from_matrix(graph, vertexs, matrix, size); - graph->print(graph); + // graph->print(graph); graph->bfs(graph, 1); @@ -59,7 +59,7 @@ void test_graph_from_matrix(void) void test_graph(void) { - RUN_TEST(test_graph_new); + // RUN_TEST(test_graph_new); // RUN_TEST(test_graph_print); - RUN_TEST(test_graph_from_matrix); + // RUN_TEST(test_graph_from_matrix); }