Hash :
9a7378f1
Author :
Date :
2023-04-22T17:38:28
string-desc tests: Avoid test failure on native Windows. * tests/test-string-desc.c: Include <fcntl.h>, <unistd.h>. (main): Expect a file name argument. Write to this file, instead of to fd 3. * tests/test-string-desc.sh: Pass a file name as argument, instead of using '3>'. * modules/string-desc-tests (Depends-on): Add close.
#!/bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ .
${CHECKER} test-string-desc${EXEEXT} test-string-desc-3.tmp > test-string-desc-1.tmp || Exit 1
printf 'Hello world!The\0quick\0brown\0\0fox\0' > test-string-desc.ok
: "${DIFF=diff}"
${DIFF} test-string-desc.ok test-string-desc-1.tmp || { echo "string_desc_fwrite KO" 1>&2; Exit 1; }
${DIFF} test-string-desc.ok test-string-desc-3.tmp || { echo "string_desc_write KO" 1>&2; Exit 1; }
Exit 0