Lines Matching refs:length
106 for (uint16_t length = 0; length <= kMaxSize - offset; length++) in TestMessage() local
108 for (uint16_t i = 0; i < length; i++) in TestMessage()
113 message->WriteBytes(offset, &writeBuffer[offset], length); in TestMessage()
120 SuccessOrQuit(message->Read(offset, readBuffer, length)); in TestMessage()
121 VerifyOrQuit(memcmp(readBuffer, &writeBuffer[offset], length) == 0); in TestMessage()
122 …VerifyOrQuit(memcmp(&readBuffer[length], zeroBuffer, kMaxSize - length) == 0, "read after length"); in TestMessage()
124 VerifyOrQuit(message->CompareBytes(offset, &writeBuffer[offset], length)); in TestMessage()
126 if (length == 0) in TestMessage()
135 VerifyOrQuit(!message->CompareBytes(offset, &writeBuffer[offset], length)); in TestMessage()
138 writeBuffer[offset + length - 1]++; in TestMessage()
139 VerifyOrQuit(!message->CompareBytes(offset, &writeBuffer[offset], length)); in TestMessage()
140 writeBuffer[offset + length - 1]--; in TestMessage()
145 for (uint16_t length = kMaxSize - offset + 1; length <= kMaxSize + 1; length++) in TestMessage() local
150 readLength = message->ReadBytes(offset, readBuffer, length); in TestMessage()
152 VerifyOrQuit(readLength < length, "Message::ReadBytes() returned longer length"); in TestMessage()
157 VerifyOrQuit(!message->CompareBytes(offset, readBuffer, length)); in TestMessage()
174 …for (uint16_t length = 0; length <= kMaxSize - Max(writeOffset, readOffset); length += kLengthStep) in TestMessage() local
178 message2->WriteBytesFromMessage(writeOffset, *message, readOffset, length); in TestMessage()
183 … VerifyOrQuit(memcmp(&readBuffer[writeOffset], &writeBuffer[readOffset], length) == 0); in TestMessage()
184 …VerifyOrQuit(memcmp(&readBuffer[writeOffset + length], zeroBuffer, kMaxSize - length - writeOffset… in TestMessage()
187 VerifyOrQuit(message->CompareBytes(readOffset, *message2, writeOffset, length)); in TestMessage()
188 VerifyOrQuit(message2->CompareBytes(writeOffset, *message, readOffset, length)); in TestMessage()
198 uint16_t length = kMaxSize - readOffset; in TestMessage() local
202 message->WriteBytesFromMessage(0, *message, readOffset, length); in TestMessage()
206 VerifyOrQuit(memcmp(&readBuffer[0], &writeBuffer[readOffset], length) == 0); in TestMessage()
207 VerifyOrQuit(memcmp(&readBuffer[length], &writeBuffer[length], kMaxSize - length) == 0); in TestMessage()
215 uint16_t length = kMaxSize - writeOffset; in TestMessage() local
219 message->WriteBytesFromMessage(writeOffset, *message, 0, length); in TestMessage()
224 VerifyOrQuit(memcmp(&readBuffer[writeOffset], &writeBuffer[0], length) == 0); in TestMessage()
234 …for (uint16_t length = 0; length <= kMaxSize - Max(writeOffset, readOffset); length += kLengthStep) in TestMessage() local
238 message->WriteBytesFromMessage(writeOffset, *message, readOffset, length); in TestMessage()
243 … VerifyOrQuit(memcmp(&readBuffer[writeOffset], &writeBuffer[readOffset], length) == 0); in TestMessage()
244 … VerifyOrQuit(memcmp(&readBuffer[writeOffset + length], &writeBuffer[writeOffset + length], in TestMessage()
245 kMaxSize - length - writeOffset) == 0); in TestMessage()
258 for (uint16_t length = 0; length <= kMaxSize - srcOffset; length += kLengthStep) in TestMessage() local
263 SuccessOrQuit(message2->AppendBytesFromMessage(*message, srcOffset, length)); in TestMessage()
265 VerifyOrQuit(message2->CompareBytes(dstOffset, *message, srcOffset, length)); in TestMessage()
279 for (uint16_t length = 0; length <= kMaxSize - srcOffset; length++) in TestMessage() local
284 SuccessOrQuit(message->AppendBytesFromMessage(*message, srcOffset, length)); in TestMessage()
286 VerifyOrQuit(message->CompareBytes(size, *message, srcOffset, length)); in TestMessage()
297 for (uint16_t length = 0; length <= kMaxSize - offset; length += kLengthStep) in TestMessage() local
302 message->RemoveHeader(offset, length); in TestMessage()
304 VerifyOrQuit(message->GetLength() == kMaxSize - length); in TestMessage()
306 SuccessOrQuit(message->Read(0, readBuffer, kMaxSize - length)); in TestMessage()
309 …VerifyOrQuit(memcmp(&readBuffer[offset], &writeBuffer[offset + length], kMaxSize - length - offset… in TestMessage()
318 for (uint16_t length = 0; length <= kMaxSize; length += kLengthStep) in TestMessage() local
323 SuccessOrQuit(message->InsertHeader(offset, length)); in TestMessage()
325 VerifyOrQuit(message->GetLength() == kMaxSize + length); in TestMessage()
330 SuccessOrQuit(message->Read(offset + length, readBuffer, kMaxSize - offset)); in TestMessage()