Ignore:
Timestamp:
Jan 8, 2010, 1:48:33 AM (11 years ago)
Author:
Sam Hocevar
Message:

Implement feof(x) in zzcat, to break out of a loop after EOF was hit x times.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/test/check-utils

    r4233 r4240  
    5757        check "$ZZOPTS" "$ZZCAT \"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" \
    5858              "eglibc (2.9-21) bug regression"
    59         check "$ZZOPTS" "$ZZCAT \"repeat(33000,getc_unlocked() ungetc() getline())\" $file" \
     59        check "$ZZOPTS" "$ZZCAT \"repeat(33000,getc_unlocked() ungetc() getline() feof(10))\" $file" \
    6060              "sed getc_unlocked() bug regression"
    6161        # Misc tests
     
    7272          "fgetc() ungetc() fread(1,33000)" \
    7373          "fgetc_unlocked() ungetc() fread(1,33000)" \
    74           "repeat(33000,getc())" \
    75           "repeat(33000,getc_unlocked())" \
    76           "repeat(33000,fgetc())" \
    77           "repeat(33000,fgetc_unlocked())" \
     74          "repeat(33000,getc(),feof(10))" \
     75          "repeat(33000,getc_unlocked(),feof(10))" \
     76          "repeat(33000,fgetc(),feof(10))" \
     77          "repeat(33000,fgetc_unlocked(),feof(10))" \
    7878          "repeat(8000,getc()) fread(1,33000)" \
    7979          "repeat(8000,getc_unlocked()) fread(1,33000)" \
     
    8989          "fread(1,33000) rewind() repeat(10000,fseek(3,SEEK_CUR) fread(1,3))" \
    9090          "fread(1,33000) rewind() repeat(10000,fseek(4,SEEK_CUR) fread(1,4))" \
    91           "repeat(33000,getc() ungetc() getline())" \
    92           "repeat(33000,fgetc() ungetc() getline())" \
    93           "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,fread(1,2))" \
    94           "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,getc())" \
    95           "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,fgetc())" \
    96           "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,getc_unlocked())" \
     91          "repeat(33000,getc() ungetc() getline() feof(10))" \
     92          "repeat(33000,fgetc() ungetc() getline() feof(10))" \
     93          "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,fread(1,2),feof(10))" \
     94          "fread(1,33000) fseek(1000,SEEK_CUR) repeat(10000,getc(),feof(10))" \
     95          "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))" \
    9797          ; do
    9898            check "$ZZOPTS" "$ZZCAT \"$n\" $file" "$n"
Note: See TracChangeset for help on using the changeset viewer.