Lines Matching refs:pickle
43 void VerifyResult(const Pickle& pickle) { in VerifyResult() argument
44 PickleIterator iter(pickle); in VerifyResult()
113 Pickle pickle; in TEST() local
115 pickle.WriteBool(testbool1); in TEST()
116 pickle.WriteBool(testbool2); in TEST()
117 pickle.WriteInt(testint); in TEST()
118 pickle.WriteLong(testlong); in TEST()
119 pickle.WriteUInt16(testuint16); in TEST()
120 pickle.WriteUInt32(testuint32); in TEST()
121 pickle.WriteInt64(testint64); in TEST()
122 pickle.WriteUInt64(testuint64); in TEST()
123 pickle.WriteFloat(testfloat); in TEST()
124 pickle.WriteDouble(testdouble); in TEST()
125 pickle.WriteString(teststring); in TEST()
126 pickle.WriteString16(teststring16); in TEST()
127 pickle.WriteString(testrawstring); in TEST()
128 pickle.WriteString16(testrawstring16); in TEST()
129 pickle.WriteData(testdata, testdatalen); in TEST()
130 VerifyResult(pickle); in TEST()
133 Pickle pickle2(pickle); in TEST()
138 pickle3 = pickle; in TEST()
146 Pickle pickle; in TEST() local
149 pickle.WriteInt64(testint64); in TEST()
151 PickleIterator iter(pickle); in TEST()
170 Pickle pickle(buffer.get(), 1); in TEST() local
172 PickleIterator iter(pickle); in TEST()
181 Pickle pickle(reinterpret_cast<char*>(buffer), sizeof(buffer)); in TEST()
183 PickleIterator iter(pickle); in TEST()
191 Pickle pickle(reinterpret_cast<char*>(buffer), sizeof(buffer)); in TEST()
193 PickleIterator iter(pickle); in TEST()
199 Pickle pickle; in TEST() local
200 pickle.WriteString(std::string()); in TEST()
202 PickleIterator iter(pickle); in TEST()
209 Pickle pickle; in TEST() local
210 pickle.WriteString16(string16()); in TEST()
212 PickleIterator iter(pickle); in TEST()
219 Pickle pickle; in TEST() local
220 pickle.WriteInt(-2); in TEST()
222 PickleIterator iter(pickle); in TEST()
228 Pickle pickle; in TEST() local
229 pickle.WriteInt(-1); in TEST()
231 PickleIterator iter(pickle); in TEST()
241 Pickle pickle(sizeof(CustomHeader)); in TEST() local
243 pickle.WriteString("Goooooooooooogle"); in TEST()
245 const char* pickle_data = static_cast<const char*>(pickle.data()); in TEST()
262 EXPECT_EQ(pickle_size, pickle.size()); in TEST()
270 EXPECT_EQ(pickle_size, pickle.size()); in TEST()
276 pickle_data + pickle.size(), in TEST()
278 EXPECT_EQ(pickle_size, pickle.size()); in TEST()
319 Pickle pickle; in TEST() local
320 pickle.WriteInt(1); in TEST()
321 pickle.WriteString("Domo"); in TEST()
323 const char* start = reinterpret_cast<const char*>(pickle.data()); in TEST()
324 const char* end = start + pickle.size(); in TEST()
326 EXPECT_EQ(end, Pickle::FindNext(pickle.header_size_, start, end)); in TEST()
327 EXPECT_EQ(nullptr, Pickle::FindNext(pickle.header_size_, start, end - 1)); in TEST()
328 EXPECT_EQ(end, Pickle::FindNext(pickle.header_size_, start, end + 1)); in TEST()
374 Pickle pickle; in TEST() local
376 PickleIterator iter(pickle); in TEST()
379 pickle.WriteInt(1); in TEST()
380 pickle.WriteInt(2); in TEST()
383 EXPECT_TRUE(PickleIterator(pickle).GetReadPointerAndAdvance(0)); in TEST()
384 EXPECT_TRUE(PickleIterator(pickle).GetReadPointerAndAdvance(1)); in TEST()
385 EXPECT_FALSE(PickleIterator(pickle).GetReadPointerAndAdvance(-1)); in TEST()
386 EXPECT_TRUE(PickleIterator(pickle).GetReadPointerAndAdvance(bytes)); in TEST()
387 EXPECT_FALSE(PickleIterator(pickle).GetReadPointerAndAdvance(bytes + 1)); in TEST()
388 EXPECT_FALSE(PickleIterator(pickle).GetReadPointerAndAdvance(INT_MAX)); in TEST()
389 EXPECT_FALSE(PickleIterator(pickle).GetReadPointerAndAdvance(INT_MIN)); in TEST()
402 Pickle pickle; in TEST() local
403 pickle.WriteData( in TEST()
408 EXPECT_EQ(unit, pickle.capacity_after_header()); in TEST()
409 EXPECT_EQ(pickle.payload_size(), payload_size_after_header); in TEST()
412 pickle.WriteData(data_ptr, static_cast<int>(unit - sizeof(uint32_t))); in TEST()
414 EXPECT_EQ(unit * 2, pickle.capacity_after_header()); in TEST()
415 EXPECT_EQ(cur_payload, pickle.payload_size()); in TEST()
418 pickle.WriteData(data_ptr, 1); in TEST()
420 EXPECT_EQ(unit * 4, pickle.capacity_after_header()); in TEST()
421 EXPECT_EQ(cur_payload, pickle.payload_size()); in TEST()
435 Pickle pickle(sizeof(CustomHeader)); in TEST() local
436 pickle.WriteInt(kMagic); in TEST()
439 pickle.headerT<CustomHeader>()->blah = 10; in TEST()
441 PickleIterator iter(pickle); in TEST()
487 Pickle pickle; in TEST() local
488 pickle.WriteData(nullptr, 0); in TEST()
490 PickleIterator iter(pickle); in TEST()
500 Pickle pickle; in TEST() local
502 pickle.WriteBytes(&data, sizeof(data)); in TEST()
504 PickleIterator iter(pickle); in TEST()
516 Pickle pickle; in TEST() local
517 while (pickle.capacity_after_header() != pickle.payload_size()) in TEST()
518 pickle.WriteBool(true); in TEST()
521 Pickle pickle2(pickle); in TEST()
524 EXPECT_EQ(pickle.capacity_after_header(), pickle2.capacity_after_header()); in TEST()
542 TestingPickle pickle; in TEST() local
543 const char* bytes = static_cast<const char*>(pickle.ClaimBytes(kChunkSize)); in TEST()
553 TestingPickle pickle; in TEST() local
554 pickle.WriteUInt32(data.size()); in TEST()
555 void* bytes = pickle.ClaimBytes(data.size()); in TEST()
556 pickle.WriteInt(42); in TEST()
559 PickleIterator iter(pickle); in TEST()