- Timestamp:
- Jan 13, 2010, 12:53:56 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/test/check-utils
r4247 r4252 1 1 #!/bin/sh 2 # 3 # check-utils - check that zzuf properly fuzzes common utilities 4 # Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net> 5 # All Rights Reserved 6 # 7 # This program is free software. It comes without any warranty, to 8 # the extent permitted by applicable law. You can redistribute it 9 # and/or modify it under the terms of the Do What The Fuck You Want 10 # To Public License, Version 2, as published by Sam Hocevar. See 11 # http://sam.zoy.org/wtfpl/COPYING for more details. 12 # 2 13 3 14 . "$(dirname "$0")/functions.inc" … … 63 74 "eglibc (2.9-21) bug regression" 64 75 if [ "$HAVE_GET_UNLOCKED $HAVE_GETLINE" = "y y" ]; then 65 check "$ZZOPTS" "$ZZCAT -x \"repeat(33000,getc_unlocked() ungetc() getline() feof(10))\" $file" \76 check "$ZZOPTS" "$ZZCAT -x \"repeat(33000,getc_unlocked(),feof(10),ungetc(),getline()))\" $file" \ 66 77 "sed getc_unlocked() bug regression" 67 78 fi … … 69 80 for n in \ 70 81 "fread(1,33000)" \ 71 "repeat( 33,fread(1,1000))" \72 "repeat( 1000,fread(1,33))" \82 "repeat(-1,fread(1,1000),feof(1))" \ 83 "repeat(-1,fread(1,33),feof(1))" \ 73 84 "getc() fread(1,33000)" \ 74 85 "fgetc() fread(1,33000)" \ 75 86 "getc() ungetc() fread(1,33000)" \ 76 87 "fgetc() ungetc() fread(1,33000)" \ 77 "repeat( 33000,getc(),feof(10))" \78 "repeat( 33000,fgetc(),feof(10))" \88 "repeat(-1,getc(),feof(10))" \ 89 "repeat(-1,fgetc(),feof(10))" \ 79 90 "repeat(8000,getc()) fread(1,33000)" \ 80 91 "repeat(8000,fgetc()) fread(1,33000)" \ 81 92 "fread(1,100) fseek(50,SEEK_SET) fread(1,33000)" \ 82 93 "fread(1,100) rewind() fseek(50,SEEK_CUR) fread(1,33000)" \ 83 "fread(1,33000) rewind() repeat( 10000,fseek(1,SEEK_CUR) fread(1,1))" \84 "fread(1,33000) rewind() repeat( 10000,fseek(2,SEEK_CUR) fread(1,2))" \85 "fread(1,33000) rewind() repeat( 10000,fseek(3,SEEK_CUR) fread(1,3))" \86 "fread(1,33000) rewind() repeat( 10000,fseek(4,SEEK_CUR) fread(1,4))" \87 "fread(1,33000) fseek(1000,SEEK_CUR) repeat( 10000,fread(1,2),feof(10))" \88 "fread(1,33000) fseek(1000,SEEK_CUR) repeat( 10000,getc(),feof(10))" \89 "fread(1,33000) fseek(1000,SEEK_CUR) repeat( 10000,fgetc(),feof(10))" \94 "fread(1,33000) rewind() repeat(-1,fseek(1,SEEK_CUR),fread(1,1),feof(1))" \ 95 "fread(1,33000) rewind() repeat(-1,fseek(2,SEEK_CUR),fread(1,2),feof(1))" \ 96 "fread(1,33000) rewind() repeat(-1,fseek(3,SEEK_CUR),fread(1,3),feof(1))" \ 97 "fread(1,33000) rewind() repeat(-1,fseek(4,SEEK_CUR),fread(1,4),feof(1))" \ 98 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(-1,fread(1,2),feof(10))" \ 99 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(-1,getc(),feof(10))" \ 100 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(-1,fgetc(),feof(10))" \ 90 101 ; do 91 102 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" … … 95 106 for n in \ 96 107 "repeat(10,getline()) fread(1,33000)" \ 97 "repeat( 33000,getc() ungetc() getline() feof(10))" \98 "repeat( 33000,fgetc() ungetc() getline() feof(10))" \108 "repeat(-1,getc(),feof(10),ungetc(),getline())" \ 109 "repeat(-1,fgetc(),feof(10),ungetc(),getline())" \ 99 110 ; do 100 111 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" … … 113 124 "getc_unlocked() fread(1,33000)" \ 114 125 "getc_unlocked() ungetc() fread(1,33000)" \ 115 "repeat( 33000,getc_unlocked(),feof(10))" \126 "repeat(-1,getc_unlocked(),feof(10))" \ 116 127 "repeat(8000,getc_unlocked()) fread(1,33000)" \ 117 "fread(1,33000) fseek(1000,SEEK_CUR) repeat( 10000,getc_unlocked(),feof(10))" \128 "fread(1,33000) fseek(1000,SEEK_CUR) repeat(-1,getc_unlocked(),feof(10))" \ 118 129 ; do 119 130 check "$ZZOPTS" "$ZZCAT -x \"$n\" $file" "$n" … … 124 135 "fgetc_unlocked() fread(1,33000)" \ 125 136 "fgetc_unlocked() ungetc() fread(1,33000)" \ 126 "repeat( 33000,fgetc_unlocked(),feof(10))" \137 "repeat(-1,fgetc_unlocked(),feof(10))" \ 127 138 "repeat(8000,fgetc_unlocked()) fread(1,33000)" \ 128 139 ; do
Note: See TracChangeset
for help on using the changeset viewer.