| 66 | } |
| 67 | |
| 68 | TEST_F(TestZlib, FileCompress) { |
| 69 | if (skip_test_) { |
| 70 | GTEST_SKIP() << "Skipped Test"; |
| 71 | } |
| 72 | |
| 73 | std::filebuf in; |
| 74 | in.open(kTestFile, std::ios_base::in | std::ios_base::binary); |
| 75 | EXPECT_TRUE(in.is_open()); |
| 76 | |
| 77 | std::filebuf out; |
| 78 | out.open(kDeflateFile, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); |
| 79 | EXPECT_TRUE(out.is_open()); |
| 80 | |
| 81 | EXPECT_TRUE(Deflate(in, out)); |
| 82 | |
| 83 | in.close(); |
| 84 | out.close(); |
| 85 | |
| 86 | std::filebuf in1; |
| 87 | in1.open(kDeflateFile, std::ios_base::in | std::ios_base::binary); |
| 88 | EXPECT_TRUE(in1.is_open()); |
| 89 | |
| 90 | std::filebuf out1; |
| 91 | out1.open(kInflateFile, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); |
| 92 | EXPECT_TRUE(out1.is_open()); |
| 93 | |
| 94 | EXPECT_TRUE(Inflate(in1, out1)); |
| 95 | in1.close(); |
| 96 | out1.close(); |
| 97 | } |
| 98 | |
| 99 | TEST_F(TestZlib, FileToBuffCompress) { |
| 100 | if (skip_test_) { |