| 32 | size_t expected_length); |
| 33 | |
| 34 | static int cte_fixture(char *dir, size_t dir_size, char *path, size_t path_size) { |
| 35 | char *created = th_mktempdir("cbm_text_edit"); |
| 36 | if (!created) { |
| 37 | return -1; |
| 38 | } |
| 39 | int dir_count = snprintf(dir, dir_size, "%s", created); |
| 40 | int path_count = snprintf(path, path_size, "%s/AGENTS.md", created); |
| 41 | if (dir_count < 0 || (size_t)dir_count >= dir_size || path_count < 0 || |
| 42 | (size_t)path_count >= path_size) { |
| 43 | th_cleanup(created); |
| 44 | return -1; |
| 45 | } |
| 46 | return 0; |
| 47 | } |
| 48 | |
| 49 | static int cte_write_bytes(const char *path, const char *data, size_t len) { |
| 50 | FILE *file = cbm_fopen(path, "wb"); |
no test coverage detected