summaryrefslogtreecommitdiffstats
path: root/src/test/effectsmanagertest.cpp
blob: f93c4e45dcea7a371eb559bcc0e171854ba8bae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <gtest/gtest.h>
#include <gmock/gmock.h>

#include <QtDebug>
#include <QScopedPointer>

#include "test/mixxxtest.h"
#include "effects/effectchain.h"
#include "effects/effectchainslot.h"
#include "effects/effectsmanager.h"
#include "effects/effectmanifest.h"

#include "test/baseeffecttest.h"

using ::testing::Return;
using ::testing::_;

class EffectsManagerTest : public BaseEffectTest {
  protected:
    void SetUp() override {
        registerTestBackend();
    }
};

TEST_F(EffectsManagerTest, CanInstantiateEffectsFromBackend) {
    EffectManifestPointer pManifest(new EffectManifest());
    pManifest->setId("org.mixxx.test.effect");
    pManifest->setName("Test Effect");
    registerTestEffect(pManifest, false);

    // Check we can get the same manifest that we registered back.
    EffectManifestPointer effect_to_load = m_pEffectsManager->getEffectManifest(pManifest->id());
    EXPECT_QSTRING_EQ(effect_to_load->name(), pManifest->name());

    // Check we can instantiate the effect.
    EffectPointer pEffect = m_pEffectsManager->instantiateEffect(pManifest->id());
    EXPECT_FALSE(pEffect.isNull());
}