Index: unittests/tst_models.cpp =================================================================== diff -u -r62dbaac7d0c3da3d46276d958072fcc3bf86a674 -r914a8c335771f23cc98780cfd5b0a48c9b44a3b9 --- unittests/tst_models.cpp (.../tst_models.cpp) (revision 62dbaac7d0c3da3d46276d958072fcc3bf86a674) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision 914a8c335771f23cc98780cfd5b0a48c9b44a3b9) @@ -48,6 +48,7 @@ #include "MTreatmentAdjustPressuresLimitsResponse.h" #include "MTreatmentAdjustSalineResponse.h" #include "MTreatmentAdjustHeparinResponse.h" +#include "MUIBloodPressureData.h" #include "MAlarmStatusData.h" #include "MAlarmTriggered.h" @@ -58,6 +59,7 @@ #include "MessageInterpreter.h" + using namespace Can; #undef CONSOLEOUT @@ -479,10 +481,6 @@ 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")); - QTest::newRow("mVenousLimitHigh ")<< 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("mVenousLimitHigh ")<< 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("mVenousLimitHigh ")<< 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("mVenousLimitHigh ")<< 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_MAdjustPressuresLimitsResponse() @@ -520,7 +518,7 @@ 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")); + 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")); @@ -533,6 +531,19 @@ 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() { @@ -550,10 +561,14 @@ #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 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; @@ -566,7 +581,7 @@ 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")); + 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")); @@ -583,6 +598,11 @@ 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() { @@ -605,6 +625,8 @@ 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; @@ -617,15 +639,32 @@ 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")); + 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("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() { @@ -643,9 +682,14 @@ #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 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; @@ -658,11 +702,16 @@ void tst_models::tst_DGOperationMode_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - 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("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() { @@ -682,6 +731,8 @@ 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; @@ -694,7 +745,7 @@ 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")); + 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")); @@ -707,6 +758,43 @@ 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() { @@ -724,10 +812,19 @@ #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 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; @@ -740,9 +837,64 @@ void tst_models::tst_DGValvesStates_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00")); + 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() { @@ -760,8 +912,22 @@ #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 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; @@ -774,7 +940,7 @@ 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")); + 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")); @@ -787,6 +953,38 @@ 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() { @@ -808,6 +1006,15 @@ 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; @@ -871,7 +1078,7 @@ 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")); + 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")); @@ -920,6 +1127,40 @@ 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() { @@ -950,6 +1191,15 @@ 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; @@ -962,7 +1212,7 @@ 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")); + 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")); @@ -1045,11 +1295,16 @@ void tst_models::tst_MHDOperationModeData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + 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() { @@ -1069,6 +1324,8 @@ 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; @@ -1081,7 +1338,7 @@ 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")); + 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")); @@ -1173,7 +1430,7 @@ 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")); + 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")); @@ -1202,6 +1459,15 @@ 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() { @@ -1227,6 +1493,9 @@ 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; @@ -1239,7 +1508,7 @@ 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")); + 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")); @@ -1268,6 +1537,15 @@ 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() { @@ -1293,6 +1571,9 @@ 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; @@ -1351,7 +1632,7 @@ 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")); + 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")); @@ -1364,26 +1645,26 @@ 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")); + 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 ~~~~~~~~~~~~~~~~~~~~~~~~ // @@ -1520,33 +1801,46 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmTriggered ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmTriggered data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +// TODO need to re-evaluate to fix void tst_models::tst_MAlarmTriggered_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")); + 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, data ); + QFETCH(QByteArray, _xata ); int startIndex = 0; int index = errorIndex - 1; - bool ok = mData.fromByteArray(data, &startIndex); + 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(data)); QCOMPARE( index, startIndex ); } break; -// case 1: { index = index * sizeof mData._data.mAlarmID; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + 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; @@ -1582,7 +1876,7 @@ 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 1: { index = index * sizeof mData._data.mAlarmID; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; @@ -1596,11 +1890,11 @@ { 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")); - QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("requestValid") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + 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")); @@ -1649,26 +1943,22 @@ 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("arterialPressureLimitHigh") << 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("arterialPressureLimitHigh") << 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("arterialPressureLimitHigh") << 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("arterialPressureLimitHigh") << 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("mVenousPressureLimitWindow") << 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("mVenousPressureLimitWindow") << 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("mVenousPressureLimitWindow") << 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("mVenousPressureLimitWindow") << 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("mVenousPressureLimitAsymtrc") << 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("mVenousPressureLimitAsymtrc") << 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("mVenousPressureLimitAsymtrc") << 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("mVenousPressureLimitAsymtrc") << 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("mBloodPressureMeasureInterval") << 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("mBloodPressureMeasureInterval") << 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("mBloodPressureMeasureInterval") << 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("mBloodPressureMeasureInterval") << 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("mRinsebackFlowRate") << 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("mRinsebackFlowRate") << 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("mRinsebackFlowRate") << 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("mRinsebackFlowRate") << 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("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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @@ -1693,7 +1983,7 @@ #endif switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; -// case 1: { index = index * sizeof mData._data.requestValid ; 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; @@ -1706,10 +1996,10 @@ 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 15: { index = index * sizeof mData._data.mVenousPressureLimitWindow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 16: { index = index * sizeof mData._data.mVenousPressureLimitAsymtrc ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 17: { index = index * sizeof mData._data.mBloodPressureMeasureInterval ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 18: { index = index * sizeof mData._data.mRinsebackFlowRate ; 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; } @@ -1853,14 +2143,14 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("startTreatmentResponse ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("startTreatmentResponse ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("startTreatmentResponse ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("startTreatmentResponse ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("startTreatmentRejectReason") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("startTreatmentRejectReason") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("startTreatmentRejectReason") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("startTreatmentRejectReason") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + 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 ~~~~~~~~~~~~~~~~~~~~~~~~ // @@ -1880,9 +2170,9 @@ #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; -// case 1: { index = index * sizeof mData._data.startTreatmentResponse ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; -// case 2: { index = index * sizeof mData._data.startTreatmentRejectReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + 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; @@ -1975,7 +2265,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(37)); + 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")); @@ -2085,7 +2375,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11)); + 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")); @@ -2145,7 +2435,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2188,7 +2478,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2230,7 +2520,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9)); + 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")); @@ -2286,7 +2576,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(5)); + 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")); @@ -2334,7 +2624,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11)); + 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")); @@ -2376,7 +2666,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9)); + 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")); @@ -2438,7 +2728,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2481,7 +2771,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2524,7 +2814,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2567,7 +2857,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2610,7 +2900,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(6)); + 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")); @@ -2661,7 +2951,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2688,8 +2978,8 @@ 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; + 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"); @@ -2704,7 +2994,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2)); + 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")); @@ -2747,7 +3037,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -2792,7 +3082,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(5)); + 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")); @@ -2842,7 +3132,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -2889,7 +3179,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(1)); + 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")); @@ -2928,7 +3218,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -2971,7 +3261,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3008,7 +3298,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3051,7 +3341,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3094,7 +3384,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3138,9 +3428,9 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9)); + 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("0")); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); @@ -3195,7 +3485,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3223,7 +3513,7 @@ 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 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: @@ -3238,7 +3528,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3281,7 +3571,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3325,7 +3615,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3368,7 +3658,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3412,7 +3702,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3454,7 +3744,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3496,7 +3786,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3538,7 +3828,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3581,7 +3871,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3623,7 +3913,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3665,7 +3955,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3707,7 +3997,7 @@ QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3)); + 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")); @@ -3743,6 +4033,787 @@ } } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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; @@ -3781,10 +4852,13 @@ Can_Id canId = Can::Can_Id::eChlid_UI_HD; - QVERIFY(interpreter.interpretMessage(Gui::GuiActions::ID_AdjustTreatmentEndReq, vData, payload, canId)); + 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(Gui::GuiActions::ID_AdjustTreatmentEndReq, vData, payload, canId)); + QVERIFY(!interpreter.interpretMessage_HD(msg,vData)); } void tst_models::tst_MAdjustmentTreatmentParametersRequest()