Skip to content

fix: do178 --dal invalid value returns exit 2, accept DAL-A format (v0.5.26)#36

Merged
SoundMatt merged 1 commit into
mainfrom
feat/do178-dal-parity
Jun 13, 2026
Merged

fix: do178 --dal invalid value returns exit 2, accept DAL-A format (v0.5.26)#36
SoundMatt merged 1 commit into
mainfrom
feat/do178-dal-parity

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

  • cfusa do178 --dal DAL-Z now returns exit 2 (usage error); was returning exit 1 (gate fail)
  • Accepts both a|b|c|d and DAL-A|DAL-B|DAL-C|DAL-D format (case-insensitive); previously DAL-A was silently misread as DAL-D
  • Parity with go-FuSa TestRunDo178_InvalidDALv2
  • Bumps to v0.5.26

Test plan

  • test_do178_invalid_dal_returns_2 — --dal DAL-Z → exit 2
  • test_do178_dal_prefix_format_accepted — --dal DAL-A → exit != 2
  • All 34 test suites pass

…0.5.26)

cfusa do178 --dal with an unrecognized DAL now returns exit 2 (usage
error) instead of exit 1. Also accepts "DAL-A"/"DAL-B"/... prefix
format in addition to the short "a"/"b"/... form; previously DAL-A
was misread as DAL-D (first char 'D'). Parity with go-FuSa
TestRunDo178_InvalidDALv2.

Signed-off-by: Matt Jones <matt@jellybaby.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Comment thread cmd/cfusa/cmd_do178.c
const char *dal_key = dal_s;
if ((dal_key[0]|0x20)=='d' && (dal_key[1]|0x20)=='a' &&
(dal_key[2]|0x20)=='l' && dal_key[3]=='-')
dal_key += 4; /* skip "DAL-" prefix */
Comment thread tests/test_commands2.c
//cfusa:test REQ-DO178-DAL001
void test_do178_invalid_dal_returns_2(void)
{
char *argv[] = {"cfusa", "--dir", CMD2_DIR, "--dal", "DAL-Z", NULL};
Comment thread tests/test_commands2.c
//cfusa:test REQ-DO178-DAL001
void test_do178_dal_prefix_format_accepted(void)
{
char *argv[] = {"cfusa", "--dir", CMD2_DIR, "--dal", "DAL-A", NULL};
Comment thread cmd/cfusa/cmd_do178.c
/* Determine DAL level — accept "a" or "DAL-A" format (case-insensitive) */
const char *dal_key = dal_s;
if ((dal_key[0]|0x20)=='d' && (dal_key[1]|0x20)=='a' &&
(dal_key[2]|0x20)=='l' && dal_key[3]=='-')
Comment thread cmd/cfusa/cmd_do178.c
/* Determine DAL level — accept "a" or "DAL-A" format (case-insensitive) */
const char *dal_key = dal_s;
if ((dal_key[0]|0x20)=='d' && (dal_key[1]|0x20)=='a' &&
(dal_key[2]|0x20)=='l' && dal_key[3]=='-')
@SoundMatt SoundMatt merged commit de073db into main Jun 13, 2026
9 of 10 checks passed
@SoundMatt SoundMatt deleted the feat/do178-dal-parity branch June 13, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants