Changeset 8decff7 for test/test-live.c


Ignore:
Timestamp:
09/16/15 13:19:13 (6 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
1101175
Parents:
5478d3d
Message:

Update all parallel tests so they compile and run

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-live.c

    r116f970 r8decff7  
    150150{
    151151        int err = 0;
     152        libtrace_stat_t *stat;
     153
     154        stat = trace_create_statistics();
     155
     156        trace_get_statistics(trace_read, stat);
    152157        // Assume no loss here, if not the case we would of hung in reading loop
    153158        // anyway
    154         if (trace_get_dropped_packets(trace_read) != 0) {
    155                 if (trace_get_dropped_packets(trace_read) == UINT64_MAX) {
    156                         printf("\tInfo: trace does not support drop counter\n");
    157                 } else {
    158                         ERROR("Trace dropped %zu packets\n",
    159                                 trace_get_dropped_packets(trace_read));
    160                 }
    161         }
    162         if (trace_get_filtered_packets(trace_read) != 0) {
    163                 if (trace_get_filtered_packets(trace_read) == UINT64_MAX) {
    164                         printf("\tInfo: trace does not support filter counter\n");
    165                 } else {
    166                         ERROR("Trace dropped %zu packets\n",
    167                                 trace_get_filtered_packets(trace_read));
    168                 }
    169         }
    170         if (trace_get_received_packets(trace_read) != 100) {
    171                 if (trace_get_received_packets(trace_read) == UINT64_MAX) {
    172                         printf("\tInfo: trace does not support received counter\n");
    173                 } else {
    174                         ERROR("Trace received %zu packets\n",
    175                                 trace_get_received_packets(trace_read));
    176                 }
    177         }
    178         if (trace_get_accepted_packets(trace_read) != (size_t) test_size) {
    179                 // This would more likely be a libtrace issue rather than format specific
    180                 ERROR("Trace only accepted %zu packets\n",
    181                         trace_get_accepted_packets(trace_read));
    182         }
     159        if (!stat->dropped_valid) {
     160                printf("\tInfo: trace does not support drop counter\n");
     161        } else if (stat->dropped != 0) {
     162                ERROR("Trace dropped %zu packets\n", stat->dropped);
     163        }
     164
     165        if (!stat->filtered_valid) {
     166                printf("\tInfo: trace does not support filter counter\n");
     167        } else if (stat->filtered != 0) {
     168                ERROR("Trace filtered %zu packets\n", stat->filtered);
     169        }
     170
     171        if (!stat->received_valid) {
     172                printf("\tInfo: trace does not support received counter\n");
     173        } else if (stat->received != 100) {
     174                ERROR("Trace received %zu/100 packets\n", stat->received);
     175        }
     176
     177        if (!stat->accepted_valid) {
     178                printf("\tInfo: trace does not support accepted counter\n");
     179        } else if (stat->accepted != (uint32_t) test_size) {
     180                ERROR("Trace only accepted %zu/%u packets\n", stat->accepted,
     181                                (uint32_t)test_size);
     182        }
     183
    183184        return err;
    184185}
Note: See TracChangeset for help on using the changeset viewer.