Skip to content

Commit 8292e3e

Browse files
committed
test: size hook log temp buffers for Windows paths
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 7122298 commit 8292e3e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎tests/test_cli.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14660,7 +14660,7 @@ static int hl_run_hook(const char *home, const char *cache_dir) {
1466014660
* near-1 KiB path can be neither created nor probed, which hides the very
1466114661
* cut-off file these tests look for. */
1466214662
static bool hl_make_root(char *root, size_t root_sz) {
14663-
char tmpl[64];
14663+
char tmpl[256];
1466414664
char real[4096];
1466514665
snprintf(tmpl, sizeof(tmpl), "/tmp/cbm-hooklog-XXXXXX");
1466614666
if (!cbm_mkdtemp(tmpl)) {

‎tests/test_index_resilience.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ TEST(index_long_log_override_writes_no_cut_path) {
298298
* root has its links resolved: the kernel bounds the EXPANDED path, and
299299
* under macOS's /tmp -> /private/tmp link a near-1 KiB path can be neither
300300
* created nor probed, which would hide the cut-off file. */
301-
char tmpl[64];
301+
/* cbm_mkdtemp writes the %TEMP%-expanded path back on Windows, so the
302+
* template buffer needs the 256 bytes that compat.h asks for. */
303+
char tmpl[256];
302304
char logroot[4096];
303305
snprintf(tmpl, sizeof(tmpl), "/tmp/cbm_resil_log_XXXXXX");
304306
if (!cbm_mkdtemp(tmpl)) {

0 commit comments

Comments
 (0)