Skip to content

Commit c75a623

Browse files
committed
Fix new test case to work on (some?) big-endian architectures.
Use of pack("L") gets around the basic endian problem, but it doesn't deal with the fact that the order of the bitfields within the struct may differ. This patch fixes it to work with gcc on NetBSD/macppc, but I wonder whether that will be enough --- in principle, there could be four different combinations of bitpatterns needed here. Discussion: https://postgr.es/m/1650745.1679513221@sss.pgh.pa.us
1 parent b48af6d commit c75a623

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_amcheck/t/004_verify_heapam.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ sub header
630630
die "offnum $offnum should be a redirect" if defined $tup;
631631
sysseek($file, 92, 0) or BAIL_OUT("sysseek failed: $!");
632632
syswrite($file,
633-
pack("L", $ENDIANNESS eq 'little' ? 0x00010011 : 0x11000100))
633+
pack("L", $ENDIANNESS eq 'little' ? 0x00010011 : 0x00230000))
634634
or BAIL_OUT("syswrite failed: $!");
635635
push @expected,
636636
qr/${header}redirected line pointer points to another redirected line pointer at offset \d+/;
@@ -647,7 +647,7 @@ sub header
647647
# rewrite line pointer with lp.off = 25, lp_flags = 2, lp_len = 0
648648
sysseek($file, 108, 0) or BAIL_OUT("sysseek failed: $!");
649649
syswrite($file,
650-
pack("L", $ENDIANNESS eq 'little' ? 0x00010019 : 0x19000100))
650+
pack("L", $ENDIANNESS eq 'little' ? 0x00010019 : 0x00330000))
651651
or BAIL_OUT("syswrite failed: $!");
652652
push @expected,
653653
qr/${header}redirect line pointer points to offset \d+, but offset \d+ also points there/;

0 commit comments

Comments
 (0)