Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Merge branch 'master' into v1.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Nelless committed Mar 3, 2017
2 parents 5909df9 + c5b83ce commit c30301e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/test/unittests/synergy/ClipboardChunkTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ TEST(ClipboardChunkTests, start_formatStartChunk)
UInt32 sequence = 0;
String mockDataSize("10");
ClipboardChunk* chunk = ClipboardChunk::start(id, sequence, mockDataSize);
UInt32 temp_m_chunk;
memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4);

EXPECT_EQ(id, chunk->m_chunk[0]);
EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]);
EXPECT_EQ(sequence, temp_m_chunk);
EXPECT_EQ(kDataStart, chunk->m_chunk[5]);
EXPECT_EQ('1', chunk->m_chunk[6]);
EXPECT_EQ('0', chunk->m_chunk[7]);
Expand All @@ -43,9 +45,11 @@ TEST(ClipboardChunkTests, data_formatDataChunk)
UInt32 sequence = 1;
String mockData("mock data");
ClipboardChunk* chunk = ClipboardChunk::data(id, sequence, mockData);
UInt32 temp_m_chunk;
memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4);

EXPECT_EQ(id, chunk->m_chunk[0]);
EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]);
EXPECT_EQ(sequence, temp_m_chunk);
EXPECT_EQ(kDataChunk, chunk->m_chunk[5]);
EXPECT_EQ('m', chunk->m_chunk[6]);
EXPECT_EQ('o', chunk->m_chunk[7]);
Expand All @@ -66,9 +70,11 @@ TEST(ClipboardChunkTests, end_formatDataChunk)
ClipboardID id = 1;
UInt32 sequence = 1;
ClipboardChunk* chunk = ClipboardChunk::end(id, sequence);
UInt32 temp_m_chunk;
memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4);

EXPECT_EQ(id, chunk->m_chunk[0]);
EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]);
EXPECT_EQ(sequence, temp_m_chunk);
EXPECT_EQ(kDataEnd, chunk->m_chunk[5]);
EXPECT_EQ('\0', chunk->m_chunk[6]);

Expand Down

0 comments on commit c30301e

Please sign in to comment.