| 193 | } |
| 194 | |
| 195 | void WriteCompressedFile(Env* env, const string& fname, int input_buf_size, |
| 196 | int output_buf_size, |
| 197 | const CompressionOptions& output_options, |
| 198 | const string& data) { |
| 199 | std::unique_ptr<WritableFile> file_writer; |
| 200 | TF_ASSERT_OK(env->NewWritableFile(fname, &file_writer)); |
| 201 | |
| 202 | ZlibOutputBuffer out(file_writer.get(), input_buf_size, output_buf_size, |
| 203 | output_options); |
| 204 | TF_ASSERT_OK(out.Init()); |
| 205 | |
| 206 | TF_ASSERT_OK(out.Append(StringPiece(data))); |
| 207 | TF_ASSERT_OK(out.Close()); |
| 208 | TF_ASSERT_OK(file_writer->Flush()); |
| 209 | TF_ASSERT_OK(file_writer->Close()); |
| 210 | } |
| 211 | |
| 212 | void TestTell(CompressionOptions input_options, |
| 213 | CompressionOptions output_options) { |