Skip to content

Vector tests for the drawing table and the drawing file container - #52

Merged
mahach666 merged 2 commits into
mainfrom
feat/dg-vectors
Nov 29, 2026
Merged

mahach666 merged 2 commits into
mainfrom
feat/dg-vectors

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

The format facts behind DrawingRow and the drawing files are now backed by the private vectors, so they are
regression-checked the same way as the other table facts.

What changed

  • New vector db-tables-office-sec027-drawings.bin (manifest-db-tables.json): the whole drawing table (key 27,
    24 rows of 256 bytes) of the office sample, with the expected identifier, object type, mark, creation and
    modification times, .dg file name, drawing type name and the row stamps a and b of every row.
  • New vector db-container-office-dg-head272.bin (manifest-db-container.json): the first 272 unpacked bytes of a
    drawing file — the 12-byte header (Xsteel type 0x20, version 9.52), the word 47, the 48 records of the id list
    (flags all 04, the last one 00) and the first 16 bytes of the content area.
  • VectorTests.Drawings decodes both and checks the manifest values; both tests skip without the private vector
    folder, and TestVectors.CheckKeys fails the test when the manifest grows a key the test does not handle.

No product code changes; the tests that run without the private folder skip as before.

Verification

  • With TDBIO_TEST_VECTORS set: TdbIO.Tests 541 passed / 17 skipped on net8.0 and net10.0 (the two new vector tests
    included; the vector bytes are checked against the manifest SHA-256).
  • Without it (CI mode): 518 passed / 40 skipped on both target frameworks; TdbIO.Scene.Tests 13/13.

The format facts of the drawing table (key 27, rows of 256 bytes) and of the
.dg container (type 0x20, the id list of 47 records and the content start at
byte 256) are now backed by the private vectors:

- db-tables-office-sec027-drawings.bin: the whole drawing table of the office
  sample, 24 rows, with the expected id, object type, mark, save times, file
  name and type name of every row and the row stamps a and b.
- db-container-office-dg-head272.bin: the first 272 unpacked bytes of a
  drawing file: the 12-byte header, the record list and the first 16 bytes of
  the content area.

VectorTests.Drawings decodes both and checks the manifest values; the tests
skip without the private vector folder.
Take the content of the drawing file from the end of the id list, compare the
times without cutting off a fraction, and check through the library that the
file is recognised as a drawing and not read as a model database.

List the value of the flags key as ignored, because the test checks the flag
bytes against its own pattern. Remove a check that could not fail.
@mahach666
mahach666 merged commit 4d1a19d into main Nov 29, 2026
3 checks passed
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.

1 participant