Ignore:
Timestamp:
Oct 3, 2008, 4:49:06 AM (13 years ago)
Author:
charles
Message:

(libT) finish killing tr_errno.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode-test.c

    r6795 r6842  
    11#include <ctype.h>
     2#include <errno.h>
    23#include <stdio.h>
    34#include <string.h>
     
    4445    val = 888;
    4546    err = tr_bencParseInt( buf, buf + 3, &end, &val );
    46     check( err == TR_ERROR );
     47    check( err == EILSEQ );
    4748    check( val == 888 );
    4849    check( end == NULL );
     
    5051    /* empty buffer */
    5152    err = tr_bencParseInt( buf, buf + 0, &end, &val );
    52     check( err == TR_ERROR );
     53    check( err == EILSEQ );
    5354    check( val == 888 );
    5455    check( end == NULL );
     
    5758    tr_snprintf( (char*)buf, sizeof( buf ), "i6z4e" );
    5859    err = tr_bencParseInt( buf, buf + 5, &end, &val );
    59     check( err == TR_ERROR );
     60    check( err == EILSEQ );
    6061    check( val == 888 );
    6162    check( end == NULL );
     
    6465    tr_snprintf( (char*)buf, sizeof( buf ), "i-3e" );
    6566    err = tr_bencParseInt( buf, buf + 4, &end, &val );
    66     check( err == TR_OK );
     67    check( err == 0 );
    6768    check( val == -3 );
    6869    check( end == buf + 4 );
     
    7172    tr_snprintf( (char*)buf, sizeof( buf ), "i0e" );
    7273    err = tr_bencParseInt( buf, buf + 4, &end, &val );
    73     check( err == TR_OK );
     74    check( err == 0 );
    7475    check( val == 0 );
    7576    check( end == buf + 3 );
     
    8081    tr_snprintf( (char*)buf, sizeof( buf ), "i04e" );
    8182    err = tr_bencParseInt( buf, buf + 4, &end, &val );
    82     check( err == TR_ERROR );
     83    check( err == EILSEQ );
    8384    check( val == 0 );
    8485    check( end == NULL );
     
    99100    tr_snprintf( (char*)buf, sizeof( buf ), "4:boat" );
    100101    err = tr_bencParseStr( buf, buf + 6, &end, &str, &len );
    101     check( err == TR_OK );
     102    check( err == 0 );
    102103    check( !strncmp( (char*)str, "boat", len ) );
    103104    check( len == 4 );
     
    109110    /* string goes past end of buffer */
    110111    err = tr_bencParseStr( buf, buf + 5, &end, &str, &len );
    111     check( err == TR_ERROR );
     112    check( err == EILSEQ );
    112113    check( str == NULL );
    113114    check( end == NULL );
     
    117118    tr_snprintf( (char*)buf, sizeof( buf ), "0:" );
    118119    err = tr_bencParseStr( buf, buf + 2, &end, &str, &len );
    119     check( err == TR_OK );
     120    check( err == 0 );
    120121    check( !*str );
    121122    check( !len );
     
    128129    tr_snprintf( (char*)buf, sizeof( buf ), "3:boat" );
    129130    err = tr_bencParseStr( buf, buf + 6, &end, &str, &len );
    130     check( err == TR_OK );
     131    check( err == 0 );
    131132    check( !strncmp( (char*)str, "boa", len ) );
    132133    check( len == 3 );
Note: See TracChangeset for help on using the changeset viewer.