Ignore:
Timestamp:
02/27/06 16:41:12 (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:
d8f02df
Parents:
d5879cc
Message:

Update tests to cover newer libtrace api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-rtclient.c

    r208f694 r8a8e54b  
    4949#include "libtrace.h"
    5050
     51void iferr(libtrace_t *trace)
     52{
     53        libtrace_err_t err = trace_get_err(trace);
     54        if (err.err_num==0)
     55                return;
     56        printf("Error: %s\n",err.problem);
     57        exit(1);
     58}
    5159
    5260int main(int argc, char *argv[]) {
     
    6068
    6169        trace = trace_create(uri);
    62         if (!trace) {
    63                 printf("Error: %s\n",trace_err.problem);
    64                 return 1;
    65         }
     70        iferr(trace);
    6671
    6772        level=0;
    6873
    6974        trace_start(trace);
     75        iferr(trace);
    7076       
    7177        packet=trace_create_packet();
     
    9298                }
    9399        } else {
    94                 printf("failure: %s\n",trace_err.problem);
     100                iferr(trace);
    95101        }
    96102        trace_destroy(trace);
Note: See TracChangeset for help on using the changeset viewer.