From dfef2d080b293485654a0392b14cafbbeb697c5e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 2 Nov 2010 20:36:30 -0700 Subject: [PATCH] sys-file: Make test writing compressed system file more portable. The format of "od" output varies among platforms, so avoid using it. Reported by Jeremy Lavergne on Darwin 10.4.0. --- tests/data/sys-file.at | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/data/sys-file.at b/tests/data/sys-file.at index 721578e6a0..5bd505c1ff 100644 --- a/tests/data/sys-file.at +++ b/tests/data/sys-file.at @@ -55,14 +55,13 @@ GET FILE='com.sav'. LIST. ]) AT_CHECK([pspp -o pspp.csv sysfile.sps]) -dnl Make sure file really was compressd. -AT_CHECK([dd if=com.sav bs=1 skip=72 count=4 2> /dev/null | od | sed '1q' > com.txt]) -dnl Allow big- or little-endian format. +dnl Make sure file really was compressd, allowing big- or little-endian format. +AT_CHECK([dd if=com.sav bs=1 skip=72 count=4 2> /dev/null > com.sav.subset]) +od com.sav.subset AT_CHECK( - [(echo '0000000 000000 000001' | diff com.txt -) || - (echo '0000000 000001 000000' | diff com.txt -)], [0], + [(printf '\000\000\000\001' | cmp -l com.sav.subset -) || + (printf '\001\000\000\000' | cmp -l com.sav.subset -)], [0], [ignore]) -AT_CAPTURE_FILE([com.txt]) AT_CLEANUP AT_SETUP([overwriting system file]) -- 2.30.2