File tree Expand file tree Collapse file tree 2 files changed +24
-12
lines changed
Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change 1- if (LIBSCRATCHCPP_AUDIO_SUPPORT)
2- # audiooutput_test
3- add_executable (
4- audiooutput_test
5- audiooutput_test.cpp
6- )
1+ # audiooutput_test
2+ add_executable (
3+ audiooutput_test
4+ audiooutput_test.cpp
5+ )
6+
7+ target_link_libraries (
8+ audiooutput_test
9+ GTest::gtest_main
10+ scratchcpp
11+ )
712
8- target_link_libraries (
9- audiooutput_test
10- GTest::gtest_main
11- scratchcpp
12- )
13+ gtest_discover_tests(audiooutput_test)
1314
14- gtest_discover_tests(audiooutput_test)
15+ if (LIBSCRATCHCPP_AUDIO_SUPPORT)
16+ target_compile_definitions (audiooutput_test PRIVATE LIBSCRATCHCPP_AUDIO_SUPPORT)
1517endif ()
Original file line number Diff line number Diff line change 11#include < audio/audiooutput.h>
2+
3+ #ifdef LIBSCRATCHCPP_AUDIO_SUPPORT
24#include < audio/internal/audioplayer.h>
5+ #else
6+ #include < audio/internal/audioplayerstub.h>
7+ #endif
38
49#include " ../common.h"
510
@@ -10,5 +15,10 @@ TEST(AudioOutputTest, Create)
1015 auto factory = AudioOutput::instance ();
1116 std::shared_ptr<IAudioPlayer> player = factory->createAudioPlayer ();
1217 ASSERT_TRUE (player);
18+
19+ #ifdef LIBSCRATCHCPP_AUDIO_SUPPORT
1320 ASSERT_TRUE (std::dynamic_pointer_cast<AudioPlayer>(player));
21+ #else
22+ ASSERT_TRUE (std::dynamic_pointer_cast<AudioPlayerStub>(player));
23+ #endif
1424}
You can’t perform that action at this time.
0 commit comments