| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <iostream> | 6 #include <iostream> |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/sys_byteorder.h" | 9 #include "base/sys_byteorder.h" |
| 10 #include "net/spdy/spdy_frame_reader.h" | 10 #include "net/spdy/spdy_frame_reader.h" |
| 11 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 TEST(SpdyFrameReaderTest, ReadUInt16) { | 15 TEST(SpdyFrameReaderTest, ReadUInt16) { |
| 16 // Frame data in network byte order. | 16 // Frame data in network byte order. |
| 17 const uint16 kFrameData[] = { | 17 const uint16 kFrameData[] = { |
| 18 htons(1), htons(1<<15), | 18 htons(1), htons(1 << 15), |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 SpdyFrameReader frame_reader(reinterpret_cast<const char *>(kFrameData), | 21 SpdyFrameReader frame_reader(reinterpret_cast<const char*>(kFrameData), |
| 22 arraysize(kFrameData) * sizeof(uint16)); | 22 arraysize(kFrameData) * sizeof(uint16)); |
| 23 EXPECT_FALSE(frame_reader.IsDoneReading()); | 23 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 24 | 24 |
| 25 uint16 uint16_val; | 25 uint16 uint16_val; |
| 26 EXPECT_TRUE(frame_reader.ReadUInt16(&uint16_val)); | 26 EXPECT_TRUE(frame_reader.ReadUInt16(&uint16_val)); |
| 27 EXPECT_FALSE(frame_reader.IsDoneReading()); | 27 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 28 EXPECT_EQ(1, uint16_val); | 28 EXPECT_EQ(1, uint16_val); |
| 29 | 29 |
| 30 EXPECT_TRUE(frame_reader.ReadUInt16(&uint16_val)); | 30 EXPECT_TRUE(frame_reader.ReadUInt16(&uint16_val)); |
| 31 EXPECT_TRUE(frame_reader.IsDoneReading()); | 31 EXPECT_TRUE(frame_reader.IsDoneReading()); |
| 32 EXPECT_EQ(1<<15, uint16_val); | 32 EXPECT_EQ(1 << 15, uint16_val); |
| 33 } | 33 } |
| 34 | 34 |
| 35 TEST(SpdyFrameReaderTest, ReadUInt32) { | 35 TEST(SpdyFrameReaderTest, ReadUInt32) { |
| 36 // Frame data in network byte order. | 36 // Frame data in network byte order. |
| 37 const uint32 kFrameData[] = { | 37 const uint32 kFrameData[] = { |
| 38 htonl(1), htonl(1<<31), | 38 htonl(1), htonl(1 << 31), |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 SpdyFrameReader frame_reader(reinterpret_cast<const char *>(kFrameData), | 41 SpdyFrameReader frame_reader(reinterpret_cast<const char*>(kFrameData), |
| 42 arraysize(kFrameData) * sizeof(uint32)); | 42 arraysize(kFrameData) * sizeof(uint32)); |
| 43 EXPECT_FALSE(frame_reader.IsDoneReading()); | 43 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 44 | 44 |
| 45 uint32 uint32_val; | 45 uint32 uint32_val; |
| 46 EXPECT_TRUE(frame_reader.ReadUInt32(&uint32_val)); | 46 EXPECT_TRUE(frame_reader.ReadUInt32(&uint32_val)); |
| 47 EXPECT_FALSE(frame_reader.IsDoneReading()); | 47 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 48 EXPECT_EQ(1u, uint32_val); | 48 EXPECT_EQ(1u, uint32_val); |
| 49 | 49 |
| 50 EXPECT_TRUE(frame_reader.ReadUInt32(&uint32_val)); | 50 EXPECT_TRUE(frame_reader.ReadUInt32(&uint32_val)); |
| 51 EXPECT_TRUE(frame_reader.IsDoneReading()); | 51 EXPECT_TRUE(frame_reader.IsDoneReading()); |
| 52 EXPECT_EQ(1u<<31, uint32_val); | 52 EXPECT_EQ(1u << 31, uint32_val); |
| 53 } | 53 } |
| 54 | 54 |
| 55 TEST(SpdyFrameReaderTest, ReadStringPiece16) { | 55 TEST(SpdyFrameReaderTest, ReadStringPiece16) { |
| 56 // Frame data in network byte order. | 56 // Frame data in network byte order. |
| 57 const char kFrameData[] = { | 57 const char kFrameData[] = { |
| 58 0x00, 0x02, // uint16(2) | 58 0x00, 0x02, // uint16(2) |
| 59 0x48, 0x69, // "Hi" | 59 0x48, 0x69, // "Hi" |
| 60 0x00, 0x10, // uint16(16) | 60 0x00, 0x10, // uint16(16) |
| 61 0x54, 0x65, 0x73, 0x74, | 61 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2c, |
| 62 0x69, 0x6e, 0x67, 0x2c, | 62 0x20, 0x31, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x33, // "Testing, 1, 2, 3" |
| 63 0x20, 0x31, 0x2c, 0x20, | |
| 64 0x32, 0x2c, 0x20, 0x33, // "Testing, 1, 2, 3" | |
| 65 }; | 63 }; |
| 66 | 64 |
| 67 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 65 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 68 EXPECT_FALSE(frame_reader.IsDoneReading()); | 66 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 69 | 67 |
| 70 base::StringPiece stringpiece_val; | 68 base::StringPiece stringpiece_val; |
| 71 EXPECT_TRUE(frame_reader.ReadStringPiece16(&stringpiece_val)); | 69 EXPECT_TRUE(frame_reader.ReadStringPiece16(&stringpiece_val)); |
| 72 EXPECT_FALSE(frame_reader.IsDoneReading()); | 70 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 73 EXPECT_EQ(0, stringpiece_val.compare("Hi")); | 71 EXPECT_EQ(0, stringpiece_val.compare("Hi")); |
| 74 | 72 |
| 75 EXPECT_TRUE(frame_reader.ReadStringPiece16(&stringpiece_val)); | 73 EXPECT_TRUE(frame_reader.ReadStringPiece16(&stringpiece_val)); |
| 76 EXPECT_TRUE(frame_reader.IsDoneReading()); | 74 EXPECT_TRUE(frame_reader.IsDoneReading()); |
| 77 EXPECT_EQ(0, stringpiece_val.compare("Testing, 1, 2, 3")); | 75 EXPECT_EQ(0, stringpiece_val.compare("Testing, 1, 2, 3")); |
| 78 } | 76 } |
| 79 | 77 |
| 80 TEST(SpdyFrameReaderTest, ReadStringPiece32) { | 78 TEST(SpdyFrameReaderTest, ReadStringPiece32) { |
| 81 // Frame data in network byte order. | 79 // Frame data in network byte order. |
| 82 const char kFrameData[] = { | 80 const char kFrameData[] = { |
| 83 0x00, 0x00, 0x00, 0x03, // uint32(3) | 81 0x00, 0x00, 0x00, 0x03, // uint32(3) |
| 84 0x66, 0x6f, 0x6f, // "foo" | 82 0x66, 0x6f, 0x6f, // "foo" |
| 85 0x00, 0x00, 0x00, 0x10, // uint32(16) | 83 0x00, 0x00, 0x00, 0x10, // uint32(16) |
| 86 0x54, 0x65, 0x73, 0x74, | 84 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2c, |
| 87 0x69, 0x6e, 0x67, 0x2c, | 85 0x20, 0x34, 0x2c, 0x20, 0x35, 0x2c, 0x20, 0x36, // "Testing, 4, 5, 6" |
| 88 0x20, 0x34, 0x2c, 0x20, | |
| 89 0x35, 0x2c, 0x20, 0x36, // "Testing, 4, 5, 6" | |
| 90 }; | 86 }; |
| 91 | 87 |
| 92 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 88 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 93 EXPECT_FALSE(frame_reader.IsDoneReading()); | 89 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 94 | 90 |
| 95 base::StringPiece stringpiece_val; | 91 base::StringPiece stringpiece_val; |
| 96 EXPECT_TRUE(frame_reader.ReadStringPiece32(&stringpiece_val)); | 92 EXPECT_TRUE(frame_reader.ReadStringPiece32(&stringpiece_val)); |
| 97 EXPECT_FALSE(frame_reader.IsDoneReading()); | 93 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 98 EXPECT_EQ(0, stringpiece_val.compare("foo")); | 94 EXPECT_EQ(0, stringpiece_val.compare("foo")); |
| 99 | 95 |
| 100 EXPECT_TRUE(frame_reader.ReadStringPiece32(&stringpiece_val)); | 96 EXPECT_TRUE(frame_reader.ReadStringPiece32(&stringpiece_val)); |
| 101 EXPECT_TRUE(frame_reader.IsDoneReading()); | 97 EXPECT_TRUE(frame_reader.IsDoneReading()); |
| 102 EXPECT_EQ(0, stringpiece_val.compare("Testing, 4, 5, 6")); | 98 EXPECT_EQ(0, stringpiece_val.compare("Testing, 4, 5, 6")); |
| 103 } | 99 } |
| 104 | 100 |
| 105 TEST(SpdyFrameReaderTest, ReadUInt16WithBufferTooSmall) { | 101 TEST(SpdyFrameReaderTest, ReadUInt16WithBufferTooSmall) { |
| 106 // Frame data in network byte order. | 102 // Frame data in network byte order. |
| 107 const char kFrameData[] = { | 103 const char kFrameData[] = { |
| 108 0x00, // part of a uint16 | 104 0x00, // part of a uint16 |
| 109 }; | 105 }; |
| 110 | 106 |
| 111 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 107 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 112 EXPECT_FALSE(frame_reader.IsDoneReading()); | 108 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 113 | 109 |
| 114 uint16 uint16_val; | 110 uint16 uint16_val; |
| 115 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); | 111 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); |
| 116 } | 112 } |
| 117 | 113 |
| 118 TEST(SpdyFrameReaderTest, ReadUInt32WithBufferTooSmall) { | 114 TEST(SpdyFrameReaderTest, ReadUInt32WithBufferTooSmall) { |
| 119 // Frame data in network byte order. | 115 // Frame data in network byte order. |
| 120 const char kFrameData[] = { | 116 const char kFrameData[] = { |
| 121 0x00, 0x00, 0x00, // part of a uint32 | 117 0x00, 0x00, 0x00, // part of a uint32 |
| 122 }; | 118 }; |
| 123 | 119 |
| 124 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 120 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 125 EXPECT_FALSE(frame_reader.IsDoneReading()); | 121 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 126 | 122 |
| 127 uint32 uint32_val; | 123 uint32 uint32_val; |
| 128 EXPECT_FALSE(frame_reader.ReadUInt32(&uint32_val)); | 124 EXPECT_FALSE(frame_reader.ReadUInt32(&uint32_val)); |
| 129 | 125 |
| 130 // Also make sure that trying to read a uint16, which technically could work, | 126 // Also make sure that trying to read a uint16, which technically could work, |
| 131 // fails immediately due to previously encountered failed read. | 127 // fails immediately due to previously encountered failed read. |
| 132 uint16 uint16_val; | 128 uint16 uint16_val; |
| 133 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); | 129 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); |
| 134 } | 130 } |
| 135 | 131 |
| 136 // Tests ReadStringPiece16() with a buffer too small to fit the entire string. | 132 // Tests ReadStringPiece16() with a buffer too small to fit the entire string. |
| 137 TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferTooSmall) { | 133 TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferTooSmall) { |
| 138 // Frame data in network byte order. | 134 // Frame data in network byte order. |
| 139 const char kFrameData[] = { | 135 const char kFrameData[] = { |
| 140 0x00, 0x03, // uint16(3) | 136 0x00, 0x03, // uint16(3) |
| 141 0x48, 0x69, // "Hi" | 137 0x48, 0x69, // "Hi" |
| 142 }; | 138 }; |
| 143 | 139 |
| 144 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 140 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 145 EXPECT_FALSE(frame_reader.IsDoneReading()); | 141 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 146 | 142 |
| 147 base::StringPiece stringpiece_val; | 143 base::StringPiece stringpiece_val; |
| 148 EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val)); | 144 EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val)); |
| 149 | 145 |
| 150 // Also make sure that trying to read a uint16, which technically could work, | 146 // Also make sure that trying to read a uint16, which technically could work, |
| 151 // fails immediately due to previously encountered failed read. | 147 // fails immediately due to previously encountered failed read. |
| 152 uint16 uint16_val; | 148 uint16 uint16_val; |
| 153 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); | 149 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); |
| 154 } | 150 } |
| 155 | 151 |
| 156 // Tests ReadStringPiece16() with a buffer too small even to fit the length. | 152 // Tests ReadStringPiece16() with a buffer too small even to fit the length. |
| 157 TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferWayTooSmall) { | 153 TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferWayTooSmall) { |
| 158 // Frame data in network byte order. | 154 // Frame data in network byte order. |
| 159 const char kFrameData[] = { | 155 const char kFrameData[] = { |
| 160 0x00, // part of a uint16 | 156 0x00, // part of a uint16 |
| 161 }; | 157 }; |
| 162 | 158 |
| 163 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 159 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 164 EXPECT_FALSE(frame_reader.IsDoneReading()); | 160 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 165 | 161 |
| 166 base::StringPiece stringpiece_val; | 162 base::StringPiece stringpiece_val; |
| 167 EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val)); | 163 EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val)); |
| 168 | 164 |
| 169 // Also make sure that trying to read a uint16, which technically could work, | 165 // Also make sure that trying to read a uint16, which technically could work, |
| 170 // fails immediately due to previously encountered failed read. | 166 // fails immediately due to previously encountered failed read. |
| 171 uint16 uint16_val; | 167 uint16 uint16_val; |
| 172 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); | 168 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); |
| 173 } | 169 } |
| 174 | 170 |
| 175 // Tests ReadStringPiece32() with a buffer too small to fit the entire string. | 171 // Tests ReadStringPiece32() with a buffer too small to fit the entire string. |
| 176 TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferTooSmall) { | 172 TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferTooSmall) { |
| 177 // Frame data in network byte order. | 173 // Frame data in network byte order. |
| 178 const char kFrameData[] = { | 174 const char kFrameData[] = { |
| 179 0x00, 0x00, 0x00, 0x03, // uint32(3) | 175 0x00, 0x00, 0x00, 0x03, // uint32(3) |
| 180 0x48, 0x69, // "Hi" | 176 0x48, 0x69, // "Hi" |
| 181 }; | 177 }; |
| 182 | 178 |
| 183 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 179 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 184 EXPECT_FALSE(frame_reader.IsDoneReading()); | 180 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 185 | 181 |
| 186 base::StringPiece stringpiece_val; | 182 base::StringPiece stringpiece_val; |
| 187 EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val)); | 183 EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val)); |
| 188 | 184 |
| 189 // Also make sure that trying to read a uint16, which technically could work, | 185 // Also make sure that trying to read a uint16, which technically could work, |
| 190 // fails immediately due to previously encountered failed read. | 186 // fails immediately due to previously encountered failed read. |
| 191 uint16 uint16_val; | 187 uint16 uint16_val; |
| 192 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); | 188 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); |
| 193 } | 189 } |
| 194 | 190 |
| 195 // Tests ReadStringPiece32() with a buffer too small even to fit the length. | 191 // Tests ReadStringPiece32() with a buffer too small even to fit the length. |
| 196 TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferWayTooSmall) { | 192 TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferWayTooSmall) { |
| 197 // Frame data in network byte order. | 193 // Frame data in network byte order. |
| 198 const char kFrameData[] = { | 194 const char kFrameData[] = { |
| 199 0x00, 0x00, 0x00, // part of a uint32 | 195 0x00, 0x00, 0x00, // part of a uint32 |
| 200 }; | 196 }; |
| 201 | 197 |
| 202 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 198 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 203 EXPECT_FALSE(frame_reader.IsDoneReading()); | 199 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 204 | 200 |
| 205 base::StringPiece stringpiece_val; | 201 base::StringPiece stringpiece_val; |
| 206 EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val)); | 202 EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val)); |
| 207 | 203 |
| 208 // Also make sure that trying to read a uint16, which technically could work, | 204 // Also make sure that trying to read a uint16, which technically could work, |
| 209 // fails immediately due to previously encountered failed read. | 205 // fails immediately due to previously encountered failed read. |
| 210 uint16 uint16_val; | 206 uint16 uint16_val; |
| 211 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); | 207 EXPECT_FALSE(frame_reader.ReadUInt16(&uint16_val)); |
| 212 } | 208 } |
| 213 | 209 |
| 214 TEST(SpdyFrameReaderTest, ReadBytes) { | 210 TEST(SpdyFrameReaderTest, ReadBytes) { |
| 215 // Frame data in network byte order. | 211 // Frame data in network byte order. |
| 216 const char kFrameData[] = { | 212 const char kFrameData[] = { |
| 217 0x66, 0x6f, 0x6f, // "foo" | 213 0x66, 0x6f, 0x6f, // "foo" |
| 218 0x48, 0x69, // "Hi" | 214 0x48, 0x69, // "Hi" |
| 219 }; | 215 }; |
| 220 | 216 |
| 221 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 217 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 222 EXPECT_FALSE(frame_reader.IsDoneReading()); | 218 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 223 | 219 |
| 224 char dest1[3] = {}; | 220 char dest1[3] = {}; |
| 225 EXPECT_TRUE(frame_reader.ReadBytes(&dest1, arraysize(dest1))); | 221 EXPECT_TRUE(frame_reader.ReadBytes(&dest1, arraysize(dest1))); |
| 226 EXPECT_FALSE(frame_reader.IsDoneReading()); | 222 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 227 EXPECT_EQ("foo", base::StringPiece(dest1, arraysize(dest1))); | 223 EXPECT_EQ("foo", base::StringPiece(dest1, arraysize(dest1))); |
| 228 | 224 |
| 229 char dest2[2] = {}; | 225 char dest2[2] = {}; |
| 230 EXPECT_TRUE(frame_reader.ReadBytes(&dest2, arraysize(dest2))); | 226 EXPECT_TRUE(frame_reader.ReadBytes(&dest2, arraysize(dest2))); |
| 231 EXPECT_TRUE(frame_reader.IsDoneReading()); | 227 EXPECT_TRUE(frame_reader.IsDoneReading()); |
| 232 EXPECT_EQ("Hi", base::StringPiece(dest2, arraysize(dest2))); | 228 EXPECT_EQ("Hi", base::StringPiece(dest2, arraysize(dest2))); |
| 233 } | 229 } |
| 234 | 230 |
| 235 TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) { | 231 TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) { |
| 236 // Frame data in network byte order. | 232 // Frame data in network byte order. |
| 237 const char kFrameData[] = { | 233 const char kFrameData[] = { |
| 238 0x01, | 234 0x01, |
| 239 }; | 235 }; |
| 240 | 236 |
| 241 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); | 237 SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData)); |
| 242 EXPECT_FALSE(frame_reader.IsDoneReading()); | 238 EXPECT_FALSE(frame_reader.IsDoneReading()); |
| 243 | 239 |
| 244 char dest[arraysize(kFrameData) + 2] = {}; | 240 char dest[arraysize(kFrameData) + 2] = {}; |
| 245 EXPECT_FALSE(frame_reader.ReadBytes(&dest, arraysize(kFrameData) + 1)); | 241 EXPECT_FALSE(frame_reader.ReadBytes(&dest, arraysize(kFrameData) + 1)); |
| 246 EXPECT_STREQ("", dest); | 242 EXPECT_STREQ("", dest); |
| 247 } | 243 } |
| 248 | 244 |
| 249 } // namespace net | 245 } // namespace net |
| OLD | NEW |