diff options
author | StrawbDev <StrawbSoftDevelopment@gmail.com> | 2022-05-03 14:16:32 -0700 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2022-08-04 13:24:33 +0200 |
commit | 3c252d5c6db011c7c22e2572c2c0080042eaa6e9 (patch) | |
tree | 65cbec196e5ceac41bc5efccfd4b3c8b16317980 /tests/test_main.cpp | |
parent | 255e0770c48b621d3495e1ff3bbf79d6e8ec4b82 (diff) |
Add test cases for AudioStreamWAV
Diffstat (limited to 'tests/test_main.cpp')
-rw-r--r-- | tests/test_main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_main.cpp b/tests/test_main.cpp index cb086da53b..75ba706114 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -80,6 +80,7 @@ #include "tests/core/variant/test_dictionary.h" #include "tests/core/variant/test_variant.h" #include "tests/scene/test_animation.h" +#include "tests/scene/test_audio_stream_wav.h" #include "tests/scene/test_code_edit.h" #include "tests/scene/test_curve.h" #include "tests/scene/test_gradient.h" @@ -217,6 +218,15 @@ struct GodotTestCaseListener : public doctest::IReporter { SceneTree::get_singleton()->initialize(); return; } + + if (name.find("Audio") != -1) { + // The last driver index should always be the dummy driver. + int dummy_idx = AudioDriverManager::get_driver_count() - 1; + AudioDriverManager::initialize(dummy_idx); + AudioServer *audio_server = memnew(AudioServer); + audio_server->init(); + return; + } } void test_case_end(const doctest::CurrentTestCaseStats &) override { @@ -279,6 +289,11 @@ struct GodotTestCaseListener : public doctest::IReporter { MessageQueue::get_singleton()->flush(); memdelete(MessageQueue::get_singleton()); } + + if (AudioServer::get_singleton()) { + AudioServer::get_singleton()->finish(); + memdelete(AudioServer::get_singleton()); + } } void test_run_start() override { |