From: Ben Pfaff Date: Sun, 10 Oct 2010 16:49:29 +0000 (-0700) Subject: tests: Convert test of compressed system files to Autotest framework. X-Git-Tag: v0.7.6~66 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52eef93a40a3a18c594c38d4697406eba83f4321;p=pspp-builds.git tests: Convert test of compressed system files to Autotest framework. --- diff --git a/tests/automake.mk b/tests/automake.mk index a60b344b..4c2c90d4 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -28,7 +28,6 @@ dist_TESTS = \ tests/formats/wkday-out.sh \ tests/formats/360.sh \ tests/bugs/comment-at-eof.sh \ - tests/bugs/compression.sh \ tests/bugs/curtailed.sh \ tests/bugs/data-crash.sh \ tests/bugs/if_crash.sh \ diff --git a/tests/data/sys-file.at b/tests/data/sys-file.at index e82166c9..e726d535 100644 --- a/tests/data/sys-file.at +++ b/tests/data/sys-file.at @@ -37,7 +37,36 @@ variable001,variable002,variable003,variable004 ]) AT_CLEANUP +AT_SETUP([write and read compressed files]) +AT_KEYWORDS([SAVE GET system file]) +AT_DATA([sysfile.sps], [dnl +DATA LIST LIST NOTABLE /x * y (a200). +BEGIN DATA. +1.2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +. yyyyyyyyyyyyyyy +0 ddddddddddddddddddddddddddddddd +101 z +END DATA. + +SAVE OUTFILE='com.sav' /COMPRESS . + +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. +AT_CHECK( + [(echo '0000000 000000 000001' | diff com.txt -) || + (echo '0000000 000001 000000' | diff com.txt -)], [0], + [ignore]) +AT_CAPTURE_FILE([com.txt]) +AT_CLEANUP + AT_SETUP([nonempty case_map doesn't crash]) +AT_KEYWORDS([SAVE system file]) AT_DATA([save.sps], [dnl INPUT PROGRAM. COMPUTE #I = 1.