forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynccontroltest.cpp
28 lines (22 loc) · 1018 Bytes
/
synccontroltest.cpp
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
// Tests for Master Sync.
// There are no tests for actual deck playback, since I don't know how to mock that out yet.
// The following manual tests should probably be performed:
// * Quantize mode nudges tracks in sync, whether internal or deck master.
// * Flinging tracks with the waveform should work.
// * vinyl??
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <QtDebug>
#include "test/mixxxtest.h"
#include "test/mockedenginebackendtest.h"
#include "engine/sync/synccontrol.h"
class SyncControlTest : public MockedEngineBackendTest {
};
TEST_F(SyncControlTest, TestDetermineBpmMultiplier) {
EXPECT_EQ(SyncControl::kBpmUnity,
m_pChannel1->getEngineBuffer()->m_pSyncControl->determineBpmMultiplier(70, 80));
EXPECT_EQ(SyncControl::kBpmHalve,
m_pChannel1->getEngineBuffer()->m_pSyncControl->determineBpmMultiplier(70, 160));
EXPECT_EQ(SyncControl::kBpmDouble,
m_pChannel1->getEngineBuffer()->m_pSyncControl->determineBpmMultiplier(70, 40));
}