From 6721698fcdad179a6fd770cafd009c3467e6ac06 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 23 Aug 2015 20:56:21 +0300 Subject: Change Seabear TestParse to use reduced parameters Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- tests/testparse.cpp | 56 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 18 deletions(-) (limited to 'tests/testparse.cpp') 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 -- cgit v1.2.3-70-g09d2