diff options
Diffstat (limited to 'csv-test.c')
| -rw-r--r-- | csv-test.c | 18 |
1 files changed, 17 insertions, 1 deletions
| @@ -7,6 +7,21 @@ | |||
| 7 | #include "csv.h" | 7 | #include "csv.h" |
| 8 | 8 | ||
| 9 | static int | 9 | static int |
| 10 | test(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 | |||
| 24 | static int | ||
| 10 | test_exception(FILE *f) | 25 | test_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 | ||
