Initial release
This commit is contained in:
+148
@@ -0,0 +1,148 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/bypassstate.cpp
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/state/bypasspersistence.h"
|
||||
#include "public.sdk/source/common/memorystream.h"
|
||||
#include "public.sdk/source/vst/vstpresetfile.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// VstBypassSaveParamTest
|
||||
//------------------------------------------------------------------------
|
||||
BypassPersistenceTest::BypassPersistenceTest (ITestPlugProvider* plugProvider,
|
||||
ProcessSampleSize sampl)
|
||||
: AutomationTest (plugProvider, sampl, 100, 1, false)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool PLUGIN_API BypassPersistenceTest::run (ITestResult* testResult)
|
||||
{
|
||||
if (!vstPlug || !testResult || !audioEffect)
|
||||
return false;
|
||||
if (!canProcessSampleSize (testResult))
|
||||
return true;
|
||||
|
||||
printTestHeader (testResult);
|
||||
|
||||
if (bypassId == kNoParamId)
|
||||
{
|
||||
testResult->addMessage (STR ("This plugin does not have a bypass parameter!!!"));
|
||||
return true;
|
||||
}
|
||||
unprepareProcessing ();
|
||||
|
||||
processData.numSamples = 0;
|
||||
processData.numInputs = 0;
|
||||
processData.numOutputs = 0;
|
||||
processData.inputs = nullptr;
|
||||
processData.outputs = nullptr;
|
||||
|
||||
audioEffect->setProcessing (true);
|
||||
|
||||
preProcess (testResult);
|
||||
|
||||
// set bypass on
|
||||
// if (paramChanges[0].getParameterId () == bypassId)
|
||||
{
|
||||
paramChanges[0]->init (bypassId, 1);
|
||||
paramChanges[0]->setPoint (0, 0, 1);
|
||||
|
||||
controller->setParamNormalized (bypassId, 1);
|
||||
|
||||
if (controller->getParamNormalized (bypassId) < 1)
|
||||
{
|
||||
testResult->addErrorMessage (STR ("The bypass parameter was not correctly set!"));
|
||||
}
|
||||
}
|
||||
|
||||
// flush
|
||||
tresult result = audioEffect->process (processData);
|
||||
if (result != kResultOk)
|
||||
{
|
||||
testResult->addErrorMessage (
|
||||
STR ("The component failed to process without audio buffers!"));
|
||||
|
||||
audioEffect->setProcessing (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
postProcess (testResult);
|
||||
|
||||
audioEffect->setProcessing (false);
|
||||
|
||||
// save State
|
||||
FUID uid;
|
||||
plugProvider->getComponentUID (uid);
|
||||
|
||||
MemoryStream stream;
|
||||
PresetFile::savePreset (&stream, uid, vstPlug, controller, nullptr, 0);
|
||||
|
||||
audioEffect->setProcessing (true);
|
||||
|
||||
preProcess (testResult);
|
||||
|
||||
// set bypass off
|
||||
if (paramChanges[0]->getParameterId () == bypassId)
|
||||
{
|
||||
paramChanges[0]->init (bypassId, 1);
|
||||
paramChanges[0]->setPoint (0, 0, 0);
|
||||
|
||||
controller->setParamNormalized (bypassId, 0);
|
||||
|
||||
if (controller->getParamNormalized (bypassId) > 0)
|
||||
{
|
||||
testResult->addErrorMessage (
|
||||
STR ("The bypass parameter was not correctly set in the controller!"));
|
||||
}
|
||||
}
|
||||
|
||||
// flush
|
||||
result = audioEffect->process (processData);
|
||||
if (result != kResultOk)
|
||||
{
|
||||
testResult->addErrorMessage (
|
||||
STR ("The component failed to process without audio buffers!"));
|
||||
|
||||
audioEffect->setProcessing (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
postProcess (testResult);
|
||||
|
||||
audioEffect->setProcessing (false);
|
||||
|
||||
// load previous preset
|
||||
stream.seek (0, IBStream::kIBSeekSet, nullptr);
|
||||
PresetFile::loadPreset (&stream, uid, vstPlug, controller);
|
||||
|
||||
if (controller->getParamNormalized (bypassId) < 1)
|
||||
{
|
||||
testResult->addErrorMessage (
|
||||
STR ("The bypass parameter is not in sync in the controller!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/bypassstate.h
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/processing/automation.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Test Parameter Bypass persistence.
|
||||
* \ingroup TestClass
|
||||
*/
|
||||
class BypassPersistenceTest : public AutomationTest
|
||||
{
|
||||
public:
|
||||
BypassPersistenceTest (ITestPlugProvider* plugProvider, ProcessSampleSize sampl);
|
||||
|
||||
bool PLUGIN_API run (ITestResult* testResult) override;
|
||||
|
||||
DECLARE_VSTTEST ("Parameter Bypass persistence")
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/invalidstatetransition.cpp
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/state/invalidstatetransition.h"
|
||||
#include "pluginterfaces/base/funknownimpl.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// InvalidStateTransitionTest
|
||||
//------------------------------------------------------------------------
|
||||
InvalidStateTransitionTest::InvalidStateTransitionTest (ITestPlugProvider* plugProvider)
|
||||
: TestEnh (plugProvider, kSample32)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool PLUGIN_API InvalidStateTransitionTest::run (ITestResult* testResult)
|
||||
{
|
||||
if (!testResult || !vstPlug)
|
||||
return false;
|
||||
|
||||
printTestHeader (testResult);
|
||||
|
||||
auto plugBase = U::cast<IPluginBase> (vstPlug);
|
||||
if (!plugBase)
|
||||
return false;
|
||||
|
||||
// created
|
||||
tresult result = plugBase->initialize (TestingPluginContext::get ());
|
||||
if (result == kResultFalse)
|
||||
return false;
|
||||
|
||||
// setupProcessing is missing !
|
||||
/*result = audioEffect->setupProcessing (processSetup);
|
||||
if (result != kResultTrue)
|
||||
return false;*/
|
||||
|
||||
// initialized
|
||||
result = vstPlug->setActive (false);
|
||||
if (result == kResultOk)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (true);
|
||||
if (result == kResultFalse)
|
||||
return false;
|
||||
|
||||
// allocated
|
||||
result = plugBase->initialize (TestingPluginContext::get ());
|
||||
if (result == kResultOk)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (false);
|
||||
if (result == kResultFalse)
|
||||
return false;
|
||||
|
||||
// deallocated (initialized)
|
||||
result = plugBase->initialize (TestingPluginContext::get ());
|
||||
if (result == kResultOk)
|
||||
return false;
|
||||
|
||||
result = plugBase->terminate ();
|
||||
if (result == kResultFalse)
|
||||
return false;
|
||||
|
||||
// terminated (created)
|
||||
result = vstPlug->setActive (false);
|
||||
if (result == kResultOk)
|
||||
return false;
|
||||
|
||||
result = plugBase->terminate ();
|
||||
if (result == kResultOk)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/invalidstatetransition.h
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/testbase.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Test Invalid State Transition.
|
||||
* \ingroup TestClass
|
||||
*/
|
||||
class InvalidStateTransitionTest : public TestEnh
|
||||
{
|
||||
public:
|
||||
InvalidStateTransitionTest (ITestPlugProvider* plugProvider);
|
||||
|
||||
bool PLUGIN_API run (ITestResult* testResult) SMTG_OVERRIDE;
|
||||
|
||||
DECLARE_VSTTEST ("Invalid State Transition")
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
Vendored
+87
@@ -0,0 +1,87 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/repeatidenticalstatetransition.cpp
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/state/repeatidenticalstatetransition.h"
|
||||
#include "pluginterfaces/base/funknownimpl.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// RepeatIdenticalStateTransitionTest
|
||||
//------------------------------------------------------------------------
|
||||
RepeatIdenticalStateTransitionTest::RepeatIdenticalStateTransitionTest (
|
||||
ITestPlugProvider* plugProvider)
|
||||
: TestEnh (plugProvider, kSample32)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool RepeatIdenticalStateTransitionTest::run (ITestResult* testResult)
|
||||
{
|
||||
if (!testResult || !vstPlug || !audioEffect)
|
||||
return false;
|
||||
|
||||
printTestHeader (testResult);
|
||||
|
||||
auto plugBase = U::cast<IPluginBase> (vstPlug);
|
||||
if (!plugBase)
|
||||
return false;
|
||||
|
||||
tresult result = plugBase->initialize (TestingPluginContext::get ());
|
||||
if (result != kResultFalse)
|
||||
return false;
|
||||
|
||||
result = audioEffect->setupProcessing (processSetup);
|
||||
if (result != kResultTrue)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (true);
|
||||
if (result != kResultOk)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (true);
|
||||
if (result != kResultFalse)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (false);
|
||||
if (result != kResultOk)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (false);
|
||||
if (result == kResultOk)
|
||||
return false;
|
||||
|
||||
result = plugBase->terminate ();
|
||||
if (result != kResultOk)
|
||||
return false;
|
||||
|
||||
result = plugBase->terminate ();
|
||||
if (result == kResultOk)
|
||||
return false;
|
||||
|
||||
result = plugBase->initialize (TestingPluginContext::get ());
|
||||
if (result != kResultOk)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/repeatidenticalstatetransition.h
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/testbase.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Test Repeat Identical State Transition.
|
||||
* \ingroup TestClass
|
||||
*/
|
||||
class RepeatIdenticalStateTransitionTest : public TestEnh
|
||||
{
|
||||
public:
|
||||
RepeatIdenticalStateTransitionTest (ITestPlugProvider* plugProvider);
|
||||
|
||||
bool PLUGIN_API run (ITestResult* testResult) SMTG_OVERRIDE;
|
||||
|
||||
DECLARE_VSTTEST ("Repeat Identical State Transition")
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/validstatetransition.cpp
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/state/validstatetransition.h"
|
||||
#include "pluginterfaces/base/funknownimpl.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// ValidStateTransitionTest
|
||||
//------------------------------------------------------------------------
|
||||
ValidStateTransitionTest::ValidStateTransitionTest (ITestPlugProvider* plugProvider,
|
||||
ProcessSampleSize sampleSize)
|
||||
: ProcessTest (plugProvider, sampleSize)
|
||||
{
|
||||
if (sampleSize == kSample32)
|
||||
strcpy (name, "Valid State Transition 32bits");
|
||||
else
|
||||
strcpy (name, "Valid State Transition 64bits");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool PLUGIN_API ValidStateTransitionTest::run (ITestResult* testResult)
|
||||
{
|
||||
if (!testResult || !vstPlug || !audioEffect)
|
||||
return false;
|
||||
|
||||
printTestHeader (testResult);
|
||||
if (!canProcessSampleSize (testResult))
|
||||
return true;
|
||||
|
||||
// disable it, it was enabled in setup call
|
||||
tresult result = vstPlug->setActive (false);
|
||||
if (result != kResultTrue)
|
||||
return false;
|
||||
|
||||
auto plugBase = U::cast<IPluginBase> (vstPlug);
|
||||
if (!plugBase)
|
||||
return false;
|
||||
|
||||
for (int32 i = 0; i < 4; ++i)
|
||||
{
|
||||
result = audioEffect->setupProcessing (processSetup);
|
||||
if (result != kResultTrue)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (true);
|
||||
if (result != kResultTrue)
|
||||
return false;
|
||||
|
||||
result = vstPlug->setActive (false);
|
||||
if (result != kResultTrue)
|
||||
return false;
|
||||
|
||||
if (activateMainIOBusses (false) == false)
|
||||
return false;
|
||||
|
||||
result = plugBase->terminate ();
|
||||
if (result != kResultTrue)
|
||||
return false;
|
||||
|
||||
result = plugBase->initialize (TestingPluginContext::get ());
|
||||
if (result != kResultTrue)
|
||||
return false;
|
||||
|
||||
// for the last 2 steps we decide to not reenable the buses, see
|
||||
// https://steinbergmedia.github.io/vst3_dev_portal/pages/Technical+Documentation/Change+History/3.0.0/Multiple+Dynamic+IO.html?highlight=kDefaultActive#information-about-busses
|
||||
if (i < 2)
|
||||
{
|
||||
if (activateMainIOBusses (true) == false)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Validator
|
||||
// Filename : public.sdk/source/vst/testsuite/state/validstatetransition.h
|
||||
// Created by : Steinberg, 04/2005
|
||||
// Description : VST Test Suite
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file is part of a Steinberg SDK. It is subject to the license terms
|
||||
// in the LICENSE file found in the top-level directory of this distribution
|
||||
// and at www.steinberg.net/sdklicenses.
|
||||
// No part of the SDK, including this file, may be copied, modified, propagated,
|
||||
// or distributed except according to the terms contained in the LICENSE file.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "public.sdk/source/vst/testsuite/processing/process.h"
|
||||
#include "public.sdk/source/vst/testsuite/testbase.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Test Valid State Transition.
|
||||
* \ingroup TestClass
|
||||
*/
|
||||
class ValidStateTransitionTest : public ProcessTest
|
||||
{
|
||||
public:
|
||||
ValidStateTransitionTest (ITestPlugProvider* plugProvider, ProcessSampleSize sampleSize);
|
||||
|
||||
bool PLUGIN_API run (ITestResult* testResult) SMTG_OVERRIDE;
|
||||
|
||||
const char* getName () const SMTG_OVERRIDE { return name; }
|
||||
|
||||
protected:
|
||||
char name[256];
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
Reference in New Issue
Block a user