summaryrefslogtreecommitdiff
path: root/brotli_compressor_unittest.cc
AgeCommit message (Collapse)Author
2018-03-12Fix -Wzero-length-array warning in unittest code.Alex Deymo
This warns about empty array being an extension under certain compiler settings. Bug: None Test: Unittests still work. Change-Id: I11e703f840bc1119087a4c3fe15a285d2687e2e9
2018-02-14Add missing newline at end of file.Alex Deymo
Bug: None Test: Still builds. Change-Id: I26f9a3155315c3b7fb8104dc708df312a5860731
2018-01-18Add an argument parser in bsdiffTianjie Xu
Add a parser of format, type and quality in the bsdiff main function. This allow the bsdiff binary to choose between the BSDFF40|BSDF2 patch format and compress the patch with desired algorithms. Bug: 34220646 Test: unittest pass; generate brotli compressed patches with bsdiff binary Change-Id: Ia4f7941e4eca7e6047e2749315127d1cf4a988ee
2017-11-17Fix the bspatch failure on an empty brotli streamTianjie Xu
When we close the BrotliDecompressor, we check for BrotliDecoderIsFinished(). This function may return false if we never call BrotliDecoderDecompressStream(), leading to a failure in bspatch in case of an empty brotli stream. This CL fixes the issue by checking BrotliDecoderIsUsed() along with IsFinished(). Since we have the compressed stream and the precomputed uncompressed size in the patch; we need these checks to avoid unexpected size mismatch. Bug: 69472150 Test: unittest pass Change-Id: Icf7b324836fa59fd3111ba91b03622215a0c8f5f
2017-11-14Add a brotli decompressor in bsdiffTianjie Xu
This CL implements the brotli decompressor used in PatchReader. Also extract the CompressorType and patch's MagicHeader to a common header file. Bug: 34220646 Test: Run bsdiff/bspatch with brotli compressor/decompressor over a list of files from angler's system image. Change-Id: I76e11168075c6481490ffbc025ec4ca81e828732
2017-10-31Add the brotli compressor for bsdiffTianjie Xu
Add a new compressor interface; and the brotli compressor which is similar to the existing bz2 one. Also add a new CompressorType argument to PatchWriter's init function; this allows us to choose the right compressor based on the input option in the future. Bug: 34220646 Test: Run bsdiff/bspatch with brotli compressor/decompressor over a list of files from angler's system image. Make succeeds. Change-Id: Id9a3db2d7d051dcb751a1fc362f4c3b9226e878b