#3305 Refactor MockKeyState into a separate class

This commit is contained in:
Jerry (Xinyu Hou) 2016-06-08 17:08:14 +01:00 committed by Andrew Nelless
parent 82d2a9564e
commit b62de406e2
2 changed files with 20 additions and 21 deletions

View File

@ -54,21 +54,4 @@ typedef ::testing::NiceMock<MockKeyState> KeyStateImpl;
typedef UInt32 KeyID;
typedef void (*ForeachKeyCallback)(
KeyID, SInt32 group, synergy::KeyMap::KeyItem&, void* userData);
void
stubPollPressedKeys(IKeyState::KeyButtonSet& pressedKeys);
void
assertMaskIsOne(ForeachKeyCallback cb, void* userData);
const synergy::KeyMap::KeyItem*
stubMapKey(
synergy::KeyMap::Keystrokes& keys, KeyID id, SInt32 group,
synergy::KeyMap::ModifierToKeys& activeModifiers,
KeyModifierMask& currentState,
KeyModifierMask desiredMask,
bool isAutoRepeat);
synergy::KeyMap::Keystroke s_stubKeystroke(1, false, false);
synergy::KeyMap::KeyItem s_stubKeyItem;
KeyID, SInt32 group, CKeyMap::KeyItem&, void* userData);

View File

@ -16,8 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "test/unittests/synergy/KeyStateTests.h"
#include "test/mock/synergy/MockKeyState.h"
#include "test/mock/synergy/MockEventQueue.h"
#include "test/mock/synergy/MockKeyMap.h"
@ -31,7 +30,24 @@ using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::SaveArg;
TEST(KeyStateTests, onKey_aKeyDown_keyStateOne)
void
stubPollPressedKeys(IKeyState::KeyButtonSet& pressedKeys);
void
assertMaskIsOne(ForeachKeyCallback cb, void* userData);
const CKeyMap::KeyItem*
stubMapKey(
CKeyMap::Keystrokes& keys, KeyID id, SInt32 group,
CKeyMap::ModifierToKeys& activeModifiers,
KeyModifierMask& currentState,
KeyModifierMask desiredMask,
bool isAutoRepeat);
CKeyMap::Keystroke s_stubKeystroke(1, false, false);
CKeyMap::KeyItem s_stubKeyItem;
TEST(CKeyStateTests, onKey_aKeyDown_keyStateOne)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;