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

Function pc_files_equal

tests/test_pipeline_conventions.c:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 return ok;
73}
74static 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}
87static 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");

Callers 3

pc_preservedFunction · 0.85
pc_snapshot_equalFunction · 0.85

Calls 2

cbm_fopenFunction · 0.85
freadFunction · 0.85

Tested by

no test coverage detected