| 72 | return ok; |
| 73 | } |
| 74 | static bool pc_files_equal(const char *left, const char *right) { |
| 75 | FILE *a = cbm_fopen(left, "rb"), *b = cbm_fopen(right, "rb"); |
| 76 | bool ok = a && b; |
| 77 | unsigned char x[4096], y[4096]; |
| 78 | while (ok) { |
| 79 | size_t nx = fread(x, 1, sizeof(x), a), ny = fread(y, 1, sizeof(y), b); |
| 80 | if (nx != ny || memcmp(x, y, nx) != 0) { ok = false; break; } |
| 81 | if (nx < sizeof(x)) { ok = !ferror(a) && !ferror(b); break; } |
| 82 | } |
| 83 | if (a && fclose(a) != 0) ok = false; |
| 84 | if (b && fclose(b) != 0) ok = false; |
| 85 | return ok; |
| 86 | } |
| 87 | static bool pc_fixture_open(pc_fixture_t *f, bool parallel) { |
| 88 | memset(f, 0, sizeof(*f)); |
| 89 | const char *home = th_mktempdir("cbm-pipeline-conventions"); |
no test coverage detected