Skip to content

Commit 27a68ff

Browse files
committed
Fixes for automated tests
1 parent a41d7d6 commit 27a68ff

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@ set(JUCE_COMPILE_DEFINITIONS
309309
JUCE_JACK_CLIENT_NAME="plugdata"
310310
)
311311

312+
# Testing will run every help patch, which leads to some asserts due to standard Pd or ELSE patches outputting non-UTF8 text, invalid MIDI sequences, etc.
313+
# So for a better testing experience, we just disable assertions
314+
if(${ENABLE_TESTING})
315+
list(APPEND JUCE_COMPILE_DEFINITIONS JUCE_DISABLE_ASSERTIONS=1)
316+
endif()
317+
312318
if(LINUX)
313319
list(APPEND JUCE_COMPILE_DEFINITIONS JUCE_ALSA=1)
314320
if(ENABLE_WAYLAND)

Tests/ObjectFuzzTest.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ObjectFuzzTest : public PlugDataUnitTest
88
private:
99
void perform() override
1010
{
11-
editor->pd->objectLibrary->waitForInitialisationToFinish();
11+
//editor->pd->objectLibrary->waitForInitialisationToFinish();
1212

1313
auto* cnv = editor->getTabComponent().newPatch();
1414
auto allObjects = editor->pd->objectLibrary->getAllObjects();
@@ -42,8 +42,8 @@ class ObjectFuzzTest : public PlugDataUnitTest
4242
editor->pd->unlockAudioThread();
4343

4444
auto info = pd->objectLibrary->getObjectInfo(objectName);
45-
auto methods = info.getChildWithName("methods");
46-
auto arguments = info.getChildWithName("arguments");
45+
auto methods = info.methods;
46+
auto arguments = info.arguments;
4747

4848
if(fuzzIncorrectly)
4949
{
@@ -55,7 +55,7 @@ class ObjectFuzzTest : public PlugDataUnitTest
5555
else {
5656
for(auto arg : arguments)
5757
{
58-
auto type = arg.getProperty("type").toString();
58+
auto type = arg.type;
5959
if(type == "float")
6060
{
6161
objectName += " " + String(generateRandomFloat());
@@ -78,8 +78,8 @@ class ObjectFuzzTest : public PlugDataUnitTest
7878
lastY += 20;
7979
for (auto method : methods)
8080
{
81-
auto methodName = method.getProperty("type").toString().toStdString();
82-
auto description = method.getProperty("description").toString();
81+
auto methodName = method.type.toStdString();
82+
auto description = method.description;
8383
auto nameWithoutArgs = String(methodName).upToFirstOccurrenceOf("<", false, false).trim();
8484

8585
SmallArray<pd::Atom> args;

0 commit comments

Comments
 (0)