src/net/third_party/quiche/src/quic/test_tools/quic_test_utils_test.cc
// Ensure that the output of SimpleRandom does not depend on the size of the
// read calls.
Ensure that the output of SimpleRandom does not depend on the size of the
read calls.
Ensure that the output of SimpleRandom does not depend on the size of the read calls .
TEST_F(QuicTestUtilsTest, SimpleRandomChunks) {
  SimpleRandom rng;
  std::string reference(16 * 1024, '\0');
  rng.RandBytes(&reference[0], reference.size());
  for (size_t chunk_size : {3, 4, 7, 4096}) {
    rng.set_seed(0);
    size_t chunks = reference.size() / chunk_size;
    std::string buffer(chunks * chunk_size, '\0');
    for (size_t i = 0; i < chunks; i++) {
      rng.RandBytes(&buffer[i * chunk_size], chunk_size);
    }
    EXPECT_EQ(reference.substr(0, buffer.size()), buffer)
        << "Failed for chunk_size = " << chunk_size;
  }
}
TEST_F ( QuicTestUtilsTest , SimpleRandomChunks ) { SimpleRandom rng ; std :: string reference ( 16 * 1024 , ' \0 ' ) ; rng . RandBytes ( & reference [ 0 ] , reference . size ( ) ) ; for ( size_t chunk_size : { 3 , 4 , 7 , 4096 } ) { rng . set_seed ( 0 ) ; size_t chunks = reference . size ( ) / chunk_size ; std :: string buffer ( chunks * chunk_size , ' \0 ' ) ; for ( size_t i = 0 ; i < chunks ; i ++ ) { rng . RandBytes ( & buffer [ i * chunk_size ] , chunk_size ) ; } EXPECT_EQ ( reference . substr ( 0 , buffer . size ( ) ) , buffer ) << " " << chunk_size ; } }
Ensure that the output of SimpleRandom does not depend on the size of the
read calls.
Ensure that the output of SimpleRandom does not depend on the size of the read calls .