MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / openhands_profile_refs_equal

Function openhands_profile_refs_equal

tests/test_cli.c:5590–5602  ·  view source on GitHub ↗

profile → mcp_server_refs must be exactly the given strings in order. */

Source from the content-addressed store, hash-verified

5588
5589/* profile → mcp_server_refs must be exactly the given strings in order. */
5590static bool openhands_profile_refs_equal(const char *profile_path, const char *const *expected,
5591 size_t expected_count) {
5592 yyjson_doc *doc = openhands_read_doc(profile_path);
5593 yyjson_val *root = doc ? yyjson_doc_get_root(doc) : NULL;
5594 yyjson_val *refs = root ? yyjson_obj_get(root, "mcp_server_refs") : NULL;
5595 bool ok = refs && yyjson_is_arr(refs) && yyjson_arr_size(refs) == expected_count;
5596 for (size_t i = 0; ok && i < expected_count; i++) {
5597 yyjson_val *item = yyjson_arr_get(refs, i);
5598 ok = item && yyjson_is_str(item) && strcmp(yyjson_get_str(item), expected[i]) == 0;
5599 }
5600 yyjson_doc_free(doc);
5601 return ok;
5602}
5603
5604static bool openhands_file_equals(const char *path, const char *expected) {
5605 char *data = read_test_file_alloc(path);

Callers 1

test_cli.cFile · 0.85

Calls 1

openhands_read_docFunction · 0.85

Tested by

no test coverage detected