sceRudpGetContextStatus refuses a negative id, a null status and a size
outside 1 to 0x30 with 0x80770004 before it looks the id up, and writes
the idle block with 0xFFFFFFFF at bytes 4-7, as firmware 10.71 and 13.42
readings show. sceRudpCreateContext checks initialization before its null
id pointer.
sceRudpBind takes the socket id, virtual port and mux mode and checks
them; mux mode 2 with vport 0 takes 0x2711 and on from a per-socket
counter. sceRudpSetEventHandler checks initialization and a null
handler, and sceRudpEnd clears the handler. sceRudpListen and
sceRudpAccept follow the run: no peer ever connects here, so accept
returns WOULDBLOCK while non-blocking and otherwise waits until the
context is terminated. Cases the run did not cover throw.
Adds tests for nine implemented libSceRudp functions that previously
lacked coverage:
- sceRudpActivate (returns 0 always)
- sceRudpEnableInternalIOThread (NOT_INITIALIZED before init, 0 after)
- sceRudpSetEventHandler (returns 0)
- sceRudpBind (NOT_INITIALIZED, INVALID_CONTEXT_ID, 0 on success)
- sceRudpSetOption (NOT_INITIALIZED, INVALID_CONTEXT_ID, 0 on success)
- sceRudpInitiate (NOT_INITIALIZED, INVALID_CONTEXT_ID, CONN_REFUSED)
- sceRudpGetContextStatus (NOT_INITIALIZED, INVALID_CONTEXT_ID, fills
status with 0, null status allowed)
- sceRudpWrite (NOT_INITIALIZED, INVALID_CONTEXT_ID, CONN_RESET)
- sceRudpRead (NOT_INITIALIZED, INVALID_CONTEXT_ID, CONN_RESET)
Each assertion mirrors the exact implementation in Export.cpp. Error
codes and return values are the constants hardcoded in the source.
No console measurement needed — these are pure offline behaviors.
AI-assisted: yes