Changeset 5b91b48 for test/test2.c


Ignore:
Timestamp:
02/20/06 18:36:31 (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:
1b4901a
Parents:
0a6638f
Message:

Added more test cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test2.c

    r7068467 r5b91b48  
    5656        int error = 0;
    5757        int count = 0;
    58         struct libtrace_packet_t packet;
     58        libtrace_packet_t *packet;
    5959
    6060        trace = trace_create(uri);
     
    6363       
    6464        for (;;) {
    65                 if ((psize = trace_read_packet(trace, &packet)) <0) {
     65                packet=trace_create_packet();
     66                if ((psize = trace_read_packet(trace, packet)) <0) {
    6667                        error = 1;
    6768                        break;
     
    7273                }
    7374                count ++;
     75                trace_destroy_packet(&packet);
    7476        }
    7577        if (error == 0) {
     
    8183                }
    8284        } else {
    83                 printf("failure: Error while reading trace\n");
    84                 trace_perror("trace_read_packet");
     85                printf("failure: %s\n",trace_err.problem);
    8586        }
    8687        trace_destroy(trace);
Note: See TracChangeset for help on using the changeset viewer.