Changeset 62b3c4e for test/test-format-parallel-hasher.c
- Timestamp:
- 03/05/15 15:44:30 (6 years ago)
- 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:
- ab3fa18
- Parents:
- b023181
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/test-format-parallel-hasher.c
r98dc1ba r62b3c4e 101 101 static int totalpkts = 0; 102 102 static int expected; 103 static void report_result(libtrace_t *trace, libtrace_result_t *result, libtrace_message_t *mesg) { 103 static void report_result(libtrace_t *trace UNUSED, int mesg, 104 libtrace_generic_t data, 105 libtrace_thread_t *sender UNUSED) { 104 106 static int totalthreads = 0; 105 if (result) { 106 assert(libtrace_result_get_key(result) == 0); 107 printf("%d,", libtrace_result_get_value(result).sint); 107 switch (mesg) { 108 case MESSAGE_RESULT: 109 assert(libtrace_result_get_key(data.res) == 0); 110 printf("%d,", libtrace_result_get_value(data.res).sint); 108 111 totalthreads++; 109 totalpkts += libtrace_result_get_value(result).sint; 110 assert(libtrace_result_get_value(result).sint == 25 || 111 libtrace_result_get_value(result).sint == expected - 25); 112 } else { 113 switch(mesg->code) { 114 case MESSAGE_STARTING: 115 // Should have two threads here 116 assert(libtrace_get_perpkt_count(trace) == 2); 117 printf("\tLooks like %d threads are being used!\n\tcounts(", libtrace_get_perpkt_count(trace)); 118 break; 119 case MESSAGE_STOPPING: 120 printf(")\n"); 121 assert(totalthreads == libtrace_get_perpkt_count(trace)); 122 break; 123 } 112 totalpkts += libtrace_result_get_value(data.res).sint; 113 assert(libtrace_result_get_value(data.res).sint == 25 || 114 libtrace_result_get_value(data.res).sint == expected - 25); 115 break; 116 case MESSAGE_STARTING: 117 // Should have two threads here 118 assert(libtrace_get_perpkt_count(trace) == 2); 119 printf("\tLooks like %d threads are being used!\n\tcounts(", libtrace_get_perpkt_count(trace)); 120 break; 121 case MESSAGE_STOPPING: 122 printf(")\n"); 123 assert(totalthreads == libtrace_get_perpkt_count(trace)); 124 break; 124 125 } 125 126 }
Note: See TracChangeset
for help on using the changeset viewer.