Skip to content

test: cover array-valued custom properties#12

Merged
TobbenTM merged 2 commits into
mainfrom
custom-properties-array-support
May 28, 2026
Merged

test: cover array-valued custom properties#12
TobbenTM merged 2 commits into
mainfrom
custom-properties-array-support

Conversation

@TobbenTM
Copy link
Copy Markdown
Member

Summary

  • Pin down that JSON arrays inside the product, user, license, and trial property bags survive validate_token and the memory/file store round-trip.
  • Mirrors the new array variant added to NestedPropertyValue in moonbase.js so a future stricter check here can't silently break the contract.
  • Tests only — no production code changes; nlohmann::json already accepted arrays as property values.

Test plan

  • cmake --build build --target moonbase_tests
  • ctest --test-dir build --output-on-failure — 51/51 pass, including the new "custom properties carry array values" case

TobbenTM added 2 commits May 28, 2026 20:05
Pin down that JSON arrays inside the product, user, license, and trial
property bags survive validate_token and the memory/file store round-trip.
The API in moonbase.js now allows array variants in NestedPropertyValue;
these tests guard against a future stricter check silently breaking the
contract here.
On Windows, file_lock's constructor called _chsize_s before _locking. With
multiple sibling acquirers — exactly the scenario the file_license_store
lock_for_update tests exercise — a later thread's SetEndOfFile would race
against the byte-range lock held by the first acquirer and fail with
EACCES, throwing storage_error out of the worker lambda and aborting the
test process with SIGABRT. _locking already accepts ranges past EOF per
MSDN, so drop the _chsize_s/_lseek prelude entirely; the open + lock are
sufficient.

Also wrap the file-lock test workers in a top-level try/catch that bumps
an atomic counter, so any future lock-acquisition failure surfaces as a
CHECK on the main thread instead of a process abort.
@TobbenTM TobbenTM merged commit 2d603f7 into main May 28, 2026
4 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