/*! * * Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file tst_models.cpp * \author (last) Behrouz NematiPour * \date (last) 10-Feb-2023 * \author (original) Behrouz NematiPour * \date (original) 21-Apr-2020 * */ #include "tst_models.h" // Qt // Project #include "MTreatmentAdjustBloodDialysateResponse.h" #include "MTreatmentAdjustDurationResponse.h" #include "MTreatmentRangesData.h" #include "MAdjustPowerOff.h" #include "MDGDrainPumpData.h" #include "MDGHeatersData.h" #include "MDGLoadCellReadingsData.h" #include "MDGOperationModeData.h" #include "MDGPressuresData.h" #include "MDGReservoirData.h" #include "MDGROPumpData.h" #include "MDGTemperaturesData.h" #include "MDGValvesStatesData.h" #include "MHDOperationModeData.h" #include "MTreatmentStatesData.h" #include "MTreatmentOutletFlowData.h" #include "MPreTreatmentAdjustParametersValidationResponse.h" #include "MPreTreatmentAdjustInitTreatmentResponse.h" #include "MTreatmentTimeData.h" #include "MTreatmentPressureOcclusionData.h" #include "MTreatmentSalineData.h" #include "MPreTreatmentDisposablesPrimeData.h" #include "MTreatmentAdjustUltrafiltrationStateResponse.h" #include "MTreatmentAdjustUltrafiltrationEditResponse.h" #include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" #include "MTreatmentAdjustPressuresLimitsResponse.h" #include "MTreatmentAdjustSalineResponse.h" #include "MTreatmentAdjustHeparinResponse.h" #include "MUIBloodPressureData.h" #include "MAlarmStatusData.h" #include "MAlarmTriggered.h" #include "MAlarmCleared.h" #include "MPreTreatmentAdjustParametersValidationResponse.h" #include "MPreTreatmentAdjustInitTreatmentResponse.h" #include "MessageInterpreter.h" using namespace Can; #undef CONSOLEOUT /*! * \brief tst_models::tst_models * \details Constructor * \param parent - QObject parent owner object. * Qt handles the children destruction by their parent objects life-cycle. */ tst_models::tst_models(QObject *parent) : QObject(parent) {} void tst_models::tst_MAdjustBloodDialysateResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mBloodRate ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mDialysateRate ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); } void tst_models::tst_MAdjustBloodDialysateResponse () { Model::MAdjustBloodDialysateResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mBloodRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mDialysateRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } void tst_models::tst_MTreatmentRanges_data() { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mDuration_Min ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mDuration_Min ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mDuration_Min ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mDuration_Min ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mDuration_Max ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mDuration_Max ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mDuration_Max ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mDuration_Max ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mUltrafiltration_Volume_Min")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mUltrafiltration_Volume_Min")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mUltrafiltration_Volume_Min")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mUltrafiltration_Volume_Min")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mUltrafiltration_Volume_Max")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mUltrafiltration_Volume_Max")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mUltrafiltration_Volume_Max")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mUltrafiltration_Volume_Max")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mDialysate_Flow_Min ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mDialysate_Flow_Min ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mDialysate_Flow_Min ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mDialysate_Flow_Min ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mDialysate_Flow_Max ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mDialysate_Flow_Max ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mDialysate_Flow_Max ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mDialysate_Flow_Max ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); } void tst_models::tst_MTreatmentRanges() { Model::MTreatmentRanges mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mDuration_Min ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mDuration_Max ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mUltrafiltration_Volume_Min; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mUltrafiltration_Volume_Max; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mDialysate_Flow_Min ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mDialysate_Flow_Max ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Duration Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDurationResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mDuration ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mDuration ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mDuration ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mDuration ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mUltrafiltration")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mUltrafiltration")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mUltrafiltration")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mUltrafiltration")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); } void tst_models::tst_MAdjustDurationResponse () { Model::MAdjustDurationResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mUFVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Init Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustUltrafiltrationInitResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); } void tst_models::tst_MAdjustUltrafiltrationInitResponse () { Model::MAdjustUltrafiltrationInitResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration State Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustUltrafiltrationStateResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); } void tst_models::tst_MAdjustUltrafiltrationStateResponse () { Model::MAdjustUltrafiltrationStateResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mUFState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Edit Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustUltrafiltrationEditResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); } void tst_models::tst_MAdjustUltrafiltrationEditResponse () { Model::MAdjustUltrafiltrationEditResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mDurationDiff ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mRateDiff ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mRateOld ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Confirm Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustUltrafiltrationConfirmResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); } void tst_models::tst_MAdjustUltrafiltrationConfirmResponse () { Model::MAdjustUltrafiltrationConfirmResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Pressures Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPressuresLimitsResponse_data() { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mArterialPressureLimitWindow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mArterialPressureLimitWindow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mArterialPressureLimitWindow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mArterialPressureLimitWindow ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mVenousPressureLimitWindow ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mVenousPressureLimitWindow ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mVenousPressureLimitWindow ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mVenousPressureLimitWindow ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mVenousPressureLimitAsymtrc ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mVenousPressureLimitAsymtrc ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mVenousPressureLimitAsymtrc ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mVenousPressureLimitAsymtrc ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); } void tst_models::tst_MAdjustPressuresLimitsResponse() { Model::MAdjustPressuresLimitsResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mArterialPressureLimitWindow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mVenousPressureLimitWindow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mVenousPressureLimitAsymtrc ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGROPumpData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mTgtFlowRate ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mTgtFlowRate ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mTgtFlowRate ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mTgtFlowRate ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mFBPWM ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mFBPWM ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mFBPWM ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mFBPWM ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGROPumpData() { Model::MDGROPump mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mFlowRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mPWM ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mTgtFlowRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mFBPWM ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGPressuresData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGPressuresData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGPressuresData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mBarometricPSI ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mBarometricPSI ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mBarometricPSI ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mBarometricPSI ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGPressuresData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGPressuresData() { Model::MDGPressures mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mROInletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mROOutletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mDrainInletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mDrainOutletPSI; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mBarometricPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGDrainPumpData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGDrainPumpData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGDrainPumpData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mRPMI ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mRPMI ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mRPMI ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mRPMI ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mRPMO ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mRPMO ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mRPMO ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mRPMO ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mTargetFLPMO ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mTargetFLPMO ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mTargetFLPMO ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mTargetFLPMO ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mCurrentA ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mCurrentA ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mCurrentA ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mCurrentA ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mDirection ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mDirection ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mDirection ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mDirection ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGDrainPumpData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGDrainPumpData() { Model::MDGDrainPump mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mRPMI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mDAC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mRPMO ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mTargetFLPMO ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mCurrentA ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mDirection ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGOperationMode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGOperationMode data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGOperationMode_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGOperationMode test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGOperationMode() { Model::MDGOperationMode mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mOpMode ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mSubMode; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGReservoirData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGReservoirData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGReservoirData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F")); QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mTimeReservoirCycleMS ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mTimeReservoirCycleMS ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mTimeReservoirCycleMS ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mTimeReservoirCycleMS ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mTimeReservoirFill2SwitchMS ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mTimeReservoirFill2SwitchMS ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mTimeReservoirFill2SwitchMS ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mTimeReservoirFill2SwitchMS ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mTimeUFDecayMS ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mTimeUFDecayMS ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mTimeUFDecayMS ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mTimeUFDecayMS ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mTempUFFill ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mTempUFFill ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mTempUFFill ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mTempUFFill ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mTempReservoirUseActual ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mTempReservoirUseActual ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mTempReservoirUseActual ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mTempReservoirUseActual ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mTempReservoirEndFill ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mTempReservoirEndFill ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mTempReservoirEndFill ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mTempReservoirEndFill ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); QTest::newRow("mTempAvgFill ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mTempAvgFill ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); QTest::newRow("mTempAvgFill ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); QTest::newRow("mTempAvgFill ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); QTest::newRow("mTempLastFill ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); QTest::newRow("mTempLastFill ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); QTest::newRow("mTempLastFill ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); QTest::newRow("mTempLastFill ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); QTest::newRow("mTimereservoirFill ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B")); QTest::newRow("mTimereservoirFill ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C")); QTest::newRow("mTimereservoirFill ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D")); QTest::newRow("mTimereservoirFill ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGReservoirData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGReservoirData() { Model::MDGReservoir mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mActiveReservoir ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mFillToVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mDrainToVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mTimeReservoirCycleMS ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mTimeReservoirFill2SwitchMS ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mTimeUFDecayMS ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mTempUFFill ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mTempReservoirUseActual ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mTempReservoirEndFill ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mTempAvgFill ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mTempLastFill ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mTimereservoirFill ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGValvesStates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGValvesStates data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGValvesStates_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38")); QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B")); QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C")); QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D")); QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E")); QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30")); QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31")); QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32")); QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33")); QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34")); QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35")); QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36")); QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGValvesStates test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGValvesStates() { Model::MDGValvesStates mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mStates; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mVRf ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mVRi ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mRes ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mVRo ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mVPo ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mVBf ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mVRc ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mVDr ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mVPi ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mVSP ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mVR1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 13: { index = index * sizeof mData._data.mVR2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 14: { index = index * sizeof mData._data.mVPd ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGHeatersData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGHeatersData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGHeatersData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); QTest::newRow("mMainPrimayHeaterDC ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mMainPrimayHeaterDC ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mMainPrimayHeaterDC ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mMainPrimayHeaterDC ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mSmallPrimaryHeaterDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mSmallPrimaryHeaterDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mSmallPrimaryHeaterDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mSmallPrimaryHeaterDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mTrimmerHeaterDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mTrimmerHeaterDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mTrimmerHeaterDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mTrimmerHeaterDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mPrimaryTargetTemp ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mPrimaryTargetTemp ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mPrimaryTargetTemp ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mPrimaryTargetTemp ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mTrimmerTargetTemp ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mTrimmerTargetTemp ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mTrimmerTargetTemp ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mTrimmerTargetTemp ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mPrimaryHeaterState ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mPrimaryHeaterState ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mPrimaryHeaterState ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mPrimaryHeaterState ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mTrimmerHeaterState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mTrimmerHeaterState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mTrimmerHeaterState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mTrimmerHeaterState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mPrimaryEfficiency ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mPrimaryEfficiency ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mPrimaryEfficiency ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mPrimaryEfficiency ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mPrimaryCalcTargetTemp ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mPrimaryCalcTargetTemp ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mPrimaryCalcTargetTemp ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mPrimaryCalcTargetTemp ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); QTest::newRow("mTrimmerCalcCurrentTemp ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mTrimmerCalcCurrentTemp ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); QTest::newRow("mTrimmerCalcCurrentTemp ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); QTest::newRow("mTrimmerCalcCurrentTemp ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); QTest::newRow("mTrimmerUseLastDC ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); QTest::newRow("mTrimmerUseLastDC ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); QTest::newRow("mTrimmerUseLastDC ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); QTest::newRow("mTrimmerUseLastDC ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGHeatersData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGHeatersData() { Model::MDGHeaters mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mMainPrimayHeaterDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mSmallPrimaryHeaterDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mTrimmerHeaterDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mPrimaryTargetTemp ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mTrimmerTargetTemp ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mPrimaryHeaterState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mTrimmerHeaterState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mPrimaryEfficiency ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mPrimaryCalcTargetTemp; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mTrimmerCalcCurrentTemp; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mTrimmerUseLastDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGLoadCellReadingsData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGLoadCellReadingsData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGLoadCellReadingsData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGLoadCellReadingsData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGLoadCellReadingsData() { Model::MDGLoadCellReadings mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mReservoir1Prim; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReservoir1Bkup; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mReservoir2Prim; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mReservoir2Bkup; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGTemperaturesData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGTemperaturesData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGTemperaturesData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E" "4F" "50")); QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B")); QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C")); QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D")); QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E")); QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30")); QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31")); QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32")); QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33")); QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34")); QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35")); QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36")); QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37")); QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38")); QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39")); QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A")); QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B")); QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C")); QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D")); QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E")); QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F")); QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40")); QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41")); QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42")); QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43")); QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44")); QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45")); QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46")); QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47")); QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48")); QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49")); QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A")); QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B")); QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C")); QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D")); QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E")); QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E" "4F")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGTemperaturesData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGTemperaturesData() { Model::MDGTemperatures mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mInletPrimaryHeater ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mOutletPrimaryHeater ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mConductivitySensor1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mConductivitySensor2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mOutletRedundancy ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mInletDialysate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mPrimaryHeaterThermoCouple; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mTrimmerHeaterThermoCouple; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mPrimaryHeaterColdJunction; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mTrimmerHeaterColdJunction; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mPrimaryHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mTrimmerHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 13: { index = index * sizeof mData._data.mFpgaBoard ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 14: { index = index * sizeof mData._data.mLoadCellA1B1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 15: { index = index * sizeof mData._data.mLoadCellA2B2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 16: { index = index * sizeof mData._data.mInternalTHDORTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 17: { index = index * sizeof mData._data.mInternalTDIRTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 18: { index = index * sizeof mData._data.mInteralTHDRTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 19: { index = index * sizeof mData._data.mInternalCondSnsrTemp ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 20: { index = index * sizeof mData._data.mBaroTempSensor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStateData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStateData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentStateData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mSalineState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mSalineState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mSalineState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mSalineState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mHeparinState") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mHeparinState") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mHeparinState") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mHeparinState") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mRinsebackState ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mRinsebackState ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mRinsebackState ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mRinsebackState ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mRecirculateState") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mRecirculateState") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mRecirculateState") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mRecirculateState") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mBloodPrimeState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mBloodPrimeState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mBloodPrimeState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mBloodPrimeState ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mTreatmentEndState ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mTreatmentEndState ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mTreatmentEndState ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mTreatmentEndState ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mTreatmentStopState ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mTreatmentStopState ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mTreatmentStopState ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mTreatmentStopState ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); QTest::newRow("mDialysisState ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mDialysisState ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); QTest::newRow("mDialysisState ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); QTest::newRow("mDialysisState ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStateData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentStateData() { Model::MTreatmentStates mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mSubMode ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mUFState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mSalineState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mHeparinState; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mRinsebackState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mRecirculateState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mBloodPrimeState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mTreatmentEndState; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mTreatmentStopState; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mDialysisState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDOperationModeData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDOperationModeData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDOperationModeData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mSubMode ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDOperationModeData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDOperationModeData() { Model::MHDOperationMode mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mOpMode; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mSubMode; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MOutletFlowData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MOutletFlowData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MOutletFlowData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30")); QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mDopCorrOffset ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mDopCorrOffset ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mDopCorrOffset ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mDopCorrOffset ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mDopCalcRate ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mDopCalcRate ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mDopCalcRate ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mDopCalcRate ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); QTest::newRow("mUfCalcRate ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mUfCalcRate ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); QTest::newRow("mUfCalcRate ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); QTest::newRow("mUfCalcRate ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); QTest::newRow("mRotorHall ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); QTest::newRow("mRotorHall ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); QTest::newRow("mRotorHall ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); QTest::newRow("mRotorHall ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); QTest::newRow("mCurrentSetUFRate")<< 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C")); QTest::newRow("mCurrentSetUFRate")<< 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D")); QTest::newRow("mCurrentSetUFRate")<< 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E")); QTest::newRow("mCurrentSetUFRate")<< 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MOutletFlowData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MOutletFlowData() { Model::MOutletFlow mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mRefUFVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mMeasUFVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mRotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mMotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mMotorCtlSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mMotorCtlCurrent; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mPWMDtCycle ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mDopCorrOffset ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mDopCalcRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mUfCalcRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mRotorHall ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mCurrentSetUFRate; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBloodFlowData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBloodFlowData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MBloodFlowData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBloodFlowData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MBloodFlowData() { Model::MBloodFlow mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mFlowSetPoint ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mMeasuredFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mRotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mMotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mMotorCtlSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mMotorCtlCurrent; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mPWMDutyCycle ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mRotorCount ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mPresFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDialysateFlowData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDialysateFlowData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDialysateFlowData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mRotorCount ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mPresFlow ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDialysateFlowData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDialysateFlowData() { Model::MDialysateFlow mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mFlowSetPoint ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mMeasuredFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mRotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mMotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mMotorCtlSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mMotorCtlCurrent; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mPWMDutyCycle ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mRotorCount ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mPresFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentTimeData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentTimeData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentTimeData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentTimeData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentTimeData() { Model::MTreatmentTime mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTotal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mElapsed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mRemaining; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPressureOcclusionData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPressureOcclusionData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPressureOcclusionData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mPressureLimitState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mPressureLimitState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mPressureLimitState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mPressureLimitState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mArterialLimitLow ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mArterialLimitLow ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mArterialLimitLow ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mArterialLimitLow ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mArterialLimitHigh ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mArterialLimitHigh ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mArterialLimitHigh ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mArterialLimitHigh ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mVenousLimitLow ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mVenousLimitLow ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mVenousLimitLow ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mVenousLimitLow ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mVenousLimitHigh") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mVenousLimitHigh") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mVenousLimitHigh") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mVenousLimitHigh") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPressureOcclusionData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPressureOcclusionData() { Model::MPressureOcclusion mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mArterialPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mVenousPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mBloodPumpOcclusion ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mPressureLimitState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mArterialLimitLow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mArterialLimitHigh ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mVenousLimitLow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mVenousLimitHigh ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPowerOff ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPowerOff data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPowerOff_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mStatus ") << 1 << QByteArray::fromHex(QByteArray()); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPowerOff test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPowerOff() { Model::MPowerOff mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mStatus; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } void tst_models::tst_MAlarmStatus_text() { for (int i = 1; i < Gui::GuiAlarmID::NUM_OF_ALARM_IDS; ++i) { QVERIFY(!Model::MAlarmStatus::toText(Gui::GuiAlarmID(i)).isEmpty()); } QCOMPARE(Model::MAlarmStatus::toText(Gui::GuiAlarmID(0)), tr("")); QCOMPARE(Model::MAlarmStatus::toText(Gui::GuiAlarmID(-1)), tr("ALARM_ID_UNDEFINED [-1]")); QCOMPARE(Model::MAlarmStatus::toText(Gui::GuiAlarmID(599)), tr("ALARM_ID_UNDEFINED [599]")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmStatus ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmStatus data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmStatus_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mState ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mState ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mState ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mState ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mTop ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mTop ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mTop ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mTop ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mEscalatesIn") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mEscalatesIn") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mEscalatesIn") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mEscalatesIn") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("mMuteTimeout") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mMuteTimeout") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("mMuteTimeout") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("mMuteTimeout") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mFlags ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mFlags ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmStatus test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmStatus() { Model::MAlarmStatus mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mTop ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mEscalatesIn; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mMuteTimeout; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mFlags ; QVERIFY (! mData.fromByteArray(data)); /*GetBits does not need this */} break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmTriggered ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmTriggered data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // // TODO need to re-evaluate to fix void tst_models::tst_MAlarmTriggered_data () { QTest::addColumn("errorIndex"); QTest::addColumn("_xata"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mPriority ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mPriority ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mPriority ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mPriority ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mRank ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mRank ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mRank ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mRank ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mClearTop") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mClearTop") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mClearTop") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mClearTop") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmTriggered test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmTriggered() { Model::MAlarmTriggered mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, _xata ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(_xata, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(_xata)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._xata.mPriority ; QVERIFY (! mData.fromByteArray(_xata)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._xata.mRank ; QVERIFY (! mData.fromByteArray(_xata)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._xata.mPriority ; QVERIFY (! mData.fromByteArray(_xata)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmCleared ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmCleared data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmCleared_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmCleared test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmCleared() { Model::MAlarmCleared mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAlarmID; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentParametersResp test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentParametersResp data definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentParametersResp_data() { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" )); QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C")); QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D")); QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E")); QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F")); QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30")); QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31")); QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32")); QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33")); QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" )); QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35")); QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" )); QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37")); QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" )); QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" )); QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A")); QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" )); QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" )); QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" )); QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" )); QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" )); QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" )); QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41")); QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" )); QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentParametersResp test definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentParametersResp() { Model::MAdjustParametersValidationResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << "index: " << index << "\n" << "errorIndex: " << errorIndex << "\n" << "startIndex: " << startIndex << "\n" << "ok: " << ok << "\n" << "data: " << data; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 2: { index = index * sizeof mData._data.mBloodFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 3: { index = index * sizeof mData._data.mDialysateFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 5: { index = index * sizeof mData._data.mHeparinDispensingRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 6: { index = index * sizeof mData._data.mHeparinBolusVolume ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 7: { index = index * sizeof mData._data.mHeparinStopTime ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 8: { index = index * sizeof mData._data.mSalineBolus ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 9: { index = index * sizeof mData._data.mAcidConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 10: { index = index * sizeof mData._data.mBicarbonateConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 11: { index = index * sizeof mData._data.mDialyzerType ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 12: { index = index * sizeof mData._data.mDialysateTemp ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 13: { index = index * sizeof mData._data.mArterialPressureLimitWindow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 14: { index = index * sizeof mData._data.mVenousPressureLimitWindow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 15: { index = index * sizeof mData._data.mVenousPressureLimitAsymtrc ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 16: { index = index * sizeof mData._data.mBloodPressureMeasureInterval ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; case 17: { index = index * sizeof mData._data.mRinsebackFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentmSalineBolusData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentmSalineBolusData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentSalineBolusData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mCumulative ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mCumulative ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mCumulative ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mCumulative ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); QTest::newRow("mDelivered ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mDelivered ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mDelivered ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mDelivered ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentmSalineBolusData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentSalineBolusData() { Model::MTreatmentSaline mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTarget ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCumulative; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mDelivered ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentHeparinData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentHeparinData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentHeparinData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("mCumulative ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mCumulative ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mCumulative ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mCumulative ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mTarget ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mTarget ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mTarget ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mTarget ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentHeparinData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentHeparinData() { Model::MTreatmentHeparin mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mCumulative; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mTarget ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentPrime ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentPrime data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentPrime_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); QTest::newRow("timeout ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("timeout ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("timeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("timeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("countdown ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("countdown ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("countdown ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("countdown ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentPrime test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentPrime() { Model::MPreTreatmentDisposablesPrime mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTimeout ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCountdown ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustInitTreatmentResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustInitTreatmentResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustInitTreatmentResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustInitTreatmentResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustInitTreatmentResponse() { Model::MAdjustInitTreatmentResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MmSalineBolusResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MmSalineBolusResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHeparinResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHeparinResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHeparinResponse() { Model::MAdjustHeparinResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentLogResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentLogResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // QByteArray helperFunction_createArray(int vCount) { /* * Based on the existing tests and test data, this helper function will reduce the need to copy-paste * and creating data sets by hand. The function generates a QByteArray of elements "00"..."xx" up to * vCount of them. * * Expected return for a vCount == 5 is: * { "00" "01" "02" "03" "04" } */ QByteArray returnArray = {}; for(int i = 0; i("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(36*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mBloodFlowRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mDialysateFlowRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTreatmentDuration" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mActualTreatmentDuration" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAcidConcentrateType" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mBicarbonateConcentrateType", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mPotassiumConcentration" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCalciumConcentration" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mBicarbonateConcentration" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSodiumConcentration" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mDialysateTemperature" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mDialyzerType" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTreatmentStartEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTreatmentEndEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAverageBloodFlow" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAverageDialysateFlow" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mDialysateVolumeUsed" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAverageDialysateTemp" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mOriginUFVolume" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTargetUFVolume" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mActualUFVolume" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mOriginUFRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTargetUFRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mActualUFRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSalineBolusVolume" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mHeparinBolusVolume" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mHeparinDispenseRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mHeparinStop" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mHeparinDeliveredVolume" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mHeparinType" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAverageArterialPressure" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAverageVenousPressure" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mDeviceID" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mWaterSampleTestResult" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentLogResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustTreatmentLogResponse() { Model::MAdjustTreatmentLogResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mBloodFlowRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mDialysateFlowRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mTreatmentDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mActualTreatmentDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mAcidConcentrateType ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mBicarbonateConcentrateType; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mPotassiumConcentration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mCalciumConcentration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mBicarbonateConcentration; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mSodiumConcentration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 13: { index = index * sizeof mData._data.mDialysateTemperature ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 14: { index = index * sizeof mData._data.mDialyzerType ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 15: { index = index * sizeof mData._data.mTreatmentStartEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 16: { index = index * sizeof mData._data.mTreatmentEndEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 17: { index = index * sizeof mData._data.mAverageBloodFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 18: { index = index * sizeof mData._data.mAverageDialysateFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 19: { index = index * sizeof mData._data.mDialysateVolumeUsed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 20: { index = index * sizeof mData._data.mAverageDialysateTemp ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 21: { index = index * sizeof mData._data.mOriginUFVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 22: { index = index * sizeof mData._data.mTargetUFVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 23: { index = index * sizeof mData._data.mActualUFVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 24: { index = index * sizeof mData._data.mOriginUFRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 25: { index = index * sizeof mData._data.mTargetUFRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 26: { index = index * sizeof mData._data.mActualUFRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 27: { index = index * sizeof mData._data.mSalineBolusVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 28: { index = index * sizeof mData._data.mHeparinBolusVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 29: { index = index * sizeof mData._data.mHeparinDispenseRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 30: { index = index * sizeof mData._data.mHeparinStop ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 31: { index = index * sizeof mData._data.mHeparinDeliveredVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 32: { index = index * sizeof mData._data.mHeparinType ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 33: { index = index * sizeof mData._data.mAverageArterialPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 34: { index = index * sizeof mData._data.mAverageVenousPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 35: { index = index * sizeof mData._data.mDeviceID ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 36: { index = index * sizeof mData._data.mWaterSampleTestResult ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDSyringePump ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDSyringePump data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDSyringePump_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11*4)); QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mHeparinState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSetRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSyringePumpPosition" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mVolumeDelivered" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredHome" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredSwitch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredForce" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSafetyVol" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mStatus" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDSyringePump test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDSyringePump() { Model::MHDSyringePump mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mSyringePumpState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mHeparinState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mSetRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mMeasuredRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mSyringePumpPosition ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mVolumeDelivered ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mMeasuredHome ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mMeasuredSwitch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mMeasuredForce ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mSafetyVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDBloodLeakData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDBloodLeakData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDBloodLeakData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mBloodLeakState" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDBloodLeakData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDBloodLeakData() { Model::MHDBloodLeakData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mBloodLeakStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mBloodLeakState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirTrapData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirTrapData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirTrapData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mAirTrapUpperLevel" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirTrapData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirTrapData() { Model::MHDAirTrapData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAirTrapLowerLevel ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mAirTrapUpperLevel ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAccelerometer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAccelerometer data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAccelerometer_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mY" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mZ" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mXMax" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mYMax" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mZMax" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mXTilt", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mYTilt", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mZTilt", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAccelerometer test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAccelerometer() { Model::MHDAccelerometer mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mX ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mY ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mZ ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mXMax ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mYMax ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mZMax ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mXTilt; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mYTilt; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mZTilt; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDUsageInfoResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDUsageInfoResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDUsageInfoResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(5*4)); QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mTotalTxHoursSinceLastService" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mEpochOfStartOfLastTx" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mEpochOfLastRecordReset" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCrc" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDUsageInfoResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDUsageInfoResponse() { Model::MHDUsageInfoResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTotalTxHours ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mTotalTxHoursSinceLastService ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mEpochOfStartOfLastTx ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mEpochOfLastRecordReset ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mCrc ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirBubbleData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirBubbleData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirBubbleData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11*4)); QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mVenousAirBubbleState" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirBubbleData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirBubbleData() { Model::MHDAirBubbleData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mVenousAirBubbleStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mVenousAirBubbleState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentStates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentStates data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentStates_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11*4)); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mWaterSampleState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSelfTestConsumablesState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSelfTestNoCartridgeState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mInstallationState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSelfTestDryState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mPrimeState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mRecirculateState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mPatientConnectionState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mWetSelfTestsState" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mPreTreatmentRsrvrState" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentStates test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentStates() { Model::MPreTreatmentStates mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mSubMode ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mWaterSampleState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mSelfTestConsumablesState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mSelfTestNoCartridgeState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mInstallationState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mSelfTestDryState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mPrimeState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mRecirculateState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mPatientConnectionState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mWetSelfTestsState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mPreTreatmentRsrvrState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestNoCartridge ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestNoCartridge data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestNoCartridge_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCountdown" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestNoCartridge test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestNoCartridge() { Model::MPreTreatmentSelfTestNoCartridge mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTimeout ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCountdown; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestDry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestDry data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestDry_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCountdown" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestDry test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestDry() { Model::MPreTreatmentSelfTestDry mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTimeout ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCountdown; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPostTreatmentStates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPostTreatmentStates data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPostTreatmentStates_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mDrainState" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPostTreatmentStates test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPostTreatmentStates() { Model::MPostTreatmentStates mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mSubMode ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mDrainState; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStop data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentStop_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCountDown" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStop test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentStop() { Model::MTreatmentStop mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTotal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCountDown; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRinseback ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRinseback data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRinseback_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(6*4)); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCurrent" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTimeoutTotal" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTimeoutCountDown" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mIsCompleted" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRinseback test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRinseback() { Model::MTreatmentRinseback mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTarget ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCurrent ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mTimeoutTotal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mTimeoutCountDown ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mIsCompleted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRecirculate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRecirculate data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRecirculate_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mTimeoutCountDown" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRecirculate test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRecirculate() { Model::MTreatmentRecirculate mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTimeoutTotal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mTimeoutCountDown ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentBloodPrime ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentBloodPrime data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentBloodPrime_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCurrent" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentBloodPrime test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentBloodPrime() { Model::MTreatmentBloodPrime mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTarget ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCurrent ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogEventData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogEventData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogEventData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mOldValue" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mNewValue" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogEventData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogEventData() { Model::MTreatmentLogEventData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mEventID ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mOldValue ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mNewValue ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAvrgeData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAvrgeData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAvrgeData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(5*4)); QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mDialysateFlowRate", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mUFRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mArterialPressure" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mVenousPressure" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAvrgeData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAvrgeData() { Model::MTreatmentLogAvrgeData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mBloodFlowRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mDialysateFlowRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mUFRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mArterialPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mVenousPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAlarmData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAlarmData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAlarmData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mParam1", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mParam2", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAlarmData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAlarmData() { Model::MTreatmentLogAlarmData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAlarmID ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mParam1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mParam2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDRTCEpochData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDRTCEpochData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDRTCEpochData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(1*4)); QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDRTCEpochData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDRTCEpochData() { Model::MHDRTCEpochData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostSingleResult ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostSingleResult data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDPostSingleResult_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mIndex", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostSingleResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDPostSingleResult() { Model::MHDPostSingleResult mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mResult ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mIndex ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostFinalResult ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostFinalResult data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDPostFinalResult_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostFinalResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDPostFinalResult() { Model::MHDPostFinalResult mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mResult ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDAlarmVolumeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDAlarmVolumeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDAlarmVolumeResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDAlarmVolumeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDAlarmVolumeResponse() { Model::MAdjustHDAlarmVolumeResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDDateTimeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDDateTimeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDDateTimeResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDDateTimeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDDateTimeResponse() { Model::MAdjustHDDateTimeResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceModeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceModeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceModeResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceModeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceModeResponse() { Model::MAdjustServiceModeResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsHDResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsHDResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustVersionsHDResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("0")); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mMinor" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMicro" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mBuild" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGAId" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGAMajor", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGAMinor", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGALab" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCompatibilityRev" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsHDResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustVersionsHDResponse() { Model::MAdjustVersionsHDResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mMajor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mMinor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mBuild ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mFPGAId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mFPGAMajor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mFPGAMinor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mCompatibilityRev ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesHDResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesHDResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceDatesHDResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mServiceIntervalSeconds", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesHDResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceDatesHDResponse() { Model::MAdjustServiceDatesHDResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mLastServiceDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mServiceIntervalSeconds ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRinsebackResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRinsebackResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRinsebackResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRinsebackResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRinsebackResponse() { Model::MAdjustRinsebackResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRecirculateResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRecirculateResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRecirculateResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRecirculateResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRecirculateResponse() { Model::MAdjustRecirculateResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentEndResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentEndResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustTreatmentEndResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentEndResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustTreatmentEndResponse() { Model::MAdjustTreatmentEndResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustSalineResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustSalineResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustSalineResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mTarget", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustSalineResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustSalineResponse() { Model::MAdjustSalineResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mTarget ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustWaterSampleResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustWaterSampleResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustWaterSampleResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustWaterSampleResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustWaterSampleResponse() { Model::MAdjustWaterSampleResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustStartTreatmentResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustStartTreatmentResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustStartTreatmentResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustStartTreatmentResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustStartTreatmentResponse() { Model::MAdjustStartTreatmentResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionConfirmResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionConfirmResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionConfirmResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionConfirmResponse() { Model::MAdjustPatientConnectionConfirmResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionBeginResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionBeginResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionBeginResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionBeginResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionBeginResponse() { Model::MAdjustPatientConnectionBeginResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesPrimeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesPrimeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesPrimeResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesPrimeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesPrimeResponse() { Model::MAdjustDisposablesPrimeResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesConfirmResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesConfirmResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesConfirmResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesConfirmResponse() { Model::MAdjustDisposablesConfirmResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectStartResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectStartResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectStartResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectStartResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectStartResponse() { Model::MAdjustDisinfectStartResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectModeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectModeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectModeResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectModeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectModeResponse() { Model::MAdjustDisinfectModeResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientDisconnectionConfirmResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientDisconnectionConfirmResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientDisconnectionConfirmResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientDisconnectionConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientDisconnectionConfirmResponse() { Model::MAdjustPatientDisconnectionConfirmResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesRemovalConfirmResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesRemovalConfirmResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesRemovalConfirmResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesRemovalConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesRemovalConfirmResponse() { Model::MAdjustDisposablesRemovalConfirmResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmActiveListResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmActiveListResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmActiveListResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(12*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID0" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID1" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID2" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID3" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID4" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID5" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID6" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID7" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID8" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mAlarmID9" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmActiveListResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmActiveListResponse() { Model::MAlarmActiveListResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mAlarmID0 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mAlarmID1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mAlarmID2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mAlarmID3 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mAlarmID4 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mAlarmID5 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mAlarmID6 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mAlarmID7 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mAlarmID8 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mAlarmID9 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmClearedCondition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmClearedCondition data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmClearedCondition_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(1*4)); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmClearedCondition test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmClearedCondition() { Model::MAlarmClearedCondition mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAlarmID ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGCleaningUsageResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGCleaningUsageResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDGCleaningUsageResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(12*4)); QTest::newRow("mRoWaterGenTotalL ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mRoWaterGenTotalL ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mRoWaterGenTotalL ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mRoWaterGenTotalL ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mRoWaterGenSinceLastServiceL" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastBasicFlushCompleteDateEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastChemDisStartDateEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastChemDisCompleteDateEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastChemDisFlushCompleteDateEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastHeatDisCompleteDateEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastHeatActiveCoolCompleteDateEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastFilterFlushCompleteDateEpoch" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mLastResetTimeEpoch" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGCleaningUsageResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDGCleaningUsageResponse() { Model::MAdjustDGCleaningUsageResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mRoWaterGenTotalL ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mRoWaterGenSinceLastServiceL ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mLastBasicFlushCompleteDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mLastChemDisStartDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mLastChemDisCompleteDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mLastChemDisFlushCompleteDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mLastHeatDisCompleteDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mLastHeatActiveCoolCompleteDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mLastFilterFlushCompleteDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mLastResetTimeEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGDateTimeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGDateTimeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDGDateTimeResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGDateTimeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDGDateTimeResponse() { Model::MAdjustDGDateTimeResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesDGResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesDGResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceDatesDGResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mServiceIntervalSeconds", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesDGResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceDatesDGResponse() { Model::MAdjustServiceDatesDGResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mLastServiceDateEpoch ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mServiceIntervalSeconds ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsDGResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsDGResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustVersionsDGResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mMinor" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMicro" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mBuild" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGAId" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGAMajor" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGAMinor" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mFPGALab" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCompatibilityRev" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsDGResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustVersionsDGResponse() { Model::MAdjustVersionsDGResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mMajor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mMinor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mBuild ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mFPGAId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mFPGAMajor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mFPGAMinor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mCompatibilityRev; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetRoWaterModeDGr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetRoWaterModeDGr data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDuetRoWaterModeDGr_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetRoWaterModeDGr test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDuetRoWaterModeDGr() { Model::MDuetRoWaterModeDGr mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGConductivityData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGConductivityData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGConductivityData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(13*4)); QTest::newRow("mRORejectionRatio ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mRORejectionRatio ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mRORejectionRatio ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mRORejectionRatio ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCPi" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCPo" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCD1" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCD2" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCPiRaw" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCPoRaw" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCD1Raw" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCD2Raw" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCPiSensorStatus" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCPoSensorStatus" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCD1SensorStatus" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mCD2SensorStatus" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGConductivityData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGConductivityData() { Model::MDGConductivityData mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mRORejectionRatio ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCPi ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mCPo ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mCD1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mCD2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mCPiRaw ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mCPoRaw ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mCD1Raw ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mCD2Raw ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mCPiSensorStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mCPoSensorStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mCD1SensorStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 13: { index = index * sizeof mData._data.mCD2SensorStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGAccelerometer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGAccelerometer data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGAccelerometer_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mY" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mZ" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mXMax" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mYMax" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mZMax" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mXTilt", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mYTilt", ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mZTilt", ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGAccelerometer test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGAccelerometer() { Model::MDGAccelerometer mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mX ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mY ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mZ ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mXMax ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mYMax ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mZMax ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mXTilt; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mYTilt; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mZTilt; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGFilterFlush ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGFilterFlush data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGFilterFlush_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCountdown" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGFilterFlush test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGFilterFlush() { Model::MDGFilterFlush mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mTimeout ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCountdown ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostSingleResult ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostSingleResult data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGPostSingleResult_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mIndex" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostSingleResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGPostSingleResult() { Model::MDGPostSingleResult mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mResult ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mIndex ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostFinalResult ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostFinalResult data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGPostFinalResult_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostFinalResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGPostFinalResult() { Model::MDGPostFinalResult mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mResult ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MUIBloodPressure ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MUIBloodPressure data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MUIBloodPressure_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mFlags ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mFlags ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mFlags ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mFlags ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mSystolic" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mDiastolic" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMeanArterial" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mYear" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMonth" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mDay" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mHour" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mMinute" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mSecond" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mPulseRate" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mUserId" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mStatus" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MUIBloodPressure test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MUIBloodPressure() { Model::MUIBloodPressure mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mFlags ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mSystolic ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mDiastolic ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 4: { index = index * sizeof mData._data.mMeanArterial ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 5: { index = index * sizeof mData._data.mYear ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 6: { index = index * sizeof mData._data.mMonth ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 7: { index = index * sizeof mData._data.mDay ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 8: { index = index * sizeof mData._data.mHour ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 9: { index = index * sizeof mData._data.mMinute ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 10: { index = index * sizeof mData._data.mSecond ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 11: { index = index * sizeof mData._data.mPulseRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 12: { index = index * sizeof mData._data.mUserId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 13: { index = index * sizeof mData._data.mStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetConfirmHDi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetConfirmHDi data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDuetConfirmHDi_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); QTest::newRow("mId ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mId ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mId ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mId ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); int lastElementCount = 3; // The number of elements in the last row int errorIndex_index = 1; // the errorIndex of the current string key lastElementCount = helperFunction_addSetOfFour_rows("mCommand" , ++errorIndex_index, lastElementCount+1); lastElementCount = helperFunction_addSetOfFour_rows("mReason" , ++errorIndex_index, lastElementCount+1); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetConfirmHDi test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDuetConfirmHDi() { Model::MDuetConfirmHDi mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mCommand ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } void tst_models::tst_MAlarmAcknowledgeRequest() { MessageInterpreter interpreter; QVariantList vData; QByteArray payload; Can_Id canId = Can::Can_Id::eChlid_HD_Alarm; QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AlarmUserActionReq, vData, payload, canId)); } void tst_models::tst_MInitTreatmentRequest() { MessageInterpreter interpreter; QVariantList vData; QByteArray payload; Can_Id canId = Can::Can_Id::eChlid_HD_UI; QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AdjustInitTreatmentReq, vData, payload, canId)); } void tst_models::tst_MConfirmTreatmentRequest() { MessageInterpreter interpreter; QVariantList vData; QByteArray payload; Can_Id canId = Can::Can_Id::eChlid_UI_HD; QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AdjustParametersConfirmReq, vData, payload, canId)); } void tst_models::tst_MEndTreatmentRequest() { MessageInterpreter interpreter; QVariantList vData; QByteArray payload; Message msg; msg.actionId = Gui::GuiActions::ID_AdjustTreatmentEndReq; Can_Id canId = Can::Can_Id::eChlid_UI_HD; QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AdjustTreatmentEndReq, vData, payload, canId)); QVERIFY(!interpreter.interpretMessage_HD(msg,vData)); // Add a value to the data list to avoid length check returning false vData.append(0); QVERIFY(interpreter.interpretMessage(Gui::GuiActions::ID_AdjustTreatmentEndReq, vData, payload, canId)); QVERIFY(!interpreter.interpretMessage_HD(msg,vData)); } void tst_models::tst_MAdjustmentTreatmentParametersRequest() { MessageInterpreter interpreter; QVariantList vData; QByteArray payload; Can_Id canId = Can::Can_Id::eChlid_UI_HD; QVERIFY(!interpreter.interpretMessage(Gui::GuiActions::ID_AdjustParametersValidationReq, vData, payload, canId)); }