Changeset 1f0fd98


Ignore:
Timestamp:
04/23/10 14:12:51 (11 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:
2f062d8
Parents:
a89e2fa
Message:

Be clearer with what failed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-format.c

    r1b9272f r1f0fd98  
    4949#include "libtrace.h"
    5050
    51 void iferr(libtrace_t *trace)
     51void iferr(libtrace_t *trace,const char *msg)
    5252{
    5353        libtrace_err_t err = trace_get_err(trace);
    5454        if (err.err_num==0)
    5555                return;
    56         printf("Error: %s\n",err.problem);
     56        printf("Error: %s: %s\n", msg, err.problem);
    5757        exit(1);
    5858}
     
    9090        int level = 0;
    9191        int expected = 100;
     92        const char *tracename;
    9293        libtrace_t *trace;
    9394        libtrace_packet_t *packet;
     
    9899        }
    99100
    100         trace = trace_create(lookup_uri(argv[1]));
    101         iferr(trace);
     101        tracename = lookup_uri(argv[1]);
     102
     103        trace = trace_create(tracename);
     104        iferr(trace,tracename);
    102105
    103106        if (strcmp(argv[1],"rtclient")==0) expected=101;
     
    106109
    107110        trace_start(trace);
    108         iferr(trace);
     111        iferr(trace,tracename);
    109112       
    110113        packet=trace_create_packet();
     
    112115                if ((psize = trace_read_packet(trace, packet)) <0) {
    113116                        error = 1;
    114                         iferr(trace);
     117                        iferr(trace,tracename);
    115118                        break;
    116119                }
     
    135138                }
    136139        } else {
    137                 iferr(trace);
     140                iferr(trace,tracename);
    138141        }
    139142        trace_destroy(trace);
Note: See TracChangeset for help on using the changeset viewer.