mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
test(libSceNetCtl): cover GetStateV6, GetResult and GetNatInfo in guest_net_ctl
sceNetCtlGetStateV6, sceNetCtlGetResult and sceNetCtlGetNatInfo are exported and called by titles but no test calls them. The checks pin what the code does today: a null output is refused with the invalid-address error, GetStateV6 reports disconnected or IP obtained, GetResult writes 0, and GetNatInfo reports not connected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5d9dcc42d2
commit
72471f5c68
1 file changed
+12
@@ -21,6 +21,9 @@
|
||||
extern "C" {
|
||||
int APS5_VABI sceNetCtlGetInfo(int, NetCtlInfo*);
|
||||
int APS5_VABI sceNetCtlGetState(int*);
|
||||
int APS5_VABI sceNetCtlGetStateV6(int*);
|
||||
int APS5_VABI sceNetCtlGetResult(int, int*);
|
||||
int APS5_VABI sceNetCtlGetNatInfo(NetCtlNatInfo*);
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -89,6 +92,15 @@ int main() {
|
||||
WSADATA data{};
|
||||
Require(WSAStartup(MAKEWORD(2, 2), &data) == 0);
|
||||
#endif
|
||||
Require(sceNetCtlGetStateV6(nullptr) == kErrInvalidAddr);
|
||||
int stateV6 = -1;
|
||||
Require(sceNetCtlGetStateV6(&stateV6) == 0);
|
||||
Require(stateV6 == 0 || stateV6 == kStateIpObtained);
|
||||
Require(sceNetCtlGetResult(0, nullptr) == kErrInvalidAddr);
|
||||
int errorCode = -1;
|
||||
Require(sceNetCtlGetResult(0, &errorCode) == 0 && errorCode == 0);
|
||||
NetCtlNatInfo natInfo{};
|
||||
Require(sceNetCtlGetNatInfo(&natInfo) == kErrNotConnected);
|
||||
NetCtlInfo info{};
|
||||
Require(sceNetCtlGetInfo(0, &info) == kErrInvalidCode);
|
||||
Require(sceNetCtlGetInfo(22, &info) == kErrInvalidCode);
|
||||
|
||||
Reference in new issue
Block a user