test(libcairo): verify repeated null free and single-glyph immutability #18969

Merged
al3w0f205 merged 1 commit from upstream-pr/18969 into main 2026-11-12 18:44:53 +00:00
al3w0f205 commented 2026-11-12 16:15:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by al3w0f205 on 2026-11-12T16:15:20Z.


What

  • Expand GuestCairoGlyph.cpp to test repeated cairo_glyph_free(nullptr) calls and verify a single foreign cairo_glyph_t throws without mutating its fields.

Tested

  • Windows 11 (MinGW64 GCC 15.2.0): built guest_cairo_glyph_tests and ran ctest --test-dir build-all -R "^guest_cairo_glyph$" --output-on-failure (1/1 passed).

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:5280968438 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18969). Originally posted by [al3w0f205](https://github.com/al3w0f205) on 2026-11-12T16:15:20Z. --- ### What - Expand `GuestCairoGlyph.cpp` to test repeated `cairo_glyph_free(nullptr)` calls and verify a single foreign `cairo_glyph_t` throws without mutating its fields. ### Tested - Windows 11 (MinGW64 GCC 15.2.0): built `guest_cairo_glyph_tests` and ran `ctest --test-dir build-all -R "^guest_cairo_glyph$" --output-on-failure` (`1/1` passed). ### Checklist - [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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-12 18:41:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T18:41:25Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 99c832c4f4:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_cairo_glyph_tests built cleanly.
  • CTest (guest_cairo_glyph):
    1/1 Test #4370: guest_cairo_glyph ................   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Code reading:
    • core/libs/tests/GuestCairoGlyph.cpp: Verified repeated cairo_glyph_free(nullptr) invocation preserves idempotent no-op behavior without side effects or unhandled exceptions.
    • core/libs/tests/GuestCairoGlyph.cpp: Verified cairo_glyph_free(&single) foreign pointer check correctly tests exception throwing (std::runtime_error) consistent with existing array behavior.
    • core/libs/tests/GuestCairoGlyph.cpp: Verified immutability verification on cairo_glyph_t fields (index == 42, x == -1.0, y == 3.5) uses exact dyadic floating-point values without precision or rounding pitfalls.
    • core/libs/tests/GuestCairoGlyph.cpp: Verified aggregate initialization syntax, member offsets, and 64-bit alignment/type safety across LP64 and LLP64 platforms against static_assert invariants.
    • core/libs/tests/GuestCairoGlyph.cpp: Confirmed zero comments were introduced, preserving strict AGENTS.md compliance, and error paths return 1 with descriptive diagnostics to stderr.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5880071558 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18969#pullrequestreview-5880071558). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T18:41:25Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `99c832c4f4`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_cairo_glyph_tests` built cleanly. - **CTest** (`guest_cairo_glyph`): ``` 1/1 Test #4370: guest_cairo_glyph ................ Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Code reading**: - core/libs/tests/GuestCairoGlyph.cpp: Verified repeated cairo_glyph_free(nullptr) invocation preserves idempotent no-op behavior without side effects or unhandled exceptions. - core/libs/tests/GuestCairoGlyph.cpp: Verified cairo_glyph_free(&single) foreign pointer check correctly tests exception throwing (std::runtime_error) consistent with existing array behavior. - core/libs/tests/GuestCairoGlyph.cpp: Verified immutability verification on cairo_glyph_t fields (index == 42, x == -1.0, y == 3.5) uses exact dyadic floating-point values without precision or rounding pitfalls. - core/libs/tests/GuestCairoGlyph.cpp: Verified aggregate initialization syntax, member offsets, and 64-bit alignment/type safety across LP64 and LLP64 platforms against static_assert invariants. - core/libs/tests/GuestCairoGlyph.cpp: Confirmed zero comments were introduced, preserving strict AGENTS.md compliance, and error paths return 1 with descriptive diagnostics to stderr. - Note: the AI-assisted checkbox can stay. Looks Good To Me
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!18969
No description provided.