Drop C prefix on Windows

This commit is contained in:
Xinyu Hou
2014-11-12 11:44:29 +00:00
parent e5e0a3b653
commit 9fd11da578
48 changed files with 555 additions and 555 deletions

View File

@@ -22,7 +22,7 @@
#include "test/global/gmock.h"
#include "test/global/gtest.h"
class CMSWindowsClipboardTests : public ::testing::Test
class MSWindowsClipboardTests : public ::testing::Test
{
protected:
virtual void SetUp()
@@ -38,7 +38,7 @@ protected:
private:
void emptyClipboard()
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.empty();
}
@@ -50,9 +50,9 @@ public:
MOCK_METHOD2(write, void(HANDLE, UINT));
};
TEST_F(CMSWindowsClipboardTests, emptyUnowned_openCalled_returnsTrue)
TEST_F(MSWindowsClipboardTests, emptyUnowned_openCalled_returnsTrue)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
bool actual = clipboard.emptyUnowned();
@@ -60,9 +60,9 @@ TEST_F(CMSWindowsClipboardTests, emptyUnowned_openCalled_returnsTrue)
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, empty_openCalled_returnsTrue)
TEST_F(MSWindowsClipboardTests, empty_openCalled_returnsTrue)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
bool actual = clipboard.empty();
@@ -70,21 +70,21 @@ TEST_F(CMSWindowsClipboardTests, empty_openCalled_returnsTrue)
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, empty_singleFormat_hasReturnsFalse)
TEST_F(MSWindowsClipboardTests, empty_singleFormat_hasReturnsFalse)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.add(CMSWindowsClipboard::kText, "synergy rocks!");
clipboard.add(MSWindowsClipboard::kText, "synergy rocks!");
clipboard.empty();
bool actual = clipboard.has(CMSWindowsClipboard::kText);
bool actual = clipboard.has(MSWindowsClipboard::kText);
EXPECT_EQ(false, actual);
}
TEST_F(CMSWindowsClipboardTests, add_newValue_valueWasStored)
TEST_F(MSWindowsClipboardTests, add_newValue_valueWasStored)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.add(IClipboard::kText, "synergy rocks!");
@@ -93,21 +93,21 @@ TEST_F(CMSWindowsClipboardTests, add_newValue_valueWasStored)
EXPECT_EQ("synergy rocks!", actual);
}
TEST_F(CMSWindowsClipboardTests, add_newValue_writeWasCalled)
TEST_F(MSWindowsClipboardTests, add_newValue_writeWasCalled)
{
MockFacade facade;
EXPECT_CALL(facade, write(testing::_, testing::_));
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.setFacade(facade);
clipboard.open(0);
clipboard.add(IClipboard::kText, "synergy rocks!");
}
TEST_F(CMSWindowsClipboardTests, add_replaceValue_valueWasReplaced)
TEST_F(MSWindowsClipboardTests, add_replaceValue_valueWasReplaced)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.add(IClipboard::kText, "synergy rocks!");
@@ -117,27 +117,27 @@ TEST_F(CMSWindowsClipboardTests, add_replaceValue_valueWasReplaced)
EXPECT_EQ("maxivista sucks", actual);
}
TEST_F(CMSWindowsClipboardTests, open_timeIsZero_returnsTrue)
TEST_F(MSWindowsClipboardTests, open_timeIsZero_returnsTrue)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
bool actual = clipboard.open(0);
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, open_timeIsOne_returnsTrue)
TEST_F(MSWindowsClipboardTests, open_timeIsOne_returnsTrue)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
bool actual = clipboard.open(1);
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, close_isOpen_noErrors)
TEST_F(MSWindowsClipboardTests, close_isOpen_noErrors)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.close();
@@ -147,12 +147,12 @@ TEST_F(CMSWindowsClipboardTests, close_isOpen_noErrors)
// looks like this test may fail intermittently:
// * http://buildbot.synergy-project.org:8000/builders/trunk-win32/builds/246/steps/shell_3/logs/stdio
/*TEST_F(CMSWindowsClipboardTests, getTime_openWithNoEmpty_returnsOne)
/*TEST_F(MSWindowsClipboardTests, getTime_openWithNoEmpty_returnsOne)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(1);
CMSWindowsClipboard::Time actual = clipboard.getTime();
MSWindowsClipboard::Time actual = clipboard.getTime();
// this behavior is different to that of Clipboard which only
// returns the value passed into open(t) after empty() is called.
@@ -161,20 +161,20 @@ TEST_F(CMSWindowsClipboardTests, close_isOpen_noErrors)
// this also fails intermittently:
// http://buildbot.synergy-project.org:8000/builders/trunk-win32/builds/266/steps/shell_3/logs/stdio
/*TEST_F(CMSWindowsClipboardTests, getTime_openAndEmpty_returnsOne)
/*TEST_F(MSWindowsClipboardTests, getTime_openAndEmpty_returnsOne)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(1);
clipboard.empty();
CMSWindowsClipboard::Time actual = clipboard.getTime();
MSWindowsClipboard::Time actual = clipboard.getTime();
EXPECT_EQ(1, actual);
}*/
TEST_F(CMSWindowsClipboardTests, has_withFormatAdded_returnsTrue)
TEST_F(MSWindowsClipboardTests, has_withFormatAdded_returnsTrue)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.empty();
clipboard.add(IClipboard::kText, "synergy rocks!");
@@ -184,9 +184,9 @@ TEST_F(CMSWindowsClipboardTests, has_withFormatAdded_returnsTrue)
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, has_withNoFormats_returnsFalse)
TEST_F(MSWindowsClipboardTests, has_withNoFormats_returnsFalse)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.empty();
@@ -195,9 +195,9 @@ TEST_F(CMSWindowsClipboardTests, has_withNoFormats_returnsFalse)
EXPECT_EQ(false, actual);
}
TEST_F(CMSWindowsClipboardTests, get_withNoFormats_returnsEmpty)
TEST_F(MSWindowsClipboardTests, get_withNoFormats_returnsEmpty)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.empty();
@@ -206,9 +206,9 @@ TEST_F(CMSWindowsClipboardTests, get_withNoFormats_returnsEmpty)
EXPECT_EQ("", actual);
}
TEST_F(CMSWindowsClipboardTests, get_withFormatAdded_returnsExpected)
TEST_F(MSWindowsClipboardTests, get_withFormatAdded_returnsExpected)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
clipboard.empty();
clipboard.add(IClipboard::kText, "synergy rocks!");
@@ -218,9 +218,9 @@ TEST_F(CMSWindowsClipboardTests, get_withFormatAdded_returnsExpected)
EXPECT_EQ("synergy rocks!", actual);
}
TEST_F(CMSWindowsClipboardTests, isOwnedBySynergy_defaultState_noError)
TEST_F(MSWindowsClipboardTests, isOwnedBySynergy_defaultState_noError)
{
CMSWindowsClipboard clipboard(NULL);
MSWindowsClipboard clipboard(NULL);
clipboard.open(0);
bool actual = clipboard.isOwnedBySynergy();

View File

@@ -35,13 +35,13 @@
using ::testing::_;
using ::testing::NiceMock;
class CMSWindowsKeyStateTests : public ::testing::Test
class MSWindowsKeyStateTests : public ::testing::Test
{
protected:
virtual void SetUp()
{
m_hook.loadLibrary();
m_screensaver = new CMSWindowsScreenSaver();
m_screensaver = new MSWindowsScreenSaver();
}
virtual void TearDown()
@@ -49,31 +49,31 @@ protected:
delete m_screensaver;
}
CMSWindowsDesks* newDesks(IEventQueue* eventQueue)
MSWindowsDesks* newDesks(IEventQueue* eventQueue)
{
return new CMSWindowsDesks(
return new MSWindowsDesks(
true, false, m_hook.getInstance(), m_screensaver, eventQueue,
new TMethodJob<CMSWindowsKeyStateTests>(
this, &CMSWindowsKeyStateTests::updateKeysCB), false);
new TMethodJob<MSWindowsKeyStateTests>(
this, &MSWindowsKeyStateTests::updateKeysCB), false);
}
void* getEventTarget() const
{
return const_cast<CMSWindowsKeyStateTests*>(this);
return const_cast<MSWindowsKeyStateTests*>(this);
}
private:
void updateKeysCB(void*) { }
IScreenSaver* m_screensaver;
CMSWindowsHook m_hook;
MSWindowsHook m_hook;
};
TEST_F(CMSWindowsKeyStateTests, disable_eventQueueNotUsed)
TEST_F(MSWindowsKeyStateTests, disable_eventQueueNotUsed)
{
NiceMock<MockEventQueue> eventQueue;
CMSWindowsDesks* desks = newDesks(&eventQueue);
MSWindowsDesks* desks = newDesks(&eventQueue);
MockKeyMap keyMap;
CMSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
MSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
EXPECT_CALL(eventQueue, removeHandler(_, _)).Times(0);
@@ -81,12 +81,12 @@ TEST_F(CMSWindowsKeyStateTests, disable_eventQueueNotUsed)
delete desks;
}
TEST_F(CMSWindowsKeyStateTests, testAutoRepeat_noRepeatAndButtonIsZero_resultIsTrue)
TEST_F(MSWindowsKeyStateTests, testAutoRepeat_noRepeatAndButtonIsZero_resultIsTrue)
{
NiceMock<MockEventQueue> eventQueue;
CMSWindowsDesks* desks = newDesks(&eventQueue);
MSWindowsDesks* desks = newDesks(&eventQueue);
MockKeyMap keyMap;
CMSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
MSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
keyState.setLastDown(1);
bool actual = keyState.testAutoRepeat(true, false, 1);
@@ -95,12 +95,12 @@ TEST_F(CMSWindowsKeyStateTests, testAutoRepeat_noRepeatAndButtonIsZero_resultIsT
delete desks;
}
TEST_F(CMSWindowsKeyStateTests, testAutoRepeat_pressFalse_lastDownIsZero)
TEST_F(MSWindowsKeyStateTests, testAutoRepeat_pressFalse_lastDownIsZero)
{
NiceMock<MockEventQueue> eventQueue;
CMSWindowsDesks* desks = newDesks(&eventQueue);
MSWindowsDesks* desks = newDesks(&eventQueue);
MockKeyMap keyMap;
CMSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
MSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
keyState.setLastDown(1);
keyState.testAutoRepeat(false, false, 1);
@@ -109,12 +109,12 @@ TEST_F(CMSWindowsKeyStateTests, testAutoRepeat_pressFalse_lastDownIsZero)
delete desks;
}
TEST_F(CMSWindowsKeyStateTests, saveModifiers_noModifiers_savedModifiers0)
TEST_F(MSWindowsKeyStateTests, saveModifiers_noModifiers_savedModifiers0)
{
NiceMock<MockEventQueue> eventQueue;
CMSWindowsDesks* desks = newDesks(&eventQueue);
MSWindowsDesks* desks = newDesks(&eventQueue);
MockKeyMap keyMap;
CMSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
MSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap);
keyState.saveModifiers();