Skip to content

Made JS code containing the new engine.getPlayer API in controller_ma…#3

Merged
christophehenry merged 1 commit into
christophehenry:JavascriptPlayerProxyfrom
JoergAtGithub:FixTestCrashsWithEngineGetPlayer
Jun 19, 2025
Merged

Made JS code containing the new engine.getPlayer API in controller_ma…#3
christophehenry merged 1 commit into
christophehenry:JavascriptPlayerProxyfrom
JoergAtGithub:FixTestCrashsWithEngineGetPlayer

Conversation

@JoergAtGithub
Copy link
Copy Markdown

Made JS code containing the new engine.getPlayer API in controller_mapping_validation_test and controllerscriptenginelegacy_test executable without crash
This does not yet implement a test itself, but allows to load tracks into decks as in playermanagertest and makes controller_mapping_validation_test working if QML is not enabled.

…pping_validation_test and controllerscriptenginelegacy_test executable without crash
Comment on lines 133 to +145
void TearDown() override {
mixxx::Time::setTestMode(false);
#ifdef MIXXX_USE_QML
m_rootItems.clear();
#endif
CoverArtCache::destroy();
ControllerScriptEngineBase::registerPlayerManager(nullptr);
ControllerScriptEngineBase::registerTrackCollectionManager(nullptr);
}

~ControllerScriptEngineLegacyTest() {
// Reset in the correct order to avoid singleton destruction issues
m_pSoundManager.reset();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if you can have both TearDown and a dtor in a test. I guess if so teardown gets called first?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as in other tests. TearDown() is called by GTest after each test case and if an error happens in TearDown(), GTest will flag the test as fail. I tested this code, it is working!

@christophehenry christophehenry merged commit 7b116a4 into christophehenry:JavascriptPlayerProxy Jun 19, 2025
@JoergAtGithub JoergAtGithub deleted the FixTestCrashsWithEngineGetPlayer branch June 19, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants