From ea68e850ff802d8292540a7cf4643299b682e4c3 Mon Sep 17 00:00:00 2001 From: Dextroid17 <217507631+Dextroid17@users.noreply.github.com> Date: Tue, 6 Oct 2026 18:58:45 -0400 Subject: [PATCH] test(agc): fix the stale 32-bit WriteWait expectation and run the full suite WriteWait has truncated the reference and mask of a 32-bit wait since 9c2a7560 ("relaxed checks for what titles send"), but testMemory still expected a reference above 32 bits to throw, so agc_command_tests failed when run without arguments. ctest only registers the "defaults" mode, so the stale expectation was never noticed. Update the expectation to the truncating behaviour (the packet keeps the low halves) and register the full mode as agc_commands so the packet, marker, flip, register and memory cases are checked again. Closes #1005. --- core/libs/prx/libSceAgc/CMakeLists.txt | 3 ++- core/libs/prx/libSceAgc/tests/Commands.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/libs/prx/libSceAgc/CMakeLists.txt b/core/libs/prx/libSceAgc/CMakeLists.txt index d3bb48f0b..cfcf3e4ac 100644 --- a/core/libs/prx/libSceAgc/CMakeLists.txt +++ b/core/libs/prx/libSceAgc/CMakeLists.txt @@ -72,8 +72,9 @@ configure_windows_unwind(agc_command_tests) if(BUILD_TESTING) set_target_properties(agc_command_tests PROPERTIES EXCLUDE_FROM_ALL OFF) add_test(NAME agc_initialization COMMAND agc_command_tests defaults) + add_test(NAME agc_commands COMMAND agc_command_tests) if(WIN32) - set_tests_properties(agc_initialization PROPERTIES ENVIRONMENT_MODIFICATION + set_tests_properties(agc_initialization agc_commands PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() endif() diff --git a/core/libs/prx/libSceAgc/tests/Commands.cpp b/core/libs/prx/libSceAgc/tests/Commands.cpp index 4e11a5bed..592be7022 100644 --- a/core/libs/prx/libSceAgc/tests/Commands.cpp +++ b/core/libs/prx/libSceAgc/tests/Commands.cpp @@ -331,8 +331,9 @@ void testMemory() { check(packet[8] == 7 && packet[9] == 0x11223344u, "reference patch changed the high word"); const auto before = storage.words; expectFailure([&] { sceAgcWaitRegMemPatchReference(packet, 0x100000000ull); }); - expectFailure([&] { Agc::Command::WriteWait(&storage.buffer, 0, 3, 0, 0, &value, 0x100000000ull, 0, 32, __func__); }); check(storage.words == before, "invalid memory operation modified packet memory"); + auto* truncated = Agc::Command::WriteWait(&storage.buffer, 0, 3, 0, 0, &value, 0x100000000ull, 0xffffffff00000001ull, 32, __func__); + check(truncated[8] == 0u && truncated[9] == 1u, "32-bit wait did not keep the low halves of the reference and mask"); } void testDefaults() {