/* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "test/gtest_and_gmock.h" #include "src/trace_processor/util/gzip_utils.h" #include <zlib.h> #include <fstream> #include <iostream> #include "perfetto/base/logging.h" string; namespace perfetto { namespace trace_processor { namespace util { static std::string TrivialGzipCompress(const std::string& input) { … } // Trivially decompress using ZlibOnlineDecompress. // It's called 'trivial' because we are feeding the entire input in one shot. static std::string TrivialDecompress(const std::string& input) { … } // Decompress a large GZip file using a in-memory buffer of 4KB, and write the // decompressed output in another file. static void DecompressGzipFileInFileOut(const std::string& input_file, const std::string& output_file) { … } TEST(GzipDecompressor, Basic) { … } TEST(GzipDecompressor, Streaming) { … } static std::string ReadFile(const std::string& file_name) { … } static void WriteFile(const std::string& file_name, const std::string& content) { … } TEST(GzipDecompressor, DISABLED_FileInFileOut) { … } } // namespace util } // namespace trace_processor } // namespace perfetto