diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1df7e2d27f..f80297f737c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -309,6 +309,24 @@ jobs: GIX_TEST_IGNORE_ARCHIVES: '1' run: cargo nextest run --workspace --no-fail-fast + test-32bit-windows-size: + runs-on: windows-latest + + env: + TARGET: i686-pc-windows-msvc + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ env.TARGET }} + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@v2 + with: + tool: nextest + - name: Test (nextest) + run: cargo nextest run --target $env:TARGET --workspace --no-fail-fast size + lint: runs-on: ubuntu-latest @@ -504,6 +522,7 @@ jobs: - test-fast - test-fixtures-windows - test-32bit + - test-32bit-windows-size - lint - cargo-deny - check-packetline diff --git a/gix-hash/tests/hash/hasher.rs b/gix-hash/tests/hash/hasher.rs index 282b7c8666f..ee73631d69c 100644 --- a/gix-hash/tests/hash/hasher.rs +++ b/gix-hash/tests/hash/hasher.rs @@ -1,12 +1,15 @@ use gix_hash::{Hasher, ObjectId}; +use gix_testtools::size_ok; #[test] fn size_of_hasher() { - assert_eq!( - std::mem::size_of::(), - if cfg!(target_arch = "x86") { 820 } else { 824 }, - "The size of this type may be relevant when hashing millions of objects,\ - and shouldn't change unnoticed. The DetectionState alone clocks in at 724 bytes." + let actual = std::mem::size_of::(); + let expected = 824; + assert!( + size_ok(actual, expected), + "The size of this type may be relevant when hashing millions of objects, and shouldn't\ + change unnoticed: {actual} <~ {expected}\ + (The DetectionState alone clocked in at 724 bytes when last examined.)" ); }