File tree 2 files changed +27
-5
lines changed
2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,24 @@ jobs:
309
309
GIX_TEST_IGNORE_ARCHIVES : ' 1'
310
310
run : cargo nextest run --workspace --no-fail-fast
311
311
312
+ test-32bit-windows-size :
313
+ runs-on : windows-latest
314
+
315
+ env :
316
+ TARGET : i686-pc-windows-msvc
317
+
318
+ steps :
319
+ - uses : actions/checkout@v4
320
+ - uses : dtolnay/rust-toolchain@stable
321
+ with :
322
+ targets : ${{ env.TARGET }}
323
+ - uses : Swatinem/rust-cache@v2
324
+ - uses : taiki-e/install-action@v2
325
+ with :
326
+ tool : nextest
327
+ - name : Test (nextest)
328
+ run : cargo nextest run --target $env:TARGET --workspace --no-fail-fast size
329
+
312
330
lint :
313
331
runs-on : ubuntu-latest
314
332
@@ -504,6 +522,7 @@ jobs:
504
522
- test-fast
505
523
- test-fixtures-windows
506
524
- test-32bit
525
+ - test-32bit-windows-size
507
526
- lint
508
527
- cargo-deny
509
528
- check-packetline
Original file line number Diff line number Diff line change 1
1
use gix_hash:: { Hasher , ObjectId } ;
2
+ use gix_testtools:: size_ok;
2
3
3
4
#[ test]
4
5
fn size_of_hasher ( ) {
5
- assert_eq ! (
6
- std:: mem:: size_of:: <Hasher >( ) ,
7
- if cfg!( target_arch = "x86" ) { 820 } else { 824 } ,
8
- "The size of this type may be relevant when hashing millions of objects,\
9
- and shouldn't change unnoticed. The DetectionState alone clocks in at 724 bytes."
6
+ let actual = std:: mem:: size_of :: < Hasher > ( ) ;
7
+ let expected = 824 ;
8
+ assert ! (
9
+ size_ok( actual, expected) ,
10
+ "The size of this type may be relevant when hashing millions of objects, and shouldn't\
11
+ change unnoticed: {actual} <~ {expected}\
12
+ (The DetectionState alone clocked in at 724 bytes when last examined.)"
10
13
) ;
11
14
}
12
15
You can’t perform that action at this time.
0 commit comments