Skip to content

Commit

Permalink
Traktor S3: Add tests for controller script
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwg committed May 30, 2021
1 parent 4edb4a1 commit f491716
Show file tree
Hide file tree
Showing 7 changed files with 755 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,7 @@ add_executable(mixxx-test
src/test/metadatatest.cpp
src/test/metaknob_link_test.cpp
src/test/midicontrollertest.cpp
src/test/controllers/Traktor_Kontrol_S3_test.cpp
src/test/mixxxtest.cpp
src/test/movinginterquartilemean_test.cpp
src/test/nativeeffects_test.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ bool ControllerScriptEngineLegacy::evaluateScriptFile(const QFileInfo& scriptFil
return true;
}

QJSValue ControllerScriptEngineLegacy::evaluateCodeString(
const QString& program, const QString& fileName, int lineNumber) {
VERIFY_OR_DEBUG_ASSERT(m_pJSEngine) {
return QJSValue::UndefinedValue;
}
return m_pJSEngine->evaluate(program, fileName, lineNumber);
}

QJSValue ControllerScriptEngineLegacy::wrapArrayBufferCallback(const QJSValue& callback) {
return m_makeArrayBufferWrapperFunction.call(QJSValueList{callback});
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ class ControllerScriptEngineLegacy : public ControllerScriptEngineBase {
m_scriptFiles = scripts;
}

private:
protected:
friend class ControllerTest;
bool evaluateScriptFile(const QFileInfo& scriptFile);
QJSValue evaluateCodeString(const QString& program,
const QString& fileName = QString(),
int lineNumber = 1);

private:
void shutdown() override;

QJSValue wrapArrayBufferCallback(const QJSValue& callback);
Expand Down
Loading

0 comments on commit f491716

Please sign in to comment.