Skip to content

test(libSceHttp2): cover the network error a request's status code and content length report - #11518

Closed
milescoviello wants to merge 1 commit into
boykopovar:mainfrom
milescoviello:test/http2-response-queries-offline
Closed

milescoviello wants to merge 1 commit into
boykopovar:mainfrom
milescoviello:test/http2-response-queries-offline

Conversation

@milescoviello

Copy link
Copy Markdown
Contributor

What

GuestHttp2.cpp now asks the request that sceHttp2SendRequest just failed for its status code and content length: sceHttp2GetStatusCode and sceHttp2GetResponseContentLength both return the same network error (0x80436063) and leave their outputs untouched.

The function is called by PPSA01494, PPSA18194, PPSA21564, PPSA30839 and PPSA31162 (both functions) (call sites found through the import's PLT stub in each title's relinked eboot.bin), and until now no test called it.

Changed: core/libs/tests/GuestHttp2.cpp. Test only, no change to the library.

Tested

Linux (Ubuntu 26.04, GCC 15.2), Release: cmake --build build --target guest_http2_tests and ctest -R '^guest_http2$' --repeat until-fail:3 pass on this branch, which is current main plus the test. tools/check_conventions.py --base upstream/main passes.

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

🤖 Generated with Claude Code

…d content length report

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new assertions exercise both response accessors after sceHttp2SendRequest returns the network error and verify each return code plus unchanged output sentinels. That matches the current implementation, which returns ERROR_NETWORK without writing either output. The request is valid and was created through the normal template path, so the test covers the intended failed-network state.

I built guest_http2_tests with the exact PR test source in a current-main scratch checkout (4 build steps); the focused executable passed under QEMU user-mode emulation. The native runner lacks required CPU extensions. tools/check_conventions.py and git show --check pass. Hosted product jobs are skipped for this test-only change.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 11145 core/libs/tests/GuestHttp2.cpp
PR 11470 core/libs/tests/GuestHttp2.cpp

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 26, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manually reviewed the overlap bot's uncomparable GuestHttp2.cpp entries. #11470 adds a separate TestWebSockets function and changes the ping-interval assertion to use a valid HTTP request; I do not see a conflicting edit to the two output-preservation assertions added here.

#11145 is different: its current patch rewrites most of main() in GuestHttp2.cpp, including the existing sceHttp2SendRequest(request, nullptr, 0) setup immediately before these new assertions. It also introduces the HTTP/2 transport, stacked on #10167. The current test expects 0x80436063 for an HTTPS request to localhost with no server, so the transport branch may change the exercised path or exact result. Please coordinate with #11145's author on merge order, declare it in Depends on, and ensure these assertions are preserved and pass against the agreed resulting base. I am changing my prior approval to changes requested for this merge-order/test-integration requirement; the focused assertions themselves have no identified defect on current main.

@milescoviello

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thank you for checking. #11145 implements sceHttp2GetStatusCode and sceHttp2GetResponseContentLength over its HTTP/2 transport and rewrites this part of GuestHttp2.cpp, so these assertions would only pin the stub that it replaces. Tests for those calls belong with the transport. I'm closing this one rather than make it wait on #11145.

AI-assisted: yes (Claude Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants