Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/libs/prx/libSceAudioOut/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ if(BUILD_TESTING)
set_tests_properties(audio_out_buffer_size_any_index PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()
add_test(NAME audio_out_buffer_size_invalid_length COMMAND audio_out_buffer_size_tests invalid_length)
set_tests_properties(audio_out_buffer_size_invalid_length PROPERTIES TIMEOUT 5)
if(WIN32)
set_tests_properties(audio_out_buffer_size_invalid_length PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()

add_test_executable(audio_out_vibration_tests tests/AudioOutVibration.cpp)
target_include_directories(audio_out_vibration_tests PRIVATE ${LIBS_INCLUDE_DIR})
Expand Down
7 changes: 7 additions & 0 deletions core/libs/prx/libSceAudioOut/tests/AudioOutBufferSize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ void RunAnyIndex() {
}
}

void RunInvalidLength() {
constexpr int expectedError = -2144993274;
Require(sceAudioOutOpen(0, 0, 0, 0, 48000, 1) == expectedError, "length 0 did not return SCE_AUDIO_OUT_ERROR_INVALID_SIZE");
Require(opened == 0, "a zero length opened an audio device");
}

void RunInvalidSampleRate() {
constexpr int expectedError = -2144993272;
Require(sceAudioOutOpen(0, 0, 0, 512, 0, 0) == expectedError, "sample rate 0 did not return SCE_AUDIO_OUT_ERROR_INVALID_PARAM");
Expand Down Expand Up @@ -140,6 +146,7 @@ int main(int argc, char** argv) {
else if (mode == "virtual_overflow") RunVirtualOverflow();
else if (mode == "invalid_format") RunInvalidFormat();
else if (mode == "invalid_sample_rate") RunInvalidSampleRate();
else if (mode == "invalid_length") RunInvalidLength();
else if (mode == "any_index") RunAnyIndex();
else Require(false, "invalid buffer size mode");
std::puts("audio out buffer size tests passed");
Expand Down
Loading