Repository navigation
Commit 4d6bd4d
committed
fix(tests,windows): repair PR #12 Windows failures and status JSON errors
1. tests/test_index_resilience.c: the `outside` buffer in
index_metrics_out_outside_root_refused was 64 bytes. On Windows
cbm_mkdtemp expands the template into a ~86-byte temp path via strcpy,
overflowing the buffer. Enlarged to 256 bytes. The other metrics_out
test and the extra/metrics buffers (300 bytes) were checked and are
large enough.
2. tests/test_cli.c: four Windows legacy-hook migration tests called
cbm_install_agent_configs, which in this fork installs skills only, so
cbm_remove_owned_legacy_hook_script never ran. They now call
cbm_install_agent_hooks_for_testing; other calls are unchanged.
3. src/foundation/compat_fs.c: the Windows cbm_opendir returned NULL
without setting errno when FindFirstFileW failed. execute_projects in
src/operations/read.c treats NULL with errno != ENOENT as an
unreadable cache directory, so `projects` failed on Windows when the
cache directory did not exist. GetLastError() is now mapped:
FILE_NOT_FOUND/PATH_NOT_FOUND -> ENOENT, ACCESS_DENIED -> EACCES,
ERROR_DIRECTORY -> ENOTDIR, otherwise EIO.
4. src/main.c: the daemon status JSON printer ignored the return values
of the yyjson add calls and could print partial or empty JSON. The
results are now combined; on failure it prints "error: could not build
status JSON" to stderr, and a NULL from yyjson_mut_write prints
"error: could not serialize status JSON". The function stays void.1 parent 637678e commit 4d6bd4d
4 files changed
Lines changed: 38 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2166 | 2166 | | |
2167 | 2167 | | |
2168 | 2168 | | |
2169 | | - | |
2170 | | - | |
2171 | | - | |
2172 | | - | |
2173 | | - | |
2174 | | - | |
2175 | | - | |
2176 | | - | |
2177 | | - | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
2178 | 2185 | | |
2179 | 2186 | | |
2180 | | - | |
2181 | | - | |
2182 | | - | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
2183 | 2190 | | |
| 2191 | + | |
| 2192 | + | |
2184 | 2193 | | |
2185 | 2194 | | |
2186 | 2195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8908 | 8908 | | |
8909 | 8909 | | |
8910 | 8910 | | |
8911 | | - | |
| 8911 | + | |
8912 | 8912 | | |
8913 | 8913 | | |
8914 | 8914 | | |
| |||
9009 | 9009 | | |
9010 | 9010 | | |
9011 | 9011 | | |
9012 | | - | |
| 9012 | + | |
9013 | 9013 | | |
9014 | 9014 | | |
9015 | 9015 | | |
| |||
9022 | 9022 | | |
9023 | 9023 | | |
9024 | 9024 | | |
9025 | | - | |
| 9025 | + | |
9026 | 9026 | | |
9027 | 9027 | | |
9028 | 9028 | | |
| |||
9049 | 9049 | | |
9050 | 9050 | | |
9051 | 9051 | | |
9052 | | - | |
| 9052 | + | |
9053 | 9053 | | |
9054 | 9054 | | |
9055 | 9055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | | - | |
| 812 | + | |
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
| |||
0 commit comments