Two defects in the test suite, both of the kind that fails on another
machine but not on the one it was written on.
1. Seven tests put their scratch directories below /tmp/opencode --
a directory of the environment they were written in, not of the
system. mkdtemp() returns NULL when the parent is missing, so on a
machine without /tmp/opencode every one of them failed with a "NULL"
check or perror("mkdtemp"), and nothing was wrong with the code under
test. dc_test_tmpdir() (dc_internal.h, instance.c) now uses $TMPDIR,
or /tmp when it is unset or not absolute.
Measured: after renaming /tmp/opencode away (sudo mv), make check in
lib/libDtChat is 24/24; before the change the same run failed on
test_identity, test_pair, test_store, test_instance, test_filexfer,
test_local and test_i18n.
2. test_i18n takes <de.msg> <en.msg> but TESTS runs it without arguments
(f46a914c added it to TESTS without a runner), so `make check' always
reported "FAIL: test_i18n" with the usage line -- measured 2026-11-22
on the merge build, and identically on build/mcde-host, so not a
regression of that merge. tools/mcde-tests.sh names the files and
passes; the test now falls back to $srcdir (which automake's test
driver exports) and finds them itself, the arguments still winning.
Test: make check in lib/libDtChat -> 24/24 PASS (was 23/24). Both call
forms of test_i18n give "test_i18n: all ok": with the two arguments and
without them. With /tmp/opencode renamed away the full check is green as
well, and the seven scratch directories appear under $TMPDIR when set.
instance.c: DIR/run 0700, dtchat.lock 0600 with flock(LOCK_EX|LOCK_NB), primary Unix listener at dtchat.sock 0600, one open request per client with a 2 s timeout, non-primary instance plus dc_instance_notify with connect retries, and socket/lock cleanup on close. test_instance covers primary/secondary, modes, open callback, malformed client, notify after close and re-acquisition. make mcde-host exit=0; all eight dtchat tests 'all ok'; ASan/UBSan clean. SIGPIPE is ignored so a dead local client cannot kill the core.