- Timestamp:
- 02/27/06 16:41:12 (15 years ago)
- 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:
- d8f02df
- Parents:
- d5879cc
- Location:
- test
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
test/test-erf-to-pcap.c
r82dc7d8 r8a8e54b 62 62 trace = trace_create(uri); 63 63 if (!trace) { 64 printf("Error: %s\n",trace_ err.problem);64 printf("Error: %s\n",trace_get_err(trace).problem); 65 65 return 1; 66 66 } 67 67 outtrace = trace_create_output("pcap:traces/100_packets.out.pcap"); 68 68 if (!outtrace) { 69 printf("Error: %s\n",trace_ err.problem);69 printf("Error: %s\n",trace_get_err(trace).problem); 70 70 return 1; 71 71 } … … 99 99 } 100 100 } else { 101 printf("failure: %s\n",trace_ err.problem);101 printf("failure: %s\n",trace_get_err(trace).problem); 102 102 } 103 103 trace_destroy(trace); -
test/test-erf-write.c
r82dc7d8 r8a8e54b 62 62 trace = trace_create(uri); 63 63 if (!trace) { 64 printf("Error: %s\n",trace_ err.problem);64 printf("Error: %s\n",trace_get_err(trace).problem); 65 65 return 1; 66 66 } 67 67 outtrace = trace_create_output("erf:traces/100_packets.out.erf"); 68 68 if (!outtrace) { 69 printf("Error: %s\n",trace_ err.problem);69 printf("Error: %s\n",trace_get_err(trace).problem); 70 70 return 1; 71 71 } … … 99 99 } 100 100 } else { 101 printf("failure: %s\n",trace_ err.problem);101 printf("failure: %s\n",trace_get_err(trace).problem); 102 102 } 103 103 trace_destroy(trace); -
test/test-event.c
r208f694 r8a8e54b 96 96 } 97 97 } else { 98 printf("failure: %s\n",trace_ err.problem);98 printf("failure: %s\n",trace_get_err(trace).problem); 99 99 } 100 100 trace_destroy(trace); -
test/test-pcap-bpf.c
r5b91b48 r8a8e54b 61 61 trace = trace_create(uri); 62 62 if (!trace) { 63 printf("ERROR: %s\n",trace_ err.problem);63 printf("ERROR: %s\n",trace_get_err(trace).problem); 64 64 return 1; 65 65 } … … 68 68 69 69 if (trace_start(trace)==-1) { 70 printf("ERROR: %s\n",trace_ err.problem);70 printf("ERROR: %s\n",trace_get_err(trace).problem); 71 71 return 1; 72 72 } … … 93 93 } 94 94 } else { 95 printf("failure: %s\n",trace_ err.problem);95 printf("failure: %s\n",trace_get_err(trace).problem); 96 96 } 97 97 trace_destroy(trace); -
test/test-pcap-to-erf.c
r82dc7d8 r8a8e54b 62 62 trace = trace_create(uri); 63 63 if (!trace) { 64 printf("Error: %s\n",trace_ err.problem);64 printf("Error: %s\n",trace_get_err(trace).problem); 65 65 return 1; 66 66 } 67 67 outtrace = trace_create_output("erf:traces/100_packets.out.erf"); 68 68 if (!outtrace) { 69 printf("Error: %s\n",trace_ err.problem);69 printf("Error: %s\n",trace_get_err_output(outtrace).problem); 70 70 return 1; 71 71 } … … 99 99 } 100 100 } else { 101 printf("failure: %s\n",trace_ err.problem);101 printf("failure: %s\n",trace_get_err(trace).problem); 102 102 } 103 103 trace_destroy(trace); -
test/test-pcap.c
r5b91b48 r8a8e54b 60 60 trace = trace_create(uri); 61 61 if (!trace) { 62 printf("ERROR: %s\n",trace_ err.problem);62 printf("ERROR: %s\n",trace_get_err(trace).problem); 63 63 return 1; 64 64 } 65 65 66 66 if (trace_start(trace)==-1) { 67 printf("ERROR: %s\n",trace_ err.problem);67 printf("ERROR: %s\n",trace_get_err(trace).problem); 68 68 return 1; 69 69 } … … 90 90 } 91 91 } else { 92 printf("failure: %s\n",trace_ err.problem);92 printf("failure: %s\n",trace_get_err(trace).problem); 93 93 } 94 94 trace_destroy(trace); -
test/test-rtclient.c
r208f694 r8a8e54b 49 49 #include "libtrace.h" 50 50 51 void iferr(libtrace_t *trace) 52 { 53 libtrace_err_t err = trace_get_err(trace); 54 if (err.err_num==0) 55 return; 56 printf("Error: %s\n",err.problem); 57 exit(1); 58 } 51 59 52 60 int main(int argc, char *argv[]) { … … 60 68 61 69 trace = trace_create(uri); 62 if (!trace) { 63 printf("Error: %s\n",trace_err.problem); 64 return 1; 65 } 70 iferr(trace); 66 71 67 72 level=0; 68 73 69 74 trace_start(trace); 75 iferr(trace); 70 76 71 77 packet=trace_create_packet(); … … 92 98 } 93 99 } else { 94 printf("failure: %s\n",trace_err.problem);100 iferr(trace); 95 101 } 96 102 trace_destroy(trace); -
test/test-wtf.c
r82dc7d8 r8a8e54b 49 49 #include "libtrace.h" 50 50 51 void iferr(libtrace_t *trace) 52 { 53 libtrace_err_t err = trace_get_err(trace); 54 if (err.err_num==0) 55 return; 56 printf("Error: %s\n",err.problem); 57 exit(1); 58 } 59 60 void iferrout(libtrace_out_t *trace) 61 { 62 libtrace_err_t err = trace_get_err_output(trace); 63 if (err.err_num==0) 64 return; 65 printf("Error: %s\n",err.problem); 66 exit(1); 67 } 51 68 52 69 int main(int argc, char *argv[]) { … … 61 78 62 79 trace = trace_create(uri); 63 if (!trace) { 64 printf("Error: %s\n",trace_err.problem); 65 return 1; 66 } 80 iferr(trace); 81 67 82 outtrace = trace_create_output("wtf:traces/wed.out.wtf"); 68 if (!outtrace) { 69 printf("Error: %s\n",trace_err.problem); 70 return 1; 71 } 83 iferrout(outtrace); 72 84 73 85 level=0; … … 75 87 76 88 trace_start(trace); 89 iferr(trace); 77 90 trace_start_output(outtrace); 91 iferrout(outtrace); 78 92 79 93 packet=trace_create_packet(); … … 89 103 count ++; 90 104 trace_write_packet(outtrace,packet); 105 iferrout(outtrace); 91 106 } 92 107 trace_destroy_packet(&packet); … … 99 114 } 100 115 } else { 101 printf("failure: %s\n",trace_err.problem); 116 iferr(trace); 117 printf("error, but no error!\n"); 102 118 } 103 119 trace_destroy(trace); -
test/test1.c
r5b91b48 r8a8e54b 68 68 return 0; 69 69 } 70 printf("failure: %s\n",trace_ err.problem);70 printf("failure: %s\n",trace_get_err(trace).problem); 71 71 return -1; 72 72 } -
test/test2.c
r82dc7d8 r8a8e54b 83 83 } 84 84 } else { 85 printf("failure: %s\n",trace_ err.problem);85 printf("failure: %s\n",trace_get_err(trace).problem); 86 86 } 87 87 trace_destroy(trace);
Note: See TracChangeset
for help on using the changeset viewer.