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

Function write_xlang_route_fixture

tests/test_pipeline.c:2403–2422  ·  view source on GitHub ↗

Writes app.js + tool.py + `pad` JS filler files (the fillers only select the * parallel path: more than MIN_FILES_FOR_PARALLEL files). 0 on success. */

Source from the content-addressed store, hash-verified

2401/* Writes app.js + tool.py + `pad` JS filler files (the fillers only select the
2402 * parallel path: more than MIN_FILES_FOR_PARALLEL files). 0 on success. */
2403static int write_xlang_route_fixture(const char *dir, int pad) {
2404 char path[512];
2405 snprintf(path, sizeof(path), "%s/app.js", dir);
2406 if (th_write_file(path, XLANG_APP_JS) != 0) {
2407 return -1;
2408 }
2409 snprintf(path, sizeof(path), "%s/tool.py", dir);
2410 if (th_write_file(path, XLANG_TOOL_PY) != 0) {
2411 return -1;
2412 }
2413 for (int i = 0; i < pad; i++) {
2414 char source[128];
2415 snprintf(path, sizeof(path), "%s/xlang_pad_%02d.js", dir, i);
2416 snprintf(source, sizeof(source), "function xlangPad%02d() { return %d; }\n", i, i);
2417 if (th_write_file(path, source) != 0) {
2418 return -1;
2419 }
2420 }
2421 return 0;
2422}
2423
2424/* Saves and overrides the two worker-selection variables. */
2425typedef struct {

Callers 2

run_xlang_route_caseFunction · 0.85
test_pipeline.cFile · 0.85

Calls 1

th_write_fileFunction · 0.85

Tested by

no test coverage detected