diff --git a/src/test/unittests/client/CServerProxyTests.cpp b/src/test/unittests/client/CServerProxyTests.cpp index e856c692..dbfad3e0 100644 --- a/src/test/unittests/client/CServerProxyTests.cpp +++ b/src/test/unittests/client/CServerProxyTests.cpp @@ -32,18 +32,20 @@ using ::testing::AnyNumber; const UInt8 mouseMove_bufferLen = 16; UInt8 mouseMove_buffer[mouseMove_bufferLen]; -UInt32 mouseMove_bufferIndex = 0; +UInt32 mouseMove_bufferIndex; UInt32 mouseMove_mockRead(void* buffer, UInt32 n); const UInt8 cryptoIv_bufferLen = 20; UInt8 cryptoIv_buffer[cryptoIv_bufferLen]; -UInt32 cryptoIv_bufferIndex = 0; +UInt32 cryptoIv_bufferIndex; CString cryptoIv_result; UInt32 cryptoIv_mockRead(void* buffer, UInt32 n); void cryptoIv_setCryptoIv(const UInt8*); TEST(CServerProxyTests, mouseMove) { + mouseMove_bufferIndex = 0; + NiceMock eventQueue; NiceMock client; NiceMock stream; @@ -61,6 +63,8 @@ TEST(CServerProxyTests, mouseMove) TEST(CServerProxyTests, cryptoIv) { + cryptoIv_bufferIndex = 0; + NiceMock eventQueue; NiceMock client; NiceMock stream; diff --git a/src/test/unittests/server/CClientProxyTests.cpp b/src/test/unittests/server/CClientProxyTests.cpp index 13d8e4e8..0dea12af 100644 --- a/src/test/unittests/server/CClientProxyTests.cpp +++ b/src/test/unittests/server/CClientProxyTests.cpp @@ -28,13 +28,15 @@ using ::testing::Invoke; const UInt8 cryptoIvWrite_bufferLen = 200; UInt8 cryptoIvWrite_buffer[cryptoIvWrite_bufferLen]; -UInt32 cryptoIvWrite_bufferIndex = 0; +UInt32 cryptoIvWrite_bufferIndex; void cryptoIv_mockWrite(const void* in, UInt32 n); TEST(CClientProxyTests, cryptoIvWrite) -{ +{ + cryptoIvWrite_bufferIndex = 0; + NiceMock eventQueue; NiceMock innerStream; NiceMock server; diff --git a/src/test/unittests/synergy/CCryptoStreamTests.cpp b/src/test/unittests/synergy/CCryptoStreamTests.cpp index 51802d4a..578379dd 100644 --- a/src/test/unittests/synergy/CCryptoStreamTests.cpp +++ b/src/test/unittests/synergy/CCryptoStreamTests.cpp @@ -36,18 +36,18 @@ UInt8 g_read_buffer[4]; UInt8 read_mockRead(void* out, UInt32 n); UInt8 g_write4Read1_buffer[4]; -UInt32 g_write4Read1_bufferIndex = 0; +UInt32 g_write4Read1_bufferIndex; void write4Read1_mockWrite(const void* in, UInt32 n); UInt8 write4Read1_mockRead(void* out, UInt32 n); UInt8 g_write1Read4_buffer[4]; -UInt32 g_write1Read4_bufferIndex = 0; +UInt32 g_write1Read4_bufferIndex; void write1Read4_mockWrite(const void* in, UInt32 n); UInt8 write1Read4_mockRead(void* out, UInt32 n); UInt8 g_readWriteIvChanged_buffer[4]; -UInt32 g_readWriteIvChangeTrigger_writeBufferIndex = 0; -UInt32 g_readWriteIvChangeTrigger_readBufferIndex = 0; +UInt32 g_readWriteIvChangeTrigger_writeBufferIndex; +UInt32 g_readWriteIvChangeTrigger_readBufferIndex; void readWriteIvChanged_mockWrite(const void* in, UInt32 n); UInt8 readWriteIvChanged_mockRead(void* out, UInt32 n); @@ -108,6 +108,8 @@ TEST(CCryptoTests, read) TEST(CCryptoTests, write4Read1) { + g_write4Read1_bufferIndex = 0; + NiceMock eventQueue; NiceMock innerStream; CCryptoOptions options("ctr", "mock"); @@ -137,6 +139,8 @@ TEST(CCryptoTests, write4Read1) TEST(CCryptoTests, write1Read4) { + g_write1Read4_bufferIndex = 0; + NiceMock eventQueue; NiceMock innerStream; CCryptoOptions options("ctr", "mock"); @@ -171,6 +175,9 @@ TEST(CCryptoTests, write1Read4) TEST(CCryptoTests, readWriteIvChanged) { + g_readWriteIvChangeTrigger_writeBufferIndex = 0; + g_readWriteIvChangeTrigger_readBufferIndex = 0; + NiceMock eventQueue; NiceMock innerStream; CCryptoOptions options("ctr", "mock");