| 2366 | } |
| 2367 | |
| 2368 | static bool atlas_history_test_commit(const char *json, const char *array, const char *subject) { |
| 2369 | yyjson_doc *doc = json ? yyjson_read(json, strlen(json), 0) : NULL; |
| 2370 | if (!doc) |
| 2371 | return false; |
| 2372 | yyjson_val *root = yyjson_doc_get_root(doc); |
| 2373 | yyjson_val *commits = yyjson_obj_get(root, array); |
| 2374 | const char *got = yyjson_get_str(yyjson_obj_get(yyjson_arr_get(commits, 0), "subject")); |
| 2375 | bool matches = yyjson_get_bool(yyjson_obj_get(root, "available")) && |
| 2376 | yyjson_arr_size(commits) == 1 && got && strcmp(got, subject) == 0; |
| 2377 | yyjson_doc_free(doc); |
| 2378 | return matches; |
| 2379 | } |
| 2380 | |
| 2381 | static bool atlas_history_test_remote(const char *json, const char *expected) { |
| 2382 | yyjson_doc *doc = json ? yyjson_read(json, strlen(json), 0) : NULL; |