diff options
Diffstat (limited to 'third_party/jpeg-xl/lib/jpegli/error_handling_test.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/jpegli/error_handling_test.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/third_party/jpeg-xl/lib/jpegli/error_handling_test.cc b/third_party/jpeg-xl/lib/jpegli/error_handling_test.cc index 0d481c572a..3eaf6a313b 100644 --- a/third_party/jpeg-xl/lib/jpegli/error_handling_test.cc +++ b/third_party/jpeg-xl/lib/jpegli/error_handling_test.cc @@ -241,9 +241,10 @@ TEST(EncoderErrorHandlingTest, InvalidQuantValue) { cinfo.image_height = 1; cinfo.input_components = 1; jpegli_set_defaults(&cinfo); - cinfo.quant_tbl_ptrs[0] = jpegli_alloc_quant_table((j_common_ptr)&cinfo); - for (size_t k = 0; k < DCTSIZE2; ++k) { - cinfo.quant_tbl_ptrs[0]->quantval[k] = 0; + cinfo.quant_tbl_ptrs[0] = + jpegli_alloc_quant_table(reinterpret_cast<j_common_ptr>(&cinfo)); + for (UINT16& q : cinfo.quant_tbl_ptrs[0]->quantval) { + q = 0; } jpegli_start_compress(&cinfo, TRUE); JSAMPLE image[1] = {0}; @@ -992,7 +993,7 @@ TEST(EncoderErrorHandlingTest, AddOnTableNoStringParam) { jpegli_destroy_compress(&cinfo); } -static const uint8_t kCompressed0[] = { +const uint8_t kCompressed0[] = { // SOI 0xff, 0xd8, // // DQT @@ -1036,12 +1037,12 @@ static const uint8_t kCompressed0[] = { // EOI 0xff, 0xd9, // }; -static const size_t kLen0 = sizeof(kCompressed0); +const size_t kLen0 = sizeof(kCompressed0); -static const size_t kDQTOffset = 2; -static const size_t kSOFOffset = 71; -static const size_t kDHTOffset = 84; -static const size_t kSOSOffset = 296; +const size_t kDQTOffset = 2; +const size_t kSOFOffset = 71; +const size_t kDHTOffset = 84; +const size_t kSOSOffset = 296; TEST(DecoderErrorHandlingTest, MinimalSuccess) { JXL_CHECK(kCompressed0[kDQTOffset] == 0xff); @@ -1130,7 +1131,7 @@ TEST(DecoderErrorHandlingTest, NoReadScanlines) { jpegli_destroy_decompress(&cinfo); } -static const size_t kMaxImageWidth = 0xffff; +const size_t kMaxImageWidth = 0xffff; JSAMPLE kOutputBuffer[MAX_COMPONENTS * kMaxImageWidth]; bool ParseCompressed(const std::vector<uint8_t>& compressed) { |