Make a proto with approximately the specified length.
| 49 | |
| 50 | // Make a proto with approximately the specified length. |
| 51 | CleanupAllRequest MakeProto(int size) { |
| 52 | int approx_size = 0; |
| 53 | CleanupAllRequest proto; |
| 54 | int index = 0; |
| 55 | while (approx_size < size) { |
| 56 | int item_size = std::min(size - approx_size, 1024); |
| 57 | proto.add_container(string(item_size, 'a' + static_cast<char>(index % 26))); |
| 58 | approx_size += item_size + 3; // +3 for encoding overhead. |
| 59 | index++; |
| 60 | } |
| 61 | return proto; |
| 62 | } |
| 63 | } // namespace |
| 64 | |
| 65 | TEST(GrpcProto, Unparse) { |
no test coverage detected