test: cover array-valued custom properties#12
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
product,user,license, and trial property bags survivevalidate_tokenand the memory/file store round-trip.arrayvariant added toNestedPropertyValuein moonbase.js so a future stricter check here can't silently break the contract.nlohmann::jsonalready accepted arrays as property values.Test plan
cmake --build build --target moonbase_testsctest --test-dir build --output-on-failure— 51/51 pass, including the new "custom properties carry array values" case