Skip to content

Commit

Permalink
test: Add CoreServices "smoke test" to check if initialization works
Browse files Browse the repository at this point in the history
Before, CoreServices would cause a debug assertion when initializing it
without other stuff from `MixxxMainWindow`. This is just a smoke test to
verify that it's possible to initialize the `CoreServices` class on its
own, without `MixxxMainWindow.
  • Loading branch information
Holzhaus committed Jul 17, 2021
1 parent 498e9a0 commit 1470d14
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,7 @@ add_executable(mixxx-test
src/test/controller_mapping_validation_test.cpp
src/test/controllerscriptenginelegacy_test.cpp
src/test/controlobjecttest.cpp
src/test/coreservicestest.cpp
src/test/coverartcache_test.cpp
src/test/coverartutils_test.cpp
src/test/cratestorage_test.cpp
Expand Down
32 changes: 32 additions & 0 deletions src/test/coreservicestest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <gtest/gtest.h>

#include "coreservices.h"
#include "test/mixxxtest.h"
#include "util/cmdlineargs.h"

class CoreServicesTest : public MixxxTest {
};

TEST_F(CoreServicesTest, TestInitialization) {
// Initialize the app
const int argc = 0;
CmdlineArgs cmdlineArgs;
cmdlineArgs.parse(argc, nullptr);

const auto pCoreServices = std::make_unique<mixxx::CoreServices>(cmdlineArgs);
pCoreServices->initializeSettings();
pCoreServices->initializeKeyboard();
pCoreServices->initialize(application());

EXPECT_NE(pCoreServices->getControllerManager(), nullptr);
EXPECT_NE(pCoreServices->getEffectsManager(), nullptr);
EXPECT_NE(pCoreServices->getGuiTick(), nullptr);
EXPECT_NE(pCoreServices->getLV2Backend(), nullptr);
EXPECT_NE(pCoreServices->getLibrary(), nullptr);
EXPECT_NE(pCoreServices->getPlayerManager(), nullptr);
EXPECT_NE(pCoreServices->getScreensaverManager(), nullptr);
EXPECT_NE(pCoreServices->getSettingsManager(), nullptr);
EXPECT_NE(pCoreServices->getSoundManager(), nullptr);
EXPECT_NE(pCoreServices->getVinylControlManager(), nullptr);
EXPECT_NE(pCoreServices->getVisualsManager(), nullptr);
}

0 comments on commit 1470d14

Please sign in to comment.