Files
LithosAnanake/v4/tests/post_cases_fail.c
T
rajamesandClaude Opus 5.5 18adf59091 fix(v4.0.0): POST leaves nothing, as v3 really does; and what the review of step 6b found
Captain Bob was told that v3 leaves the words POST's cases define in the
dictionary, and ruled that v4 should.  That was false: v3's run_test_suite
puts the dictionary back after each word's cases (test_common.c:333,
:365).  Shown that, he ruled that POST leaves nothing.  The boot now
seals the system, runs POST, and has the node do COLD, whose printing is
not shown; PARITY:V4_SYSTEM is the system as sealed.

A case the node does not come back from ends POST there, named, with how
many were not run: it would have stalled the boot for hours, where the
capsule had ended it.  The runner's test of it now uses a word that
really never ends.

hosted-check also requires that RS1 and T{ are unknown after boot, and
boots a program whose POST has failing cases (tests/post_cases_fail.c):
PARITY:FAIL, POST: FAILED, no prompt, none of a case's printing shown.

Comments and documents that still named the POST capsule or its two
hooks are brought up to date; NUCLEUS.md 6.3 says what v3 does, with the
lines, and how the wrong ruling came about.

make -C v4 test, sanitize and hosted-check pass; amd64, aarch64 and
riscv64 boot, POST 538 of 538, word_count=314, dict_hash
0x220ab283a504a3b3 on all six: logs/20261007-112638, -112901, -113220.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:40:20 -04:00

25 lines
1.1 KiB
C

/* post_cases_fail.c -- a table of cases for the boot to fail on.
* docs/v4.0.0/MESH.md step 6b, acceptance 4; v4/Makefile, hosted-check.
*
* Linked into a hosted program in the place of v4/system/post_cases.c, so
* that the boot itself (v4/system/boot.c) is seen to stop on a failing
* case, to keep what a case prints off the console, and to hold no more of
* it than it has room for. It is not a test program of its own: the suite
* does not build it.
*/
#include "v4/post.h"
static const char *const l_right[] = { "5 DUP . . CR" };
static const char *const l_wrong[] = { "5 DUP . . CR" };
static const char *const l_many[] = { ": MANY 2000 0 DO 81 EMIT LOOP ;", "MANY" };
static const char *const l_two[] = { "65 EMIT", "66 EMIT" };
const v4_post_case v4_post_cases[] = {
{ "fail.right", l_right, 1u, V4_POST_STACK, 0, 0u, "5 5 \012", 5u },
{ "fail.wrong", l_wrong, 1u, V4_POST_STACK, 0, 0u, "5 6 \012", 5u },
{ "fail.many", l_many, 2u, V4_POST_STACK, 0, 0u, "Q", 1u },
{ "fail.twoline", l_two, 2u, V4_POST_STACK, 0, 0u, "AB", 2u },
};
const unsigned v4_post_case_count = 4u;