@@ -327,7 +327,7 @@ static bool dm_namespace_published(const char *db, const char *project, bool val
327327 dm_row(db, "Healthy.cs", "Hidden", conflict_reason, sizeof(conflict_reason), NULL, 0);
328328 int errors = dm_count(db, "SELECT COUNT(*) FROM doc_link_unresolved WHERE reason = 'error'");
329329 char *status = dm_index_status(project, false);
330- const char *block = status ? strstr (status, "doc_links:\n") : NULL ;
330+ const char *block = dm_doc_links_block (status) ;
331331 bool status_ok = block && strstr(block, "\n status: ok");
332332 int from_bad = dm_mentions_from(db, "Bad.FromBad");
333333 bool inside_ok = valid
@@ -687,7 +687,7 @@ static bool dm_control_published(const char *db, const char *project, const char
687687 dm_row(db, "Healthy.cs", "Hidden", conflict_reason, sizeof(conflict_reason), NULL, 0);
688688 int errors = dm_count(db, "SELECT COUNT(*) FROM doc_link_unresolved WHERE reason = 'error'");
689689 char *status = dm_index_status(project, false);
690- const char *block = status ? strstr (status, "doc_links:\n") : NULL ;
690+ const char *block = dm_doc_links_block (status) ;
691691 bool status_ok = block && strstr(block, "\n status: ok");
692692 bool correct = healthy == 1 && tail == 1 && !tail_reason[0] && conflict == 0 &&
693693 strcmp(conflict_reason, "graph_gap") == 0 && errors == 0 && status_ok;
@@ -4356,7 +4356,7 @@ static int dm_index_status_checks(const char *tmp, const char *repo, const char
43564356 /* doc_links: the edge count, every reason with its row count, the status */
43574357 char *text = dm_index_status(project, false);
43584358 ASSERT_NOT_NULL(text);
4359- const char *block = strstr (text, "doc_links:\n" );
4359+ const char *block = dm_doc_links_block (text);
43604360 ASSERT_NOT_NULL(block);
43614361 char want[64];
43624362 snprintf(want, sizeof(want), "\n mentions: %d\n", edges);
@@ -4371,7 +4371,7 @@ static int dm_index_status_checks(const char *tmp, const char *repo, const char
43714371 free(text);
43724372 text = dm_index_status(project, true);
43734373 ASSERT_NOT_NULL(text);
4374- block = strstr (text, "doc_links:\n" );
4374+ block = dm_doc_links_block (text);
43754375 ASSERT_NOT_NULL(block);
43764376 ASSERT_NOT_NULL(strstr(block, "samples"));
43774377 ASSERT_NOT_NULL(strstr(block, "TestOnlyThing"));
@@ -4389,7 +4389,7 @@ static int dm_index_status_checks(const char *tmp, const char *repo, const char
43894389 ASSERT_EQ(dm_count(db, "SELECT COUNT(*) FROM doc_link_unresolved WHERE reason = 'error'"), 1);
43904390 text = dm_index_status(project, false);
43914391 ASSERT_NOT_NULL(text);
4392- block = strstr (text, "doc_links:\n" );
4392+ block = dm_doc_links_block (text);
43934393 ASSERT_NOT_NULL(block);
43944394 ASSERT_NOT_NULL(strstr(block, "\n mentions: 0\n"));
43954395 ASSERT_NOT_NULL(strstr(block, "\n status: error"));
@@ -4421,7 +4421,7 @@ static int dm_index_status_checks(const char *tmp, const char *repo, const char
44214421 cbm_store_close(s);
44224422 text = dm_index_status(project, true);
44234423 ASSERT_NOT_NULL(text);
4424- block = strstr (text, "doc_links:\n" );
4424+ block = dm_doc_links_block (text);
44254425 ASSERT_NOT_NULL(block);
44264426 ASSERT_NOT_NULL(strstr(block, "\n status: error"));
44274427 ASSERT_NOT_NULL(strstr(block, "hint"));
@@ -4447,7 +4447,7 @@ static int dm_index_status_checks(const char *tmp, const char *repo, const char
44474447 sqlite3_close(h);
44484448 text = dm_index_status(project, false);
44494449 ASSERT_NOT_NULL(text);
4450- block = strstr (text, "doc_links:\n" );
4450+ block = dm_doc_links_block (text);
44514451 ASSERT_NOT_NULL(block);
44524452 ASSERT_NOT_NULL(strstr(block, "\n status: error"));
44534453 ASSERT_NOT_NULL(strstr(block, "predates"));
@@ -4458,7 +4458,7 @@ static int dm_index_status_checks(const char *tmp, const char *repo, const char
44584458 ASSERT_GT(dm_count(db, "SELECT COUNT(*) FROM doc_link_unresolved"), rows_before);
44594459 text = dm_index_status(project, false);
44604460 ASSERT_NOT_NULL(text);
4461- block = strstr (text, "doc_links:\n" );
4461+ block = dm_doc_links_block (text);
44624462 ASSERT_NOT_NULL(block);
44634463 ASSERT_NOT_NULL(strstr(block, "\n status: ok"));
44644464 free(text);
0 commit comments