Commit 4cea38b
committed
Fix
Due to ABI differences between different 32-bit targets, the
`size_of_hasher` test wrongly failed on `i686-pc-windows-msvc`.
Although the test case with that name was introduced in #1915, the
failure is actually long-standing, in that an analogous faiure
occurred in the old `size_of_sha1` test that preceded it and on
which it is based. That failure only happened when the old
`fast-sha1` feature was enabled, and not with the old `rustsha1`
feature. It was not detected earlier as that target is irregularly
tested, and built with `--no-default-features --features max-pure`
more often than other targets due to difficulties building some
other non-Rust dependencies on it (when not cross-compiling).
Since #1915, the failure is easier to detect, since we now use only
one SHA-1 implementation, `sha1-checked`, so the test always fails
on `i686-pc-windows-msvc`. This is only a bug in the test itself,
not in any of the code under test.
This commit changes the test to use `gix_testtools::size_ok`, which
makes a `==` comparison on 64-bit targets but a `<=` comparison on
32-bit targets where there tends to be more variation in data
structures' sizes. This is similar to some of the size assertion
fixes in #1687 (77c3c59, fc13fc3).size_of_hasher test for 32-bit Windows1 parent cfb9bea commit 4cea38b
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
0 commit comments