Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia committed Dec 25, 2023
1 parent 89d31b8 commit daf97b1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ random2.webp:
convert -delay 15 -size 99x87 xc: xc: xc: xc: +noise Random -define webp:lossless=false random_lossy.webp
```

## images/regression

color_index.webp:
```
convert -size 100x60 xc:skyblue -fill white -stroke black -draw "rectangle 20,10 80,50" -define webp:lossless=true color_index.webp
```

# Reference images

These files are all PNGs with contents that should exactly match the associated WebP file in the _images_ directory.
Expand All @@ -47,3 +54,10 @@ random-lossy-N.png:
```
for i in {1..4}; do webpmux -get frame ${i} ../../images/animated/random_lossy.webp -o random_lossy-${i}.png && dwebp random_lossy-${i}.png -nofancy -o random_lossy-${i}.png; done
```

## Regression

color_index.png:
```
dwebp ../../images/regression/color_index.webp -o color_index.png
```
1 change: 1 addition & 0 deletions tests/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ reftest!(gallery1, 1, 2, 3, 4, 5);
reftest!(gallery2, 1_webp_ll, 2_webp_ll, 3_webp_ll, 4_webp_ll, 5_webp_ll);
reftest!(gallery2, 1_webp_a, 2_webp_a, 3_webp_a, 4_webp_a, 5_webp_a);
reftest!(animated, random_lossless, random_lossy);
reftest!(regression, color_index);
Binary file added tests/images/regression/color_index.webp
Binary file not shown.
Binary file added tests/reference/regression/color_index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit daf97b1

Please sign in to comment.