test(libSceJson2): compare valid memory and reader parsing #12778

Merged
StoneDC merged 4 commits from upstream-pr/12778 into main 2026-11-08 16:17:29 +00:00
StoneDC commented 2026-10-29 08:42:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-29T08:42:09Z.


What

Check the expected Value tree for three valid JSON documents through both the memory and character-reader parsing entry points. The fixtures cover escaped control characters, BMP and supplementary UTF-8, empty containers, whitespace and 32 nested arrays.

Create a real Json2 allocation context before constructing the values. The fixture reuses JsonTest::Allocator, canonical InitParameter2 setters and the public Initializer entry points. Values are destroyed before termination, and the test checks initialization and termination status. The existing document, reader callback and expected-tree assertions are retained. Parse failures now print the document index, reader mode and status code.

Tested

Exact tested head e4b51540fee3f5757a85f883f1e12731a74cdcb9 includes main 49f36536321fa3941deb9408d556597dab1e4e28. The merge preview and conventions were also checked against current main 105c9e4d914ba83d7dbe62e5df2cdb0b5c848ac3.

Windows 11 with MinGW GCC 15.2/CMake 4.3.1 and non-root WSL Ubuntu 26.04 with GCC 15.2/CMake 4.2.3. Each platform used the full repository CMake configuration and built the registered guest_json_reader_equivalence_tests target with current libc, libkernel and libSceJson2 dependencies.

  • Before the initialization fix, the real registered test fails on both platforms. The diagnostic Windows run identifies document 0, memory mode, status 0x80848102. The current library returns no allocation when the allocation context is absent.
  • After the fix, ctest --test-dir BUILD -R '^guest_json_reader_equivalence$' -V --output-on-failure --repeat until-fail:3 passes all three runs on each platform, with zero skips. Each run checks all three documents through both entry points. The existing 20-second limit is retained.
  • Original Check() and Read() bodies and all document strings are retained. The production Json2 implementation and the shared allocator helper match main.

Current-main conventions, whitespace and test registration pass. Hosted CI completed on e4b51540fee3f5757a85f883f1e12731a74cdcb9 with 5 passed and 7 skipped checks. The Windows job builds the actual guest test and runs guest_json_reader_equivalence successfully in 0.02 seconds. The job reports zero failures out of 3,665 scheduled CTests, including its platform/feature skips. Library portability, conventions, labels and eligibility also passed. Windows build and tests · Library portability

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5064950242 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12778). Originally posted by [StoneDC](https://github.com/StoneDC) on 2026-10-29T08:42:09Z. --- ### What Check the expected Value tree for three valid JSON documents through both the memory and character-reader parsing entry points. The fixtures cover escaped control characters, BMP and supplementary UTF-8, empty containers, whitespace and 32 nested arrays. Create a real Json2 allocation context before constructing the values. The fixture reuses JsonTest::Allocator, canonical InitParameter2 setters and the public Initializer entry points. Values are destroyed before termination, and the test checks initialization and termination status. The existing document, reader callback and expected-tree assertions are retained. Parse failures now print the document index, reader mode and status code. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Exact tested head `e4b51540fee3f5757a85f883f1e12731a74cdcb9` includes main `49f36536321fa3941deb9408d556597dab1e4e28`. The merge preview and conventions were also checked against current main `105c9e4d914ba83d7dbe62e5df2cdb0b5c848ac3`. Windows 11 with MinGW GCC 15.2/CMake 4.3.1 and non-root WSL Ubuntu 26.04 with GCC 15.2/CMake 4.2.3. Each platform used the full repository CMake configuration and built the registered guest_json_reader_equivalence_tests target with current libc, libkernel and libSceJson2 dependencies. - Before the initialization fix, the real registered test fails on both platforms. The diagnostic Windows run identifies document 0, memory mode, status 0x80848102. The current library returns no allocation when the allocation context is absent. - After the fix, ctest --test-dir BUILD -R '^guest_json_reader_equivalence$' -V --output-on-failure --repeat until-fail:3 passes all three runs on each platform, with zero skips. Each run checks all three documents through both entry points. The existing 20-second limit is retained. - Original Check() and Read() bodies and all document strings are retained. The production Json2 implementation and the shared allocator helper match main. Current-main conventions, whitespace and test registration pass. Hosted CI completed on `e4b51540fee3f5757a85f883f1e12731a74cdcb9` with **5 passed and 7 skipped checks**. The Windows job builds the actual guest test and runs guest_json_reader_equivalence successfully in 0.02 seconds. The job reports zero failures out of 3,665 scheduled CTests, including its platform/feature skips. Library portability, conventions, labels and eligibility also passed. [Windows build and tests](https://github.com/boykopovar/AnyPS5/actions/runs/42474422068/job/128715217511) · [Library portability](https://github.com/boykopovar/AnyPS5/actions/runs/42474422080/job/128712430966) ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12778
No description provided.