From 79bb61dba186f8439d30dcf98b7f9dc8e9c2b687 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 24 Apr 2015 07:07:31 -0700 Subject: [PATCH] Adapt CSV test to include suit Also fixed it to correctly parse the mean depth (duh, a test that had a bug) and added a buddy field for good measure. Signed-off-by: Dirk Hohndel --- dives/test40-42.xml | 16 ++++++++++++---- dives/test41.csv | 10 +++++----- tests/testparse.cpp | 4 ++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/dives/test40-42.xml b/dives/test40-42.xml index 48f0ffd38..79ffaa01e 100644 --- a/dives/test40-42.xml +++ b/dives/test40-42.xml @@ -5,23 +5,31 @@ + Dirk + wet, 5mm - + + Linus + wet, shorty, 3mm - + + Tomaz + none - + + Don + dry, Whites Fusion - + diff --git a/dives/test41.csv b/dives/test41.csv index fb449ab71..a67915b82 100644 --- a/dives/test41.csv +++ b/dives/test41.csv @@ -1,6 +1,6 @@ -#Nr date time duration maxdepth avgdepth -1 10/1/13 10:34 45:00 18 9 -2 10/1/13 12:13 41:00 16.2 8.2 -3 10/1/14 10:02 48:00 13.3 9.1 -4 10/1/14 14:19 34:00 24.9 12.1 +#Nr date time duration maxdepth avgdepth buddy suit +1 10/1/13 10:34 45:00 18 16 Dirk wet, 5mm +2 10/1/13 12:13 41:00 16.2 13.5 Linus wet, shorty, 3mm +3 10/1/14 10:02 48:00 13.3 11.5 Tomaz none +4 10/1/14 14:19 34:00 24.9 20.1 Don dry, Whites Fusion diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 0257614cb..e5abbaa6a 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -14,8 +14,8 @@ void TestParse::testParseCSV() 0, // metric units 1, // mm/dd/yyyy 2, // min:sec - 0, 1, 2, 3, -1, -1, 4, -1, // Dive #, date, time, duration, maxdepth, avgdepth - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1), 0); + 0, 1, 2, 3, -1, -1, 4, 5, // Dive #, date, time, duration, maxdepth, avgdepth + -1, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1), 0); // buddy, suit fprintf(stderr, "number of dives %d \n", dive_table.nr); }