From 878793e5f1952a7e208689264bade2c1a5e0a29d Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 19 Jun 2020 10:28:02 +0200 Subject: Beispiel für einen normalen Ablauf ohne Exceptions hinzugefügt. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- csv-test.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'csv-test.c') diff --git a/csv-test.c b/csv-test.c index a22b724..30b5521 100644 --- a/csv-test.c +++ b/csv-test.c @@ -6,6 +6,21 @@ #include "csv.h" +static int +test(FILE *f) +{ + int line = 0; + csv_t csv[1]; + + csv_init(csv); + for ( int n; (n = csv_read(csv, f)) != -1; ) { + ++line; + } + csv_free(csv); + + return line; +} + static int test_exception(FILE *f) { @@ -98,9 +113,10 @@ main(void) clock_t start = clock(); + int lines = test(in); (void) test_exception; (void) test_exception_with_signal; - int lines = test_exception_longjmp(in); + (void) test_exception_longjmp; clock_t end = clock(); -- cgit v1.3