summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jpegli/encode_api_test.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jpegli/encode_api_test.cc
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jpegli/encode_api_test.cc')
-rw-r--r--third_party/jpeg-xl/lib/jpegli/encode_api_test.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/third_party/jpeg-xl/lib/jpegli/encode_api_test.cc b/third_party/jpeg-xl/lib/jpegli/encode_api_test.cc
index 8d53557567..1afdcf610d 100644
--- a/third_party/jpeg-xl/lib/jpegli/encode_api_test.cc
+++ b/third_party/jpeg-xl/lib/jpegli/encode_api_test.cc
@@ -133,12 +133,11 @@ TEST(EncodeAPITest, ReuseCinfoSameMemOutput) {
jpegli_destroy_compress(&cinfo);
}
size_t pos = 0;
- for (size_t i = 0; i < all_configs.size(); ++i) {
+ for (auto& config : all_configs) {
TestImage output;
- pos +=
- DecodeWithLibjpeg(all_configs[i].jparams, DecompressParams(), nullptr,
- 0, buffer + pos, buffer_size - pos, &output);
- VerifyOutputImage(all_configs[i].input, output, all_configs[i].max_dist);
+ pos += DecodeWithLibjpeg(config.jparams, DecompressParams(), nullptr, 0,
+ buffer + pos, buffer_size - pos, &output);
+ VerifyOutputImage(config.input, output, config.max_dist);
}
if (buffer) free(buffer);
}
@@ -164,20 +163,21 @@ TEST(EncodeAPITest, ReuseCinfoSameStdOutput) {
size_t total_size = ftell(tmpf);
rewind(tmpf);
std::vector<uint8_t> compressed(total_size);
- JXL_CHECK(total_size == fread(&compressed[0], 1, total_size, tmpf));
+ JXL_CHECK(total_size == fread(compressed.data(), 1, total_size, tmpf));
fclose(tmpf);
size_t pos = 0;
- for (size_t i = 0; i < all_configs.size(); ++i) {
+ for (auto& config : all_configs) {
TestImage output;
- pos += DecodeWithLibjpeg(all_configs[i].jparams, DecompressParams(),
- nullptr, 0, &compressed[pos],
- compressed.size() - pos, &output);
- VerifyOutputImage(all_configs[i].input, output, all_configs[i].max_dist);
+ pos +=
+ DecodeWithLibjpeg(config.jparams, DecompressParams(), nullptr, 0,
+ &compressed[pos], compressed.size() - pos, &output);
+ VerifyOutputImage(config.input, output, config.max_dist);
}
}
TEST(EncodeAPITest, ReuseCinfoChangeParams) {
- TestImage input, output;
+ TestImage input;
+ TestImage output;
CompressParams jparams;
DecompressParams dparams;
uint8_t* buffer = nullptr;