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.
This commit is contained in:
Dextroid17 2026-10-06 18:58:45 -04:00
parent ab9437e34d
commit ea68e850ff
2 changed files with 4 additions and 2 deletions

View File

@ -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:$<TARGET_FILE_DIR:libc>")
endif()
endif()

View File

@ -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() {