File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11#pragma once
22
3+ #include < gtest/gtest_prod.h>
4+
35#include < QDebug>
46#include < QObject>
57#include < QtCore>
@@ -91,6 +93,8 @@ class MacroManager : public RecordingManagerBase {
9193 void notifyCueJump (ChannelHandle channel, double origin, double target);
9294
9395 private:
96+ FRIEND_TEST (MacroManagerTest, claimRecording);
97+
9498 // / Checks if ths channel is recording, otherwise tries to claim it.
9599 // / Returns true if this channel is recording.
96100 // / Called from RT.
Original file line number Diff line number Diff line change 33#include < gmock/gmock.h>
44#include < gtest/gtest.h>
55
6+ #include < QDebug>
7+
68#include " mixxxtest.h"
79
8- class MacroManagerTest : public MixxxTest {
10+ class MacroManagerTest : protected MixxxTest {
911};
1012
1113TEST (MacrosTest, CreateMacro) {
1214 auto macro = new Macro ();
1315 ASSERT_EQ (macro->m_length , 0 );
16+ }
17+
18+ TEST (MacroManagerTest, claimRecording) {
19+ auto handle = ChannelHandleFactory ().getOrCreateHandle (" " );
20+ auto mgr = MacroManager ();
21+ qDebug () << " Handle" << handle.handle ();
22+ ASSERT_EQ (mgr.m_macroRecordingState .load (), MacroState::Disabled);
23+ mgr.notifyCueJump (handle, 0 , 1 );
24+ ASSERT_EQ (mgr.m_macroRecordingState .load (), MacroState::Disabled);
25+ ASSERT_EQ (mgr.m_activeChannel , nullptr );
26+ mgr.m_macroRecordingState .store (MacroState::Armed);
27+ mgr.notifyCueJump (handle, 0 , 1 );
28+ ASSERT_EQ (mgr.m_activeChannel ->handle (), handle.handle ());
1429}
You can’t perform that action at this time.
0 commit comments