Changeset 4247
- Timestamp:
- Jan 13, 2010, 12:53:24 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/test/check-utils
r4246 r4247 2 2 3 3 . "$(dirname "$0")/functions.inc" 4 5 HAVE_GETLINE=$("$ZZCAT" -l | grep -q '^ getline(' && echo "y") 6 HAVE_GETDELIM=$("$ZZCAT" -l | grep -q '^ getdelim(' && echo "y") 7 HAVE_GETC_UNLOCKED=$("$ZZCAT" -l | grep -q '^ getc_unlocked(' && echo "y") 8 HAVE_FGETC_UNLOCKED=$("$ZZCAT" -l | grep -q '^ fgetc_unlocked(' && echo "y") 4 9 5 10 checkutils() … … 57 62 check "$ZZOPTS" "$ZZCAT -x \"fread(1,33000) fseek(1,SEEK_SET) fread(1,1) fseek(4093,SEEK_CUR) fread(1,1) fseek(1,SEEK_CUR) fread(1,1)\" $file" \ 58 63 "eglibc (2.9-21) bug regression" 59 check "$ZZOPTS" "$ZZCAT -x \"repeat(33000,getc_unlocked() ungetc() getline() feof(10))\" $file" \ 60 "sed getc_unlocked() bug regression" 64 if [ "$HAVE_GET_UNLOCKED $HAVE_GETLINE" = "y y" ]; then 65 check "$ZZOPTS" "$ZZCAT -x \"repeat(33000,getc_unlocked() ungetc() getline() feof(10))\" $file" \ 66 "sed getc_unlocked() bug regression" 67 fi 61 68 # Misc tests 62 69 for n in \ … … 65 72 "repeat(1000,fread(1,33))" \ 66 73 "getc() fread(1,33000)" \ 67 "getc_unlocked() fread(1,33000)" \68 74 "fgetc() fread(1,33000)" \ 69 "fgetc_unlocked() fread(1,33000)" \70 75 "getc() ungetc() fread(1,33000)" \ 71 "getc_unlocked() ungetc() fread(1,33000)" \72 76 "fgetc() ungetc() fread(1,33000)" \ 73 "fgetc_unlocked() ungetc() fread(1,33000)" \74 77 "repeat(33000,getc(),feof(10))" \ 75 "repeat(33000,getc_unlocked(),feof(10))" \76 78 "repeat(33000,fgetc(),feof(10))" \ 77 "repeat(33000,fgetc_unlocked(),feof(10))" \78 79 "repeat(8000,getc()) fread(1,33000)" \ 79 "repeat(8000,getc_unlocked()) fread(1,33000)" \80 80 "repeat(8000,fgetc()) fread(1,33000)" \ 81 "repeat(8000,fgetc_unlocked()) fread(1,33000)" \82 "repeat(10,getline()) fread(1,33000)" \83 "repeat(10,getdelim(0)) fread(1,33000)" \84 "repeat(10,getdelim(' ')) fread(1,33000)" \85 81 "fread(1,100) fseek(50,SEEK_SET) fread(1,33000)" \ 86 82 "fread(1,100) rewind() fseek(50,SEEK_CUR) fread(1,33000)" \ … … 89 85 "fread(1,33000) rewind() repeat(10000,fseek(3,SEEK_CUR) fread(1,3))" \ 90 86 "fread(1,33000) rewind() repeat(10000,fseek(4,SEEK_CUR) fread(1,4))" \ 91 "repeat(33000,getc() ungetc() getline() feof(10))" \92 "repeat(33000,fgetc() ungetc() getline() feof(10))" \93 87 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,fread(1,2),feof(10))" \ 94 88 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,getc(),feof(10))" \ 95 89 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,fgetc(),feof(10))" \ 96 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,getc_unlocked(),feof(10))" \97 90 ; do 98 91 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" 99 92 done 93 # Platform-specific tests 94 if [ "$HAVE_GETLINE" = "y" ]; then 95 for n in \ 96 "repeat(10,getline()) fread(1,33000)" \ 97 "repeat(33000,getc() ungetc() getline() feof(10))" \ 98 "repeat(33000,fgetc() ungetc() getline() feof(10))" \ 99 ; do 100 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" 101 done 102 fi 103 if [ "$HAVE_GETDELIM" = "y" ]; then 104 for n in \ 105 "repeat(10,getdelim(0)) fread(1,33000)" \ 106 "repeat(10,getdelim(' ')) fread(1,33000)" \ 107 ; do 108 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" 109 done 110 fi 111 if [ "$HAVE_GETC_UNLOCKED" = "y" ]; then 112 for n in \ 113 "getc_unlocked() fread(1,33000)" \ 114 "getc_unlocked() ungetc() fread(1,33000)" \ 115 "repeat(33000,getc_unlocked(),feof(10))" \ 116 "repeat(8000,getc_unlocked()) fread(1,33000)" \ 117 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,getc_unlocked(),feof(10))" \ 118 ; do 119 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" 120 done 121 fi 122 if [ "$HAVE_FGETC_UNLOCKED" = "y" ]; then 123 for n in \ 124 "fgetc_unlocked() fread(1,33000)" \ 125 "fgetc_unlocked() ungetc() fread(1,33000)" \ 126 "repeat(33000,fgetc_unlocked(),feof(10))" \ 127 "repeat(8000,fgetc_unlocked()) fread(1,33000)" \ 128 ; do 129 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" 130 done 131 fi 100 132 done 101 133 }
Note: See TracChangeset
for help on using the changeset viewer.