#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2021 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_STORAGE_COMPRESSION_COMPRESSORTEST_H #define NUCLEX_STORAGE_COMPRESSION_COMPRESSORTEST_H #include "Nuclex/Storage/Compression/Compressor.h" #include "Nuclex/Storage/Compression/Decompressor.h" #include // for std::vector #include // for std::uint8_t namespace Nuclex { namespace Storage { namespace Compression { // ------------------------------------------------------------------------------------------- // /// Tries to compress a longer stream of generated data /// Compressor that will be used to compress the data /// Vector into which the compressed data will be written /// Number of uncompressed bytes that will be generated /// /// The data that will be compressed is generated using a semi-random pattern that /// can be exactly reproduced be the decompression check to verify each byte. /// void checkStreamCompression( Compressor &compressor, std::vector &target, std::size_t totalByteCount ); // ------------------------------------------------------------------------------------------- // /// /// Decompresses and veriefies a longer stream created by /// the method /// /// Compressor that will be used to compress the data /// Vector into which the compressed data will be written /// Number of uncompressed bytes that should come out /// /// This not only checks whether the data decompresses cleanly and has the expected length, /// but also verifies each byte by checking it against the generated pseudo-random data. /// void checkStreamDecompression( Decompressor &decompressor, const std::vector &source, std::size_t totalByteCount ); // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Storage::Compression #endif // NUCLEX_STORAGE_COMPRESSION_COMPRESSORTEST_H