profile → mcp_server_refs must be exactly the given strings in order. */
| 5588 | |
| 5589 | /* profile → mcp_server_refs must be exactly the given strings in order. */ |
| 5590 | static 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 | |
| 5604 | static bool openhands_file_equals(const char *path, const char *expected) { |
| 5605 | char *data = read_test_file_alloc(path); |
no test coverage detected