diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-08-23 20:56:21 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-25 10:59:45 -0700 |
commit | 6721698fcdad179a6fd770cafd009c3467e6ac06 (patch) | |
tree | d232ecf109222df64d16ac0fa01cbd805a7ea0ce /tests/testparse.cpp | |
parent | bde2e93f8fb75d5c78c97202e74bb3deb9fe3018 (diff) | |
download | subsurface-6721698fcdad179a6fd770cafd009c3467e6ac06.tar.gz |
Change Seabear TestParse to use reduced parameters
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests/testparse.cpp')
-rw-r--r-- | tests/testparse.cpp | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/tests/testparse.cpp b/tests/testparse.cpp index f12ac369e..76b3912da 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -268,25 +268,45 @@ void TestParse::testParseNewFormat() * Validate the parsing routine returns success. */ + char *params[40]; + int pnr = 0; + + params[pnr++] = strdup("timeField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample time"))); + params[pnr++] = strdup("depthField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample depth"))); + params[pnr++] = strdup("tempField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample temperature"))); + params[pnr++] = strdup("po2Field"); + params[pnr++] = intdup(headers.indexOf(tr("Sample pO₂"))); + params[pnr++] = strdup("o2sensor1Field"); + params[pnr++] = intdup(headers.indexOf(tr("Sample sensor1 pO₂"))); + params[pnr++] = strdup("o2sensor2Field"); + params[pnr++] = intdup(headers.indexOf(tr("Sample sensor2 pO₂"))); + params[pnr++] = strdup("o2sensor3Field"); + params[pnr++] = intdup(headers.indexOf(tr("Sample sensor3 pO₂"))); + params[pnr++] = strdup("cnsField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample CNS"))); + params[pnr++] = strdup("ndlField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample NDL"))); + params[pnr++] = strdup("ttsField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample TTS"))); + params[pnr++] = strdup("stopdepthField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample stopdepth"))); + params[pnr++] = strdup("pressureField"); + params[pnr++] = intdup(headers.indexOf(tr("Sample pressure"))); + params[pnr++] = strdup("setpointFiend"); + params[pnr++] = intdup(-1); + params[pnr++] = strdup("separatorIndex"); + params[pnr++] = intdup(2); + params[pnr++] = strdup("units"); + params[pnr++] = intdup(0); + params[pnr++] = strdup("delta"); + params[pnr++] = strdup(delta.toUtf8().data()); + params[pnr++] = NULL; + QCOMPARE(parse_seabear_csv_file(file.toUtf8().data(), - headers.indexOf(tr("Sample time")), - headers.indexOf(tr("Sample depth")), - headers.indexOf(tr("Sample temperature")), - headers.indexOf(tr("Sample pO₂")), - headers.indexOf(tr("Sample sensor1 pO₂")), - headers.indexOf(tr("Sample sensor2 pO₂")), - headers.indexOf(tr("Sample sensor3 pO₂")), - headers.indexOf(tr("Sample CNS")), - headers.indexOf(tr("Sample NDL")), - headers.indexOf(tr("Sample TTS")), - headers.indexOf(tr("Sample stopdepth")), - headers.indexOf(tr("Sample pressure")), - 2, - "csv", - 0, - delta.toUtf8().data(), - "" - ), 0); + params, pnr - 1, "csv"), 0); /* * Set artificial but static dive times so the result |