gbdev / rgbds

Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color

Home Page:https://rgbds.gbdev.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add tests to improve code coverage

Rangi42 opened this issue · comments

Follow-up to #996, lots of particular test gaps discovered by #1221.

Covered by #1257:

  • Test more invalid STRFMT format strings.
  • Test expanding macro args or interpolated symbols which contain \n \r \t characters.
  • Test illegal character escapes.
  • Test line continuations in string literals.
  • Try defining a macro inside a REPT, and invoke it inside+outside.
  • Test BREAK outside a REPT.
  • Test too-long, non-numeric, zero, and undefined \<symbol>.
  • Test invalid characters after line continuations.
  • Test ELIF after ELSE block.
  • Test invalid OPT values (also from the command line).
  • Test PURGE on an undefined symbol.
  • Test EXPORT on an anonymous label.
  • Test nested REPT/FOR blocks.
  • Test BANK() of a symbol in a fixed section.
  • Test defining data in RAM section.
  • Test impossible alignment in a fixed SECTION UNION.
  • Test impossible alignment in a fixed SECTION FRAGMENT.
  • Test BANK() for WRAM0 or HRAM symbols.
  • Test SECTION inside UNION.
  • Test SECTION inside LOAD.
  • Test LOAD inside LOAD.
  • Test UNION outside a section.
  • Test UNION inside UNION.
  • Test NEXTU and ENDU outside UNION.
  • Test unterminated UNION.
  • Test ENDSECTION outside a SECTION, and within a UNION or LOAD.

Covered by #1256:

  • charmap_Delete is an unused function.
  • Test ATAN2.
  • Test invalid fixed-point constant, e.g. 3.14q.
  • Test integer constants that are too large.
  • Test no-digit $ and ` constants.
  • Test an .asm file with CR-LF newlines.
  • Test macro args in string literals.
  • Test the >= operator.
  • Test / in a macro arg that isn't part of /*.
  • macro_FreeArgs is an unused function.
  • Test more than 4 STRFMT args so it reallocates.
  • Test more than 2 PURGE args so it reallocates.
  • Test ASSERT FATAL.
  • Test FAIL.
  • Test diff marks at the beginning of lines.
  • Test unary +.
  • Test ldi and ldd.
  • Test ld [hl], [hl].
  • Test ld without a.
  • Test rst with an invalid address.
  • Test modulo by zero.
  • Test exponentiation by negative.
  • sect_String is an unused function.
  • sym_FindUnscopedSymbol is an unused function.
  • Test @ outside a section.
  • Test REDEF EQU with a not-yet-defined name.
  • Test REDEF EQU on a built-in symbol.

@ISSOtm Proposal to organize the tests into subdirectories. One could be for "error conditions", since so many of these uncovered cases are such. (Of course sometimes one test case will be able to cover everything, but other times an error would interfere with or halt subsequent processing.) Some existing tests could be moved into such a subdir.

Sure. The directory's listing is indeed huge.