diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-04-24 07:07:31 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-04-24 07:07:31 -0700 |
commit | 79bb61dba186f8439d30dcf98b7f9dc8e9c2b687 (patch) | |
tree | f0bfa68a30f16880b6bbadafbddf3b9bda7ee713 | |
parent | c80d1879b75716b47b1d6fb34fc385a08a43e420 (diff) | |
download | subsurface-79bb61dba186f8439d30dcf98b7f9dc8e9c2b687.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | dives/test40-42.xml | 16 | ||||
-rw-r--r-- | dives/test41.csv | 10 | ||||
-rw-r--r-- | 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 @@ </divesites> <dives> <dive number='1' date='2013-10-01' time='10:34:00' duration='45:00 min'> + <buddy>Dirk</buddy> + <suit>wet, 5mm</suit> <divecomputer> - <depth max='18.0 m' /> + <depth max='18.0 m' mean='16.0 m' /> </divecomputer> </dive> <dive number='2' date='2013-10-01' time='12:13:00' duration='41:00 min'> + <buddy>Linus</buddy> + <suit>wet, shorty, 3mm</suit> <divecomputer> - <depth max='16.2 m' /> + <depth max='16.2 m' mean='13.5 m' /> </divecomputer> </dive> <dive number='3' date='2014-10-01' time='10:02:00' duration='48:00 min'> + <buddy>Tomaz</buddy> + <suit>none</suit> <divecomputer> - <depth max='13.3 m' /> + <depth max='13.3 m' mean='11.5 m' /> </divecomputer> </dive> <dive number='4' date='2014-10-01' time='14:19:00' duration='34:00 min'> + <buddy>Don</buddy> + <suit>dry, Whites Fusion</suit> <divecomputer> - <depth max='24.9 m' /> + <depth max='24.9 m' mean='20.1 m' /> </divecomputer> </dive> <dive number='1' date='2014-04-01' time='10:00:00' duration='77:54 min'> 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); } |