Changeset 8f80e87 for test/test-seek.c


Ignore:
Timestamp:
03/13/06 11:00:46 (16 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
3d4fb8f
Parents:
b51edf5
Message:

Tidy up the tools and tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-seek.c

    r5b66921 r8f80e87  
    5151struct libtrace_t *trace;
    5252
     53void iferr(libtrace_t *trace)
     54{
     55        libtrace_err_t err = trace_get_err(trace);
     56        if (err.err_num==0)
     57                return;
     58        printf("Error: %s\n",err.problem);
     59        exit(1);
     60}
     61
    5362int main(int argc, char *argv[]) {
    5463        char *uri = "erf:traces/100_packets.erf";
     
    5968
    6069        trace = trace_create(uri);
     70        iferr(trace);
    6171
    6272        trace_start(trace);
     73        iferr(trace);
    6374
    64         if (trace_seek_erf_timestamp(trace,4704246759960519168ULL)==-1) {
    65                 libtrace_err_t err=trace_get_err(trace);
    66                 printf("%s\n",err.problem);
    67         }
     75        trace_seek_erf_timestamp(trace,4704246759960519168ULL);
     76        iferr(trace);
    6877       
    6978        packet=trace_create_packet();
     
    8897                }
    8998        } else {
    90                 printf("failure: %s\n",trace_get_err(trace).problem);
     99                iferr(trace);
    91100        }
    92101        trace_destroy(trace);
Note: See TracChangeset for help on using the changeset viewer.