diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index 944c06aa..06ea45d5 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -22,6 +22,7 @@ #include "client/ServerProxy.h" #include "synergy/Screen.h" #include "synergy/Clipboard.h" +#include "synergy/FileChunk.h" #include "synergy/DropHelper.h" #include "synergy/PacketStreamFilter.h" #include "synergy/ProtocolUtil.h" @@ -422,12 +423,12 @@ Client::sendConnectionFailedEvent(const char* msg) void Client::sendFileChunk(const void* data) { - StreamChunker::Chunk* chunk = reinterpret_cast(const_cast(data)); + FileChunk* chunk = reinterpret_cast(const_cast(data)); LOG((CLOG_DEBUG1 "send file chunk")); assert(m_server != NULL); // relay - m_server->fileChunkSending(chunk->m_chunk[0], &(chunk->m_chunk[1]), chunk->m_size); + m_server->fileChunkSending(chunk->m_chunk[0], &chunk->m_chunk[1], chunk->m_dataSize); } void @@ -821,7 +822,7 @@ Client::sendFileThread(void* filename) { try { char* name = reinterpret_cast(filename); - StreamChunker::sendFileChunks(name, m_events, this); + StreamChunker::sendFile(name, m_events, this); } catch (std::runtime_error error) { LOG((CLOG_ERR "failed sending file chunks: %s", error.what())); diff --git a/src/lib/server/ClientProxy1_6.cpp b/src/lib/server/ClientProxy1_6.cpp index 3361d242..acdb7dfd 100644 --- a/src/lib/server/ClientProxy1_6.cpp +++ b/src/lib/server/ClientProxy1_6.cpp @@ -19,7 +19,6 @@ #include "server/Server.h" #include "synergy/StreamChunker.h" -#include "synergy/ProtocolUtil.h" #include "io/IStream.h" #include "base/Log.h" @@ -37,6 +36,20 @@ ClientProxy1_6::~ClientProxy1_6() { } +bool +ClientProxy1_6::parseMessage(const UInt8* code) +{ + //TODO:: parse data tansfer + if (memcmp(code, kMsgDFileTransfer, 4) == 0) { + fileChunkReceived(); + } + else { + return ClientProxy1_5::parseMessage(code); + } + + return true; +} + void ClientProxy1_6::setClipboard(ClipboardID id, const IClipboard* clipboard) { @@ -51,6 +64,6 @@ ClientProxy1_6::setClipboard(ClipboardID id, const IClipboard* clipboard) size_t size = data.size(); LOG((CLOG_DEBUG "sending clipboard %d to \"%s\" size=%d", id, getName().c_str(), size)); - StreamChunker::sendData(data, size, id, m_events, this); + StreamChunker::sendClipboard(data, size, id, 0, m_events, this); } } diff --git a/src/lib/server/ClientProxy1_6.h b/src/lib/server/ClientProxy1_6.h index 7077c9b8..3290ffe6 100644 --- a/src/lib/server/ClientProxy1_6.h +++ b/src/lib/server/ClientProxy1_6.h @@ -28,6 +28,7 @@ public: ClientProxy1_6(const String& name, synergy::IStream* adoptedStream, Server* server, IEventQueue* events); ~ClientProxy1_6(); + virtual bool parseMessage(const UInt8* code); virtual void setClipboard(ClipboardID id, const IClipboard* clipboard); private: diff --git a/src/lib/server/ClientProxyUnknown.cpp b/src/lib/server/ClientProxyUnknown.cpp index 28191792..a328d213 100644 --- a/src/lib/server/ClientProxyUnknown.cpp +++ b/src/lib/server/ClientProxyUnknown.cpp @@ -25,6 +25,7 @@ #include "server/ClientProxy1_3.h" #include "server/ClientProxy1_4.h" #include "server/ClientProxy1_5.h" +#include "server/ClientProxy1_6.h" #include "synergy/protocol_types.h" #include "synergy/ProtocolUtil.h" #include "synergy/XSynergy.h" @@ -227,6 +228,10 @@ ClientProxyUnknown::handleData(const Event&, void*) case 5: m_proxy = new ClientProxy1_5(name, m_stream, m_server, m_events); break; + + case 6: + m_proxy = new ClientProxy1_6(name, m_stream, m_server, m_events); + break; } } diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index c3c98f4b..607a0078 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -22,13 +22,14 @@ #include "server/ClientProxyUnknown.h" #include "server/PrimaryClient.h" #include "server/ClientListener.h" +#include "synergy/FileChunk.h" #include "synergy/IPlatformScreen.h" #include "synergy/DropHelper.h" #include "synergy/option_types.h" #include "synergy/protocol_types.h" #include "synergy/XScreen.h" #include "synergy/XSynergy.h" -#include "synergy/FileChunker.h" +#include "synergy/StreamChunker.h" #include "synergy/KeyState.h" #include "synergy/Screen.h" #include "synergy/PacketStreamFilter.h" @@ -508,7 +509,7 @@ Server::switchScreen(BaseClientProxy* dst, // send the clipboard data to new active screen m_dataTransmissionThread = new Thread( new TMethodJob( - this, &Server::clipboardTransmissionThread, + this, &Server::sendClipboardThread, NULL)); Server::SwitchToScreenInfo* info = @@ -1852,10 +1853,10 @@ Server::sendDragInfo(BaseClientProxy* newScreen) } void -Server::clipboardTransmissionThread(void*) +Server::sendClipboardThread(void*) { for (ClipboardID id = 0; id < kClipboardEnd; ++id) { - m_active->setClipboard(id, &m_clipboards[id].m_clipboard); + m_active->setClipboard(id, &m_clipboards[id].m_clipboard); } } @@ -2033,13 +2034,13 @@ Server::onMouseWheel(SInt32 xDelta, SInt32 yDelta) void Server::onFileChunkSending(const void* data) { - StreamChunker::Chunk* chunk = reinterpret_cast(const_cast(data)); + FileChunk* chunk = reinterpret_cast(const_cast(data)); LOG((CLOG_DEBUG1 "sending file chunk")); assert(m_active != NULL); // relay - m_active->fileChunkSending(chunk->m_chunk[0], &(chunk->m_chunk[1]), chunk->m_size); + m_active->fileChunkSending(chunk->m_chunk[0], &chunk->m_chunk[1], chunk->m_dataSize); } void @@ -2376,7 +2377,7 @@ Server::sendFileThread(void* data) try { char* filename = reinterpret_cast(data); LOG((CLOG_DEBUG "sending file to client, filename=%s", filename)); - StreamChunker::sendFileChunks(filename, m_events, this); + StreamChunker::sendFile(filename, m_events, this); } catch (std::runtime_error error) { LOG((CLOG_ERR "failed sending file chunks, error: %s", error.what())); diff --git a/src/lib/server/Server.h b/src/lib/server/Server.h index 8cc700b4..02b9cd47 100644 --- a/src/lib/server/Server.h +++ b/src/lib/server/Server.h @@ -371,7 +371,7 @@ private: void sendDragInfo(BaseClientProxy* newScreen); // thread funciton for sending clipboard - void clipboardTransmissionThread(void*); + void sendClipboardThread(void*); public: bool m_mock; diff --git a/src/lib/synergy/Chunk.cpp b/src/lib/synergy/Chunk.cpp new file mode 100644 index 00000000..fe4aeae7 --- /dev/null +++ b/src/lib/synergy/Chunk.cpp @@ -0,0 +1,30 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2015 Synergy Si Inc. + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * found in the file LICENSE that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "synergy/Chunk.h" +#include "base/String.h" + +Chunk::Chunk(size_t size) +{ + m_chunk = new char[size]; + memset(m_chunk, 0, size); +} + +Chunk::~Chunk() +{ + delete[] m_chunk; +} diff --git a/src/lib/synergy/Chunk.h b/src/lib/synergy/Chunk.h new file mode 100644 index 00000000..13431950 --- /dev/null +++ b/src/lib/synergy/Chunk.h @@ -0,0 +1,30 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2015 Synergy Si Inc. + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * found in the file LICENSE that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "common/basic_types.h" + +class Chunk { +public: + Chunk(size_t size); + ~Chunk(); + +public: + size_t m_dataSize; + char* m_chunk; +}; diff --git a/src/lib/synergy/ClipboardChunk.cpp b/src/lib/synergy/ClipboardChunk.cpp new file mode 100644 index 00000000..9d43953c --- /dev/null +++ b/src/lib/synergy/ClipboardChunk.cpp @@ -0,0 +1,81 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2015 Synergy Si Inc. + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * found in the file LICENSE that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "synergy/ClipboardChunk.h" + +#include "synergy/protocol_types.h" + +ClipboardChunk::ClipboardChunk(size_t size) : + Chunk(size) +{ + m_dataSize = size - CLIPBOARD_CHUNK_META_SIZE; +} + +ClipboardChunk* +ClipboardChunk::start( + ClipboardID id, + UInt32 sequence, + const String& size) +{ + size_t sizeLength = size.size(); + ClipboardChunk* start = new ClipboardChunk(sizeLength + CLIPBOARD_CHUNK_META_SIZE); + char* chunk = start->m_chunk; + + chunk[0] = id; + UInt32* seq = reinterpret_cast(&chunk[1]); + *seq = sequence; + chunk[5] = kDataStart; + memcpy(&chunk[6], size.c_str(), sizeLength); + chunk[sizeLength + CLIPBOARD_CHUNK_META_SIZE - 1] = '\0'; + + return start; +} + +ClipboardChunk* +ClipboardChunk::data( + ClipboardID id, + UInt32 sequence, + const String& data) +{ + size_t dataSize = data.size(); + ClipboardChunk* chunk = new ClipboardChunk(dataSize + CLIPBOARD_CHUNK_META_SIZE); + char* chunkData = chunk->m_chunk; + + chunkData[0] = id; + UInt32* seq = reinterpret_cast(&chunkData[1]); + *seq = sequence; + chunkData[5] = kDataChunk; + memcpy(&chunkData[6], data.c_str(), dataSize); + chunkData[dataSize + CLIPBOARD_CHUNK_META_SIZE - 1] = '\0'; + + return chunk; +} + +ClipboardChunk* +ClipboardChunk::end(ClipboardID id, UInt32 sequence) +{ + ClipboardChunk* end = new ClipboardChunk(CLIPBOARD_CHUNK_META_SIZE); + char* chunk = end->m_chunk; + + chunk[0] = id; + UInt32* seq = reinterpret_cast(&chunk[1]); + *seq = sequence; + chunk[5] = kDataEnd; + chunk[CLIPBOARD_CHUNK_META_SIZE - 1] = '\0'; + + return end; +} diff --git a/src/lib/synergy/ClipboardChunk.h b/src/lib/synergy/ClipboardChunk.h new file mode 100644 index 00000000..df78cb08 --- /dev/null +++ b/src/lib/synergy/ClipboardChunk.h @@ -0,0 +1,40 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2015 Synergy Si Inc. + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * found in the file LICENSE that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "synergy/Chunk.h" +#include "synergy/clipboard_types.h" +#include "base/String.h" +#include "common/basic_types.h" + +#define CLIPBOARD_CHUNK_META_SIZE 7 + +class ClipboardChunk : public Chunk { +public: + ClipboardChunk(size_t size); + + static ClipboardChunk* start( + ClipboardID id, + UInt32 sequence, + const String& size); + static ClipboardChunk* data( + ClipboardID id, + UInt32 sequence, + const String& data); + static ClipboardChunk* end(ClipboardID id, UInt32 sequence); +}; diff --git a/src/lib/synergy/FileChunk.cpp b/src/lib/synergy/FileChunk.cpp new file mode 100644 index 00000000..82c103cc --- /dev/null +++ b/src/lib/synergy/FileChunk.cpp @@ -0,0 +1,62 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2015 Synergy Si Inc. + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * found in the file LICENSE that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "synergy/FileChunk.h" + +#include "synergy/protocol_types.h" + +FileChunk::FileChunk(size_t size) : + Chunk(size) +{ + m_dataSize = size - FILE_CHUNK_META_SIZE; +} + +FileChunk* +FileChunk::start(const String& size) +{ + size_t sizeLength = size.size(); + FileChunk* start = new FileChunk(sizeLength + FILE_CHUNK_META_SIZE); + char* chunk = start->m_chunk; + chunk[0] = kDataStart; + memcpy(&chunk[1], size.c_str(), sizeLength); + chunk[sizeLength + 1] = '\0'; + + return start; +} + +FileChunk* +FileChunk::data(UInt8* data, size_t dataSize) +{ + FileChunk* chunk = new FileChunk(dataSize + FILE_CHUNK_META_SIZE); + char* chunkData = chunk->m_chunk; + chunkData[0] = kDataChunk; + memcpy(&chunkData[1], data, dataSize); + chunkData[dataSize + 1] = '\0'; + + return chunk; +} + +FileChunk* +FileChunk::end() +{ + FileChunk* end = new FileChunk(FILE_CHUNK_META_SIZE); + char* chunk = end->m_chunk; + chunk[0] = kDataEnd; + chunk[1] = '\0'; + + return end; +} diff --git a/src/lib/synergy/FileChunk.h b/src/lib/synergy/FileChunk.h new file mode 100644 index 00000000..baf8faa8 --- /dev/null +++ b/src/lib/synergy/FileChunk.h @@ -0,0 +1,33 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2015 Synergy Si Inc. + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * found in the file LICENSE that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "synergy/Chunk.h" +#include "base/String.h" +#include "common/basic_types.h" + +#define FILE_CHUNK_META_SIZE 2 + +class FileChunk : public Chunk { +public: + FileChunk(size_t size); + + static FileChunk* start(const String& size); + static FileChunk* data(UInt8* data, size_t dataSize); + static FileChunk* end(); +}; diff --git a/src/lib/synergy/StreamChunker.h b/src/lib/synergy/StreamChunker.h index 0560347f..e1dd4605 100644 --- a/src/lib/synergy/StreamChunker.h +++ b/src/lib/synergy/StreamChunker.h @@ -17,29 +17,24 @@ #pragma once +#include "synergy/clipboard_types.h" #include "base/String.h" class IEventQueue; class StreamChunker { public: - //! FileChunk data - class Chunk { - public: - Chunk(size_t size) : m_size(size - 2) - { - m_chunk = new char[size]; - } - - ~Chunk() { delete[] m_chunk; } - - public: - const size_t m_size; - char* m_chunk; - }; - - static void sendFileChunks(char* filename, IEventQueue* events, void* eventTarget); - static String intToString(size_t i); + static void sendFile( + char* filename, + IEventQueue* events, + void* eventTarget); + static void sendClipboard( + String& data, + size_t size, + ClipboardID id, + UInt32 sequence, + IEventQueue* events, + void* eventTarget); private: static const size_t m_chunkSize; diff --git a/src/test/integtests/net/NetworkTests.cpp b/src/test/integtests/net/NetworkTests.cpp index 21097163..f4f9e4c5 100644 --- a/src/test/integtests/net/NetworkTests.cpp +++ b/src/test/integtests/net/NetworkTests.cpp @@ -28,6 +28,7 @@ #include "server/Server.h" #include "server/ClientListener.h" #include "client/Client.h" +#include "synergy/FileChunk.h" #include "synergy/StreamChunker.h" #include "net/SocketMultiplexer.h" #include "net/NetworkAddress.h" @@ -60,7 +61,6 @@ const size_t kMockFileSize = 1024 * 1024 * 10; // 10MB void getScreenShape(SInt32& x, SInt32& y, SInt32& w, SInt32& h); void getCursorPos(SInt32& x, SInt32& y); -String intToString(size_t i); UInt8* newMockData(size_t size); void createFile(fstream& file, const char* filename, size_t size); @@ -415,38 +415,28 @@ void NetworkTests::sendMockData(void* eventTarget) { // send first message (file size) - String size = intToString(kMockDataSize); - size_t sizeLength = size.size(); - StreamChunker::Chunk* sizeMessage = new StreamChunker::Chunk(sizeLength + 2); - char* chunkData = sizeMessage->m_chunk; - - chunkData[0] = kDataStart; - memcpy(&chunkData[1], size.c_str(), sizeLength); - chunkData[sizeLength + 1] = '\0'; + String size = synergy::string::intToString(kMockDataSize); + FileChunk* sizeMessage = FileChunk::start(size); + m_events.addEvent(Event(m_events.forIScreen().fileChunkSending(), eventTarget, sizeMessage)); // send chunk messages with incrementing chunk size size_t lastSize = 0; size_t sentLength = 0; while (true) { - size_t chunkSize = lastSize + kMockDataChunkIncrement; + size_t dataSize = lastSize + kMockDataChunkIncrement; // make sure we don't read too much from the mock data. - if (sentLength + chunkSize > kMockDataSize) { - chunkSize = kMockDataSize - sentLength; + if (sentLength + dataSize > kMockDataSize) { + dataSize = kMockDataSize - sentLength; } // first byte is the chunk mark, last is \0 - StreamChunker::Chunk* fileChunk = new StreamChunker::Chunk(chunkSize + 2); - char* chunkData = fileChunk->m_chunk; + FileChunk* chunk = FileChunk::data(m_mockData, dataSize); + m_events.addEvent(Event(m_events.forIScreen().fileChunkSending(), eventTarget, chunk)); - chunkData[0] = kDataChunk; - memcpy(&chunkData[1], &m_mockData[sentLength], chunkSize); - chunkData[chunkSize + 1] = '\0'; - m_events.addEvent(Event(m_events.forIScreen().fileChunkSending(), eventTarget, fileChunk)); - - sentLength += chunkSize; - lastSize = chunkSize; + sentLength += dataSize; + lastSize = dataSize; if (sentLength == kMockDataSize) { break; @@ -455,11 +445,7 @@ NetworkTests::sendMockData(void* eventTarget) } // send last message - StreamChunker::Chunk* transferFinished = new StreamChunker::Chunk(2); - chunkData = transferFinished->m_chunk; - - chunkData[0] = kDataEnd; - chunkData[1] = '\0'; + FileChunk* transferFinished = FileChunk::end(); m_events.addEvent(Event(m_events.forIScreen().fileChunkSending(), eventTarget, transferFinished)); } @@ -527,12 +513,4 @@ getCursorPos(SInt32& x, SInt32& y) y = 0; } -String -intToString(size_t i) -{ - stringstream ss; - ss << i; - return ss.str(); -} - #endif // WINAPI_CARBON diff --git a/src/test/unittests/synergy/ClipboardChunkTests.cpp b/src/test/unittests/synergy/ClipboardChunkTests.cpp new file mode 100644 index 00000000..3666fe45 --- /dev/null +++ b/src/test/unittests/synergy/ClipboardChunkTests.cpp @@ -0,0 +1,76 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2015 Synergy Si Inc. + * + * This package is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * found in the file LICENSE that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "synergy/ClipboardChunk.h" +#include "synergy/protocol_types.h" + +#include "test/global/gtest.h" + +TEST(ClipboardChunkTests, start_formatStartChunk) +{ + ClipboardID id = 0; + UInt32 sequence = 0; + String mockDataSize("10"); + ClipboardChunk* chunk = ClipboardChunk::start(id, sequence, mockDataSize); + + EXPECT_EQ(id, chunk->m_chunk[0]); + EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]); + EXPECT_EQ(kDataStart, chunk->m_chunk[5]); + EXPECT_EQ('1', chunk->m_chunk[6]); + EXPECT_EQ('0', chunk->m_chunk[7]); + EXPECT_EQ('\0', chunk->m_chunk[8]); + + delete chunk; +} + +TEST(ClipboardChunkTests, data_formatDataChunk) +{ + ClipboardID id = 0; + UInt32 sequence = 1; + String mockData("mock data"); + ClipboardChunk* chunk = ClipboardChunk::data(id, sequence, mockData); + + EXPECT_EQ(id, chunk->m_chunk[0]); + EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]); + EXPECT_EQ(kDataChunk, chunk->m_chunk[5]); + EXPECT_EQ('m', chunk->m_chunk[6]); + EXPECT_EQ('o', chunk->m_chunk[7]); + EXPECT_EQ('c', chunk->m_chunk[8]); + EXPECT_EQ('k', chunk->m_chunk[9]); + EXPECT_EQ(' ', chunk->m_chunk[10]); + EXPECT_EQ('d', chunk->m_chunk[11]); + EXPECT_EQ('a', chunk->m_chunk[12]); + EXPECT_EQ('t', chunk->m_chunk[13]); + EXPECT_EQ('a', chunk->m_chunk[14]); + EXPECT_EQ('\0', chunk->m_chunk[15]); + + delete chunk; +} + +TEST(ClipboardChunkTests, end_formatDataChunk) +{ + ClipboardID id = 1; + UInt32 sequence = 1; + ClipboardChunk* chunk = ClipboardChunk::end(id, sequence); + + EXPECT_EQ(id, chunk->m_chunk[0]); + EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]); + EXPECT_EQ(kDataEnd, chunk->m_chunk[5]); + EXPECT_EQ('\0', chunk->m_chunk[6]); + + delete chunk; +}