1 // Copyright 2017 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef SRC_SAMPLE_GENERATOR_H_ 6 #define SRC_SAMPLE_GENERATOR_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "puffin/src/include/puffin/puffer.h" 12 13 namespace puffin { 14 namespace sample_generator { 15 16 void PrintArray(const std::string& name, const Buffer& array); 17 18 // Creates and prints a sample for for adding to the list of unit tests for 19 // puffer/huffer. 20 // 21 // Example: 22 // Buffer orig = {1, 2, 3, 4, 5}; 23 // Puffer puffer; 24 // sample_generator::PrintSample( 25 // &puffer, Z_DEFAULT_COMPRESSION, Z_FIXED, orig); 26 bool PrintSample(Puffer* puffer, 27 int compression, 28 int strategy, 29 const Buffer& original); 30 31 } // namespace sample_generator 32 } // namespace puffin 33 34 #endif // SRC_SAMPLE_GENERATOR_H_ 35