Changeset 8f80e87 for test/test-time.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-time.c

    rc6a6c3a 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       
    6475        packet=trace_create_packet();
     
    8899                }
    89100        } else {
    90                 printf("failure: %s\n",trace_get_err(trace).problem);
     101                iferr(trace);
    91102        }
    92103        trace_destroy(trace);
Note: See TracChangeset for help on using the changeset viewer.