mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 05:33:11 +00:00
[Tests] Make [Audio]
tag consistent with other test environment tags
This commit is contained in:
parent
906a4e9db9
commit
36a0ec166e
@ -181,27 +181,27 @@ void run_test(String file_name, AudioStreamWAV::Format data_format, bool stereo,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Mono PCM8 format") {
|
TEST_CASE("[Audio][AudioStreamWAV] Mono PCM8 format") {
|
||||||
run_test("test_pcm8_mono.wav", AudioStreamWAV::FORMAT_8_BITS, false, WAV_RATE, WAV_COUNT);
|
run_test("test_pcm8_mono.wav", AudioStreamWAV::FORMAT_8_BITS, false, WAV_RATE, WAV_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Mono PCM16 format") {
|
TEST_CASE("[Audio][AudioStreamWAV] Mono PCM16 format") {
|
||||||
run_test("test_pcm16_mono.wav", AudioStreamWAV::FORMAT_16_BITS, false, WAV_RATE, WAV_COUNT);
|
run_test("test_pcm16_mono.wav", AudioStreamWAV::FORMAT_16_BITS, false, WAV_RATE, WAV_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Stereo PCM8 format") {
|
TEST_CASE("[Audio][AudioStreamWAV] Stereo PCM8 format") {
|
||||||
run_test("test_pcm8_stereo.wav", AudioStreamWAV::FORMAT_8_BITS, true, WAV_RATE, WAV_COUNT);
|
run_test("test_pcm8_stereo.wav", AudioStreamWAV::FORMAT_8_BITS, true, WAV_RATE, WAV_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Stereo PCM16 format") {
|
TEST_CASE("[Audio][AudioStreamWAV] Stereo PCM16 format") {
|
||||||
run_test("test_pcm16_stereo.wav", AudioStreamWAV::FORMAT_16_BITS, true, WAV_RATE, WAV_COUNT);
|
run_test("test_pcm16_stereo.wav", AudioStreamWAV::FORMAT_16_BITS, true, WAV_RATE, WAV_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Alternate mix rate") {
|
TEST_CASE("[Audio][AudioStreamWAV] Alternate mix rate") {
|
||||||
run_test("test_pcm16_stereo_38000Hz.wav", AudioStreamWAV::FORMAT_16_BITS, true, 38000, 38000);
|
run_test("test_pcm16_stereo_38000Hz.wav", AudioStreamWAV::FORMAT_16_BITS, true, 38000, 38000);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] save_to_wav() adds '.wav' file extension automatically") {
|
TEST_CASE("[Audio][AudioStreamWAV] save_to_wav() adds '.wav' file extension automatically") {
|
||||||
String save_path = TestUtils::get_temp_path("test_wav_extension");
|
String save_path = TestUtils::get_temp_path("test_wav_extension");
|
||||||
Vector<uint8_t> test_data = gen_pcm8_test(WAV_RATE, WAV_COUNT, false);
|
Vector<uint8_t> test_data = gen_pcm8_test(WAV_RATE, WAV_COUNT, false);
|
||||||
Ref<AudioStreamWAV> stream = memnew(AudioStreamWAV);
|
Ref<AudioStreamWAV> stream = memnew(AudioStreamWAV);
|
||||||
@ -213,7 +213,7 @@ TEST_CASE("[AudioStreamWAV] save_to_wav() adds '.wav' file extension automatical
|
|||||||
CHECK(error == OK);
|
CHECK(error == OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Default values") {
|
TEST_CASE("[Audio][AudioStreamWAV] Default values") {
|
||||||
Ref<AudioStreamWAV> stream = memnew(AudioStreamWAV);
|
Ref<AudioStreamWAV> stream = memnew(AudioStreamWAV);
|
||||||
CHECK(stream->get_format() == AudioStreamWAV::FORMAT_8_BITS);
|
CHECK(stream->get_format() == AudioStreamWAV::FORMAT_8_BITS);
|
||||||
CHECK(stream->get_loop_mode() == AudioStreamWAV::LOOP_DISABLED);
|
CHECK(stream->get_loop_mode() == AudioStreamWAV::LOOP_DISABLED);
|
||||||
@ -227,11 +227,11 @@ TEST_CASE("[AudioStreamWAV] Default values") {
|
|||||||
CHECK(stream->get_stream_name() == "");
|
CHECK(stream->get_stream_name() == "");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Save empty file") {
|
TEST_CASE("[Audio][AudioStreamWAV] Save empty file") {
|
||||||
run_test("test_empty.wav", AudioStreamWAV::FORMAT_8_BITS, false, WAV_RATE, 0);
|
run_test("test_empty.wav", AudioStreamWAV::FORMAT_8_BITS, false, WAV_RATE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("[AudioStreamWAV] Saving IMA ADPCM is not supported") {
|
TEST_CASE("[Audio][AudioStreamWAV] Saving IMA ADPCM is not supported") {
|
||||||
String save_path = TestUtils::get_temp_path("test_adpcm.wav");
|
String save_path = TestUtils::get_temp_path("test_adpcm.wav");
|
||||||
Ref<AudioStreamWAV> stream = memnew(AudioStreamWAV);
|
Ref<AudioStreamWAV> stream = memnew(AudioStreamWAV);
|
||||||
stream->set_format(AudioStreamWAV::FORMAT_IMA_ADPCM);
|
stream->set_format(AudioStreamWAV::FORMAT_IMA_ADPCM);
|
||||||
|
@ -320,7 +320,7 @@ struct GodotTestCaseListener : public doctest::IReporter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.contains("Audio")) {
|
if (name.contains("[Audio]")) {
|
||||||
// The last driver index should always be the dummy driver.
|
// The last driver index should always be the dummy driver.
|
||||||
int dummy_idx = AudioDriverManager::get_driver_count() - 1;
|
int dummy_idx = AudioDriverManager::get_driver_count() - 1;
|
||||||
AudioDriverManager::initialize(dummy_idx);
|
AudioDriverManager::initialize(dummy_idx);
|
||||||
|
Loading…
Reference in New Issue
Block a user