aboutsummaryrefslogtreecommitdiff
path: root/csv-test.c
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2020-06-19 10:28:02 +0200
committerThomas Schmucker <ts@its1.de>2020-06-19 10:28:02 +0200
commit878793e5f1952a7e208689264bade2c1a5e0a29d (patch)
treed3a05142abd099cd24e242ea302b27f5bac4c438 /csv-test.c
parentf2d0abef408790c1c46d8c51951e3092c9e1edde (diff)
downloadlibcsv-878793e5f1952a7e208689264bade2c1a5e0a29d.tar.gz
libcsv-878793e5f1952a7e208689264bade2c1a5e0a29d.tar.bz2
libcsv-878793e5f1952a7e208689264bade2c1a5e0a29d.zip
Beispiel für einen normalen Ablauf ohne Exceptions hinzugefügt.
Diffstat (limited to 'csv-test.c')
-rw-r--r--csv-test.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/csv-test.c b/csv-test.c
index a22b724..30b5521 100644
--- a/csv-test.c
+++ b/csv-test.c
@@ -7,6 +7,21 @@
7#include "csv.h" 7#include "csv.h"
8 8
9static int 9static int
10test(FILE *f)
11{
12 int line = 0;
13 csv_t csv[1];
14
15 csv_init(csv);
16 for ( int n; (n = csv_read(csv, f)) != -1; ) {
17 ++line;
18 }
19 csv_free(csv);
20
21 return line;
22}
23
24static int
10test_exception(FILE *f) 25test_exception(FILE *f)
11{ 26{
12 int line = 0; 27 int line = 0;
@@ -98,9 +113,10 @@ main(void)
98 113
99 clock_t start = clock(); 114 clock_t start = clock();
100 115
116 int lines = test(in);
101 (void) test_exception; 117 (void) test_exception;
102 (void) test_exception_with_signal; 118 (void) test_exception_with_signal;
103 int lines = test_exception_longjmp(in); 119 (void) test_exception_longjmp;
104 120
105 clock_t end = clock(); 121 clock_t end = clock();
106 122