Changeset 6010b54 for test


Ignore:
Timestamp:
07/02/13 14:41:26 (7 years ago)
Author:
Shane Alcock <salcock@…>
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:
ef5a9ab
Parents:
da46c9d
Message:
  • Added timestamp integrity check to the convert test
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-convert.c

    rafaf6e8 r6010b54  
    111111}
    112112
     113static int time_changed(libtrace_packet_t *packet,
     114                libtrace_packet_t *packet2) {
     115
     116        struct timeval tv1, tv2;
     117
     118        tv1 = trace_get_timeval(packet);
     119        tv2 = trace_get_timeval(packet2);
     120
     121        if (tv1.tv_sec != tv2.tv_sec)
     122                return 1;
     123        if (tv1.tv_usec != tv1.tv_usec)
     124                return 1;
     125        return 0;
     126
     127}
    113128
    114129static int length_changed(libtrace_packet_t *packet,
     
    244259                        abort();
    245260                }
     261               
     262                if (time_changed(packet, packet2)) {
     263                        printf("Timestamps differ: %.6f vs %.6f\n",
     264                                trace_get_seconds(packet),
     265                                trace_get_seconds(packet2));
     266                }
    246267       
    247268                if (trace_get_tcp(packet)) {
Note: See TracChangeset for help on using the changeset viewer.