src/third_party/protobuf/src/google/protobuf/io/zero_copy_stream_unittest.cc
void IoTest::ReadStuffLarge(ZeroCopyInputStream* input) {
  ReadString(input, "Hello world!\nSome text.  ");
  EXPECT_TRUE(input->Skip(5));
  ReadString(input, "blah.");
  EXPECT_TRUE(input->Skip(100000 - 10));
  ReadString(input, std::string(10, 'x') + std::string(100000 - 20000, 'y'));
  EXPECT_TRUE(input->Skip(20000 - 10));
  ReadString(input, "yyyyyyyyyy01234567890123456789");

  EXPECT_EQ(input->ByteCount(), 200055);

  uint8 byte;
  EXPECT_EQ(ReadFromInput(input, &byte, 1), 0);
}
// Reads text from an input stream and expects it to match what WriteStuff()
// writes.
Reads text from an input stream and expects it to match what WriteStuff()
writes.
Reads text from an input stream and expects it to match what WriteStuff () writes .
void IoTest::ReadStuffLarge(ZeroCopyInputStream* input) {
  ReadString(input, "Hello world!\nSome text.  ");
  EXPECT_TRUE(input->Skip(5));
  ReadString(input, "blah.");
  EXPECT_TRUE(input->Skip(100000 - 10));
  ReadString(input, std::string(10, 'x') + std::string(100000 - 20000, 'y'));
  EXPECT_TRUE(input->Skip(20000 - 10));
  ReadString(input, "yyyyyyyyyy01234567890123456789");
  EXPECT_EQ(input->ByteCount(), 200055);
  uint8 byte;
  EXPECT_EQ(ReadFromInput(input, &byte, 1), 0);
}
void IoTest :: ReadStuffLarge ( ZeroCopyInputStream * input ) { ReadString ( input , " \n " ) ; EXPECT_TRUE ( input -> Skip ( 5 ) ) ; ReadString ( input , " " ) ; EXPECT_TRUE ( input -> Skip ( 100000 - 10 ) ) ; ReadString ( input , std :: string ( 10 , ' ' ) + std :: string ( 100000 - 20000 , ' ' ) ) ; EXPECT_TRUE ( input -> Skip ( 20000 - 10 ) ) ; ReadString ( input , " " ) ; EXPECT_EQ ( input -> ByteCount ( ) , 200055 ) ; uint8 byte ; EXPECT_EQ ( ReadFromInput ( input , & byte , 1 ) , 0 ) ; }
Reads text from an input stream and expects it to match what WriteStuff()
writes.
Reads text from an input stream and expects it to match what WriteStuff () writes .