Skip to content

Commit 863418d

Browse files
Load dummy sound files in UI test fixture
Also set SETTINGS.sound.effectsEnabled to false to prevent sounds from trying to play.
1 parent e165a1c commit 863418d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/s25Main/UI/uiHelper/uiHelper/uiHelpers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "uiHelpers.hpp"
66
#include "Loader.h"
7+
#include "Settings.h"
78
#include "WindowManager.h"
89
#include "desktops/Desktop.h"
910
#include "drivers/VideoDriverWrapper.h"
@@ -31,12 +32,15 @@ void initGUITests()
3132
VIDEODRIVER.CreateScreen(VideoMode(800, 600), false);
3233
BOOST_TEST_CHECKPOINT("Load dummy files");
3334
LOADER.LoadDummyGUIFiles();
35+
LOADER.LoadDummySoundFiles();
3436
BOOST_TEST_CHECKPOINT("Switch to Desktop");
3537
WINDOWMANAGER.Switch(std::make_unique<DummyDesktop>());
3638
BOOST_TEST_CHECKPOINT("Dummy Draw");
3739
WINDOWMANAGER.Draw();
3840
logAcc.clearLog();
3941
}
42+
// Don't try to play sounds
43+
SETTINGS.sound.effectsEnabled = false;
4044
BOOST_TEST_CHECKPOINT("GUI test initialized");
4145
}
4246

0 commit comments

Comments
 (0)