Index: unittests/tst_models.cpp =================================================================== diff -u -r914a8c335771f23cc98780cfd5b0a48c9b44a3b9 -rded9f686d2c96837cc4a23f54a917d04cd257bd4 --- unittests/tst_models.cpp (.../tst_models.cpp) (revision 914a8c335771f23cc98780cfd5b0a48c9b44a3b9) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision ded9f686d2c96837cc4a23f54a917d04cd257bd4) @@ -639,7 +639,7 @@ void tst_models::tst_DGDrainPumpData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); + QTest::newRow("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("mRPMI ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mRPMI ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mRPMI ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); @@ -648,23 +648,26 @@ 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")); - + QTest::newRow("mState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mState ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mRPMO ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mRPMO ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mRPMO ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mRPMO ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mTargetFLPMO ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mTargetFLPMO ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mTargetFLPMO ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mTargetFLPMO ") << 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("mCurrentA ") << 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("mCurrentA ") << 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("mCurrentA ") << 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("mCurrentA ") << 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("mDirection ") << 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("mDirection ") << 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("mDirection ") << 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("mDirection ") << 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")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGDrainPumpData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGDrainPumpData() { @@ -682,13 +685,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 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; + 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.mState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mRPMO ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mTargetFLPMO ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mCurrentA ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mDirection ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); @@ -812,19 +816,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 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; + 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; @@ -837,97 +841,62 @@ void tst_models::tst_DGValvesStates_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38")); - QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mVRf ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); - QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); - QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); - QTest::newRow("mVRi ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("mRes ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); - QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); - QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); - QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); - QTest::newRow("mVRo ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); - QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); - QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); - QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); - QTest::newRow("mVPo ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); - QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); - QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); - QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); - QTest::newRow("mVBf ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); - QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); - QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); - QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); - QTest::newRow("mVRc ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); - QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); - QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); - QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); - QTest::newRow("mVDr ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); - QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); - QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); - QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); - QTest::newRow("mVPi ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); - QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); - QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); - QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); - QTest::newRow("mVSP ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); - QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B")); - QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C")); - QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D")); - QTest::newRow("mVR1 ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E")); - QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30")); - QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31")); - QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32")); - QTest::newRow("mVR2 ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33")); - QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34")); - QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35")); - QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36")); - QTest::newRow("mVPd ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37")); + int lastFlag = 0; + int errorIndex = 1; + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mStates" , errorIndex++, 1, 16); // adding 16 rows for the two bytes of data for the states flag + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVRf" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVRi" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mRes" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVRo" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVPo" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVBf" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVRc" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVDr" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVPi" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVSP" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVR1" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVR2" , errorIndex++, lastFlag + 1); + lastFlag = HelperFunctions_tstModel::generate_bitDataRow("mVPd" , errorIndex++, lastFlag + 1); } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGValvesStates test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGValvesStates() { Model::MDGValvesStates mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); - int startIndex = 0; - int index = errorIndex - 1; + int startIndex = errorIndex+1; + int index = errorIndex+1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif - switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mStates; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mVRf ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mVRi ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mRes ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 5: { index = index * sizeof mData._data.mVRo ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 6: { index = index * sizeof mData._data.mVPo ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 7: { index = index * sizeof mData._data.mVBf ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 8: { index = index * sizeof mData._data.mVRc ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 9: { index = index * sizeof mData._data.mVDr ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 10: { index = index * sizeof mData._data.mVPi ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 11: { index = index * sizeof mData._data.mVSP ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 12: { index = index * sizeof mData._data.mVR1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 13: { index = index * sizeof mData._data.mVR2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 14: { index = index * sizeof mData._data.mVPd ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + // The mStates param contains 2byte of data or 16 bits of states + case 1: { index = index * sizeof mData._data.mStates/8 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + + // All of these are single byte types (u8) + 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; + + // The test data is set up in bits and we are testing for bytes, when we reach the last case, the + // fromByteArray function returns true even though we have a partial byte filled out, the remainder/"missing" bits are 0 + case 14: { index = index * sizeof mData._data.mVPd ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; @@ -940,7 +909,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" "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("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")); QTest::newRow("mMainPrimayHeaterDC ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mMainPrimayHeaterDC ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mMainPrimayHeaterDC ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); @@ -1076,91 +1045,29 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGTemperaturesData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGTemperaturesData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGTemperaturesData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E" "4F" "50")); - QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mInletPrimaryHeater ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mOutletPrimaryHeater ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); - QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); - QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); - QTest::newRow("mConductivitySensor1 ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("mConductivitySensor2 ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); - QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); - QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); - QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); - QTest::newRow("mOutletRedundancy ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); - QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); - QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); - QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); - QTest::newRow("mInletDialysate ") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); - QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); - QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); - QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); - QTest::newRow("mPrimaryHeaterThermoCouple ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); - QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); - QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); - QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); - QTest::newRow("mTrimmerHeaterThermoCouple ") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); - QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); - QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); - QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); - QTest::newRow("mPrimaryHeaterColdJunction ") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); - QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); - QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); - QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); - QTest::newRow("mTrimmerHeaterColdJunction ") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); - QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); - QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); - QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); - QTest::newRow("mPrimaryHeaterInternal ") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); - QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B")); - QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C")); - QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D")); - QTest::newRow("mTrimmerHeaterInternal ") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E")); - QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30")); - QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31")); - QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32")); - QTest::newRow("mFpgaBoard ") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33")); - QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34")); - QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35")); - QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36")); - QTest::newRow("mLoadCellA1B1 ") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37")); - QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38")); - QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39")); - QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A")); - QTest::newRow("mLoadCellA2B2 ") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B")); - QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C")); - QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D")); - QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E")); - QTest::newRow("mInternalTHDORTD ") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F")); - QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40")); - QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41")); - QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42")); - QTest::newRow("mInternalTDIRTD ") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43")); - QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44")); - QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45")); - QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46")); - QTest::newRow("mInteralTHDRTD") << 18 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47")); - QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48")); - QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49")); - QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A")); - QTest::newRow("mInternalCondSnsrTemp ") << 19 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B")); - QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C")); - QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D")); - QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E")); - QTest::newRow("mBaroTempSensor") << 20 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" "4D" "4E" "4F")); - - + HelperFunctions_tstModel::generate_ByteDataSet( { + "mInletPrimaryHeater ", + "mHeatDisinfect ", + "mOutletPrimaryHeater ", + "mConductivitySensor1 ", + "mConductivitySensor2 ", + "mOutletRedundancy ", + "mInletDialysate ", + "mPrimaryHeaterThermoCouple ", + "mTrimmerHeaterThermoCouple ", + "mPrimaryHeaterColdJunction ", + "mTrimmerHeaterColdJunction ", + "mPrimaryHeaterInternal ", + "mTrimmerHeaterInternal ", + "mFpgaBoard ", + "mLoadCellA1B1 ", + "mLoadCellA2B2 ", + "mInternalTHDORTD ", + "mInternalTDIRTD ", + "mInteralTHDRTD ", + "mInternalCondSnsrTemp ", + "mBaroTempSensor " + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGTemperaturesData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_DGTemperaturesData() { @@ -1180,26 +1087,26 @@ switch (errorIndex) { case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 1: { index = index * sizeof mData._data.mInletPrimaryHeater ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mOutletPrimaryHeater ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mConductivitySensor1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mConductivitySensor2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 5: { index = index * sizeof mData._data.mOutletRedundancy ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 6: { index = index * sizeof mData._data.mInletDialysate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 7: { index = index * sizeof mData._data.mPrimaryHeaterThermoCouple; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 8: { index = index * sizeof mData._data.mTrimmerHeaterThermoCouple; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 9: { index = index * sizeof mData._data.mPrimaryHeaterColdJunction; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 10: { index = index * sizeof mData._data.mTrimmerHeaterColdJunction; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 11: { index = index * sizeof mData._data.mPrimaryHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 12: { index = index * sizeof mData._data.mTrimmerHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 13: { index = index * sizeof mData._data.mFpgaBoard ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 14: { index = index * sizeof mData._data.mLoadCellA1B1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 15: { index = index * sizeof mData._data.mLoadCellA2B2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 16: { index = index * sizeof mData._data.mInternalTHDORTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 17: { index = index * sizeof mData._data.mInternalTDIRTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 18: { index = index * sizeof mData._data.mInteralTHDRTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 19: { index = index * sizeof mData._data.mInternalCondSnsrTemp ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 20: { index = index * sizeof mData._data.mBaroTempSensor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - + case 2: { index = index * sizeof mData._data.mHeatDisinfect ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mOutletPrimaryHeater ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mConductivitySensor1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mConductivitySensor2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mOutletRedundancy ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mInletDialysate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 8: { index = index * sizeof mData._data.mPrimaryHeaterThermoCouple; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 9: { index = index * sizeof mData._data.mTrimmerHeaterThermoCouple; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 10: { index = index * sizeof mData._data.mPrimaryHeaterColdJunction; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 11: { index = index * sizeof mData._data.mTrimmerHeaterColdJunction; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 12: { index = index * sizeof mData._data.mPrimaryHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 13: { index = index * sizeof mData._data.mTrimmerHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 14: { index = index * sizeof mData._data.mFpgaBoard ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 15: { index = index * sizeof mData._data.mLoadCellA1B1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 16: { index = index * sizeof mData._data.mLoadCellA2B2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 17: { index = index * sizeof mData._data.mInternalTHDORTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 18: { index = index * sizeof mData._data.mInternalTDIRTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 19: { index = index * sizeof mData._data.mInteralTHDRTD ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 20: { index = index * sizeof mData._data.mInternalCondSnsrTemp ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 21: { index = index * sizeof mData._data.mBaroTempSensor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; @@ -1888,77 +1795,26 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentParametersResp data definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentParametersResp_data() { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43" "44")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" )); - QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mBloodFlowRate") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); - QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); - QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); - QTest::newRow("mDialysateFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("duration") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); - QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); - QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); - QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); - QTest::newRow("mHeparinDispensingRate") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); - QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); - QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); - QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); - QTest::newRow("mHeparinBolusVolume") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); - QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); - QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); - QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); - QTest::newRow("mHeparinStopTime") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); - QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); - QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); - QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); - QTest::newRow("mSalineBolus") << 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); - QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); - QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20")); - QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21")); - QTest::newRow("mAcidConcentrate") << 9 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22")); - QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23")); - QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24")); - QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25")); - QTest::newRow("mBicarbonateConcentrate") << 10 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26")); - QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27")); - QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28")); - QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29")); - QTest::newRow("mDialyzerType") << 11 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A")); - QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C")); - QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D")); - QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E")); - QTest::newRow("mDialysateTemp") << 12 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F")); - QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30")); - QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31")); - QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32")); - QTest::newRow("mArterialPressureLimitWindow") << 13 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33")); - QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" )); - QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35")); - QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" )); - QTest::newRow("mVenousPressureLimitWindow") << 14 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37")); - QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" )); - QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" )); - QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A")); - QTest::newRow("mVenousPressureLimitAsymtrc") << 15 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" )); - QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" )); - QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" )); - QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" )); - QTest::newRow("mBloodPressureMeasureInterval") << 16 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" )); - QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" )); - QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41")); - QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" )); - QTest::newRow("mRinsebackFlowRate") << 17 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2B" "2C" "2D" "2E" "2F" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "3A" "3B" "3C" "3D" "3E" "3F" "40" "41" "42" "43")); + HelperFunctions_tstModel::generate_ByteDataSet( { + "mAccepted ", + "mBloodFlowRate ", + "mDialysateFlowRate ", + "mDuration ", + "mHeparinStopTime ", + "mSalineBolus ", + "mAcidConcentrate ", + "mBicarbonateConcentrate ", + "mDialyzerType ", + "mHeparinType ", + "mBloodPressureMeasureInterval ", + "mRinsebackFlowRate ", + "mArterialPressureLimitWindow ", + "mVenousPressureLimitWindow ", + "mVenousPressureLimitAsymtrc ", + "mHeparinDispensingRate ", + "mHeparinBolusVolume ", + "mDialysateTemp " + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentParametersResp test definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @@ -1982,24 +1838,26 @@ << "data: " << data; #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 2: { index = index * sizeof mData._data.mBloodFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 3: { index = index * sizeof mData._data.mDialysateFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 5: { index = index * sizeof mData._data.mHeparinDispensingRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 6: { index = index * sizeof mData._data.mHeparinBolusVolume ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 7: { index = index * sizeof mData._data.mHeparinStopTime ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 8: { index = index * sizeof mData._data.mSalineBolus ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 9: { index = index * sizeof mData._data.mAcidConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 10: { index = index * sizeof mData._data.mBicarbonateConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 11: { index = index * sizeof mData._data.mDialyzerType ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 12: { index = index * sizeof mData._data.mDialysateTemp ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 13: { index = index * sizeof mData._data.mArterialPressureLimitWindow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 14: { index = index * sizeof mData._data.mVenousPressureLimitWindow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 15: { index = index * sizeof mData._data.mVenousPressureLimitAsymtrc ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 16: { index = index * sizeof mData._data.mBloodPressureMeasureInterval ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; - case 17: { index = index * sizeof mData._data.mRinsebackFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 2: { index = index * sizeof mData._data.mBloodFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 3: { index = index * sizeof mData._data.mDialysateFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 5: { index = index * sizeof mData._data.mHeparinStopTime ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 6: { index = index * sizeof mData._data.mSalineBolus ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 7: { index = index * sizeof mData._data.mAcidConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 8: { index = index * sizeof mData._data.mBicarbonateConcentrate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 9: { index = index * sizeof mData._data.mDialyzerType ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 10: { index = index * sizeof mData._data.mHeparinType ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 11: { index = index * sizeof mData._data.mBloodPressureMeasureInterval ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 12: { index = index * sizeof mData._data.mRinsebackFlowRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 13: { index = index * sizeof mData._data.mArterialPressureLimitWindow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 14: { index = index * sizeof mData._data.mVenousPressureLimitWindow ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 15: { index = index * sizeof mData._data.mVenousPressureLimitAsymtrc ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 16: { index = index * sizeof mData._data.mHeparinDispensingRate ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 17: { index = index * sizeof mData._data.mHeparinBolusVolume ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + case 18: { index = index * sizeof mData._data.mDialysateTemp ; QVERIFY ( !mData.fromByteArray(data)); QCOMPARE(index, startIndex); } break; + default: QVERIFY2(false, "Incorrect Test"); break; } @@ -2223,91 +2081,45 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentLogResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentLogResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // -QByteArray helperFunction_createArray(int vCount) -{ - /* - * Based on the existing tests and test data, this helper function will reduce the need to copy-paste - * and creating data sets by hand. The function generates a QByteArray of elements "00"..."xx" up to - * vCount of them. - * - * Expected return for a vCount == 5 is: - * { "00" "01" "02" "03" "04" } - */ - QByteArray returnArray = {}; - for(int i = 0; i("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(36*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mBloodFlowRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mDialysateFlowRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTreatmentDuration" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mActualTreatmentDuration" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mAcidConcentrateType" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mBicarbonateConcentrateType", ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mPotassiumConcentration" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mCalciumConcentration" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mBicarbonateConcentration" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSodiumConcentration" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mDialysateTemperature" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mDialyzerType" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTreatmentStartEpoch" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTreatmentEndEpoch" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mAverageBloodFlow" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mAverageDialysateFlow" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mDialysateVolumeUsed" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mAverageDialysateTemp" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mOriginUFVolume" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTargetUFVolume" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mActualUFVolume" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mOriginUFRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTargetUFRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mActualUFRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSalineBolusVolume" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mHeparinBolusVolume" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mHeparinDispenseRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mHeparinStop" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mHeparinDeliveredVolume" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mHeparinType" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mAverageArterialPressure" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mAverageVenousPressure" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mDeviceID" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mWaterSampleTestResult" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { + "mAccepted" , + "mReason" , + "mBloodFlowRate" , + "mDialysateFlowRate" , + "mTreatmentDuration" , + "mActualTreatmentDuration" , + "mAcidConcentrateType" , + "mBicarbonateConcentrateType", + "mPotassiumConcentration" , + "mCalciumConcentration" , + "mBicarbonateConcentration" , + "mSodiumConcentration" , + "mDialysateTemperature" , + "mDialyzerType" , + "mTreatmentStartEpoch" , + "mTreatmentEndEpoch" , + "mAverageBloodFlow" , + "mAverageDialysateFlow" , + "mDialysateVolumeUsed" , + "mAverageDialysateTemp" , + "mOriginUFVolume" , + "mTargetUFVolume" , + "mActualUFVolume" , + "mOriginUFRate" , + "mTargetUFRate" , + "mActualUFRate" , + "mSalineBolusVolume" , + "mHeparinBolusVolume" , + "mHeparinDispenseRate" , + "mHeparinStop" , + "mHeparinDeliveredVolume" , + "mHeparinType" , + "mAverageArterialPressure" , + "mAverageVenousPressure" , + "mDeviceID" , + "mWaterSampleTestResult" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentLogResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustTreatmentLogResponse() { @@ -2370,29 +2182,20 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDSyringePump ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDSyringePump data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // - void tst_models::tst_MHDSyringePump_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11*4)); - QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mSyringePumpState ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mHeparinState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSetRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSyringePumpPosition" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mVolumeDelivered" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredHome" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredSwitch" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mMeasuredForce" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSafetyVol" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mStatus" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { + "mSyringePumpState " , + "mHeparinState" , + "mSetRate" , + "mMeasuredRate" , + "mSyringePumpPosition" , + "mVolumeDelivered" , + "mMeasuredHome" , + "mMeasuredSwitch" , + "mMeasuredForce" , + "mSafetyVol" , + "mStatus" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDSyringePump test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDSyringePump() { @@ -2432,18 +2235,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDBloodLeakData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDBloodLeakData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mBloodLeakStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mBloodLeakState" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet({"mBloodLeakStatus", "mBloodLeakState"}); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDBloodLeakData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDBloodLeakData() { @@ -2475,18 +2267,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirTrapData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirTrapData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAirTrapLowerLevel ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mAirTrapUpperLevel" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAirTrapLowerLevel", "mAirTrapUpperLevel" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirTrapData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirTrapData() { @@ -2517,25 +2298,17 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAccelerometer data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAccelerometer_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); - QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mX ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mY" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mZ" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mXMax" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mYMax" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mZMax" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mXTilt", ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mYTilt", ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mZTilt", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { + "mX" , + "mY" , + "mZ" , + "mXMax" , + "mYMax" , + "mZMax" , + "mXTilt", + "mYTilt", + "mZTilt" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAccelerometer test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAccelerometer() { @@ -2575,26 +2348,34 @@ void tst_models::tst_MHDUsageInfoResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); + QTest::addColumn("expectedIndex"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(5*4)); - QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mTotalTxHours ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + int errorIndex = 1; + int lastCount = 0; - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mTotalTxHoursSinceLastService" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mEpochOfStartOfLastTx" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mEpochOfLastRecordReset" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mCrc" , ++errorIndex_index, lastElementCount+1); + // The "msg complete" has a total of 4*4+2 bytes since four 32-bits (or 4-bytes) and one 16-bits ( or 2 byte) + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(HelperFunctions_tstModel::createByteDataArray(4*4+2))<< 0; + + // These parameters are U32 + lastCount = HelperFunctions_tstModel::addRowsForByteData("mTotalTxHours ", errorIndex, 0, (errorIndex-1)*4); errorIndex++; + lastCount = HelperFunctions_tstModel::addRowsForByteData("mTotalTxHoursSinceLastService ", errorIndex, lastCount+1, (errorIndex-1)*4); errorIndex++; + lastCount = HelperFunctions_tstModel::addRowsForByteData("mEpochOfStartOfLastTx ", errorIndex, lastCount+1, (errorIndex-1)*4); errorIndex++; + lastCount = HelperFunctions_tstModel::addRowsForByteData("mEpochOfLastRecordReset ", errorIndex, lastCount+1, (errorIndex-1)*4); errorIndex++; + + // This parameter is U16 + // This function adds eight 1-bit incremented rows. + lastCount = HelperFunctions_tstModel::addTestDataRow_bitRows("mCrc", errorIndex, (errorIndex-1)*4*8, (errorIndex-1)*4); + + return; } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDUsageInfoResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDUsageInfoResponse() { Model::MHDUsageInfoResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); + QFETCH(int , expectedIndex ); int startIndex = 0; int index = errorIndex - 1; @@ -2605,12 +2386,12 @@ #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mTotalTxHours ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mTotalTxHoursSinceLastService ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mEpochOfStartOfLastTx ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mEpochOfLastRecordReset ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 5: { index = index * sizeof mData._data.mCrc ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mTotalTxHours ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mTotalTxHoursSinceLastService ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mEpochOfStartOfLastTx ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mEpochOfLastRecordReset ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mCrc ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; @@ -2621,18 +2402,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirBubbleData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirBubbleData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11*4)); - QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mVenousAirBubbleStatus ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mVenousAirBubbleState" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mVenousAirBubbleStatus", "mVenousAirBubbleState" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDAirBubbleData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDAirBubbleData() { @@ -2663,28 +2433,20 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentStates data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentStates_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); + HelperFunctions_tstModel::generate_ByteDataSet( { + "mSubMode" , + "mWaterSampleState" , + "mSelfTestConsumablesState" , + "mSelfTestNoCartridgeState" , + "mInstallationState" , + "mSelfTestDryState" , + "mPrimeState" , + "mRecirculateState" , + "mPatientConnectionState" , + "mWetSelfTestsState" , + "mPreTreatmentRsrvrState" + }); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(11*4)); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mWaterSampleState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSelfTestConsumablesState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSelfTestNoCartridgeState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mInstallationState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mSelfTestDryState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mPrimeState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mRecirculateState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mPatientConnectionState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mWetSelfTestsState" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mPreTreatmentRsrvrState" , ++errorIndex_index, lastElementCount+1); - } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentStates test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentStates() { @@ -2725,19 +2487,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestNoCartridge data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestNoCartridge_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mCountdown" , ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mTimeout", "mCountdown" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestNoCartridge test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestNoCartridge() { @@ -2768,19 +2518,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestDry data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestDry_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mTimeout ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mCountdown" , ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mTimeout", "mCountdown" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPreTreatmentSelfTestDry test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPreTreatmentSelfTestDry() { @@ -2811,19 +2549,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPostTreatmentStates data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPostTreatmentStates_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mSubMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mDrainState" , ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mSubMode ", "mDrainState" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPostTreatmentStates test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MPostTreatmentStates() { @@ -2854,19 +2580,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStop data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentStop_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mCountDown" , ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mTotal", "mCountDown" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStop test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentStop() { @@ -2897,22 +2611,14 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRinseback data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRinseback_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(6*4)); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mCurrent" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTimeoutTotal" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTimeoutCountDown" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mIsCompleted" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { + "mTarget " , + "mCurrent" , + "mRate" , + "mTimeoutTotal" , + "mTimeoutCountDown" , + "mIsCompleted" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRinseback test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRinseback() { @@ -2948,18 +2654,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRecirculate data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRecirculate_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mTimeoutTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mTimeoutCountDown" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mTimeoutTotal", "mTimeoutCountDown" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentRecirculate test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentRecirculate() { @@ -2991,18 +2686,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentBloodPrime data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentBloodPrime_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mTarget ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mCurrent" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mTarget", "mCurrent" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentBloodPrime test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentBloodPrime() { @@ -3034,19 +2718,11 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogEventData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogEventData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mEventID ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mOldValue" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mNewValue" , ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { + "mEventID" , + "mOldValue" , + "mNewValue" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogEventData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogEventData() { @@ -3079,22 +2755,13 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAvrgeData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAvrgeData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(5*4)); - QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mBloodFlowRate ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mDialysateFlowRate", ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mUFRate" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mArterialPressure" , ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mVenousPressure" , ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { + "mBloodFlowRate" , + "mDialysateFlowRate", + "mUFRate" , + "mArterialPressure" , + "mVenousPressure" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAvrgeData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAvrgeData() { @@ -3129,20 +2796,11 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAlarmData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAlarmData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAlarmID ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mParam1", ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mParam2", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { + "mAlarmID", + "mParam1" , + "mParam2" + } ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentLogAlarmData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MTreatmentLogAlarmData() { @@ -3176,14 +2834,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDRTCEpochData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDRTCEpochData_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(1*4)); - QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + HelperFunctions_tstModel::generate_ByteDataSet( { "mEpoch" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDRTCEpochData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // @@ -3213,21 +2864,8 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostSingleResult ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostSingleResult data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // - void tst_models::tst_MHDPostSingleResult_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mIndex", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mResult", "mIndex" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostSingleResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDPostSingleResult() { @@ -3258,15 +2896,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostFinalResult ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostFinalResult data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDPostFinalResult_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mResult ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mResult"}); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDPostFinalResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MHDPostFinalResult() { @@ -3295,19 +2925,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDAlarmVolumeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDAlarmVolumeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDAlarmVolumeResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason"}); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDAlarmVolumeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDAlarmVolumeResponse() { @@ -3338,19 +2956,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDDateTimeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDDateTimeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDDateTimeResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason"}); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustHDDateTimeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustHDDateTimeResponse() { @@ -3381,19 +2987,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceModeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceModeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceModeResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason"}); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceModeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceModeResponse() { @@ -3423,55 +3017,66 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsHDResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsHDResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // - void tst_models::tst_MAdjustVersionsHDResponse_data () { + QTest::addColumn("errorIndex"); QTest::addColumn("data"); + QTest::addColumn("expectedIndex"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(9*4)); - QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("0")); - QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mMajor ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + int errorIndex = 1; - 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); + // The "msg complete" has a total of 9+4 bytes since nine u8 (or 1-bytes) and one U32 ( or 4 bytes) + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(HelperFunctions_tstModel::createByteDataArray(9+4))<< 0; + + QTest::newRow("mMajor") << errorIndex << QByteArray() << 0; + int currentBit = 1; + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMajor ", errorIndex++, currentBit, 1); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMinor ", errorIndex++, currentBit, 2); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMicro ", errorIndex++, currentBit, 3); + + // mBuild is U16, this requires us to add two sets of 8-bits. + // The first set of 8-bit, the expected index is data-index less 1 since it's not possible to get the full 16-bits + // yet. When we add the second byte's bits, the expected index is 5 since we are handling full bytes not partials + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mBuild ", errorIndex++, currentBit, 3); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mBuild ", errorIndex++, currentBit, 5); + + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGAId ", errorIndex++, currentBit, 6); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGAMajor ", errorIndex++, currentBit, 7); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGAMinor ", errorIndex++, currentBit, 8); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGALab ", errorIndex++, currentBit, 9); + + // U32 parameter - expecting one short to check for "false" case only + (void) HelperFunctions_tstModel::addRowsForByteData("mCompatibilityRev", errorIndex, currentBit/8, 9); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsHDResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustVersionsHDResponse() { Model::MAdjustVersionsHDResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); + QFETCH(int , expectedIndex ); int startIndex = 0; - int index = errorIndex - 1; + int index = errorIndex; // Note: this is not being use in test, but only to show which param is being checked bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) + #ifdef CONSOLEOUT qDebug() << " index " << index << " errorIndex " << errorIndex <<" startIndex "<< startIndex << " ok "<< ok << data ; #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mMajor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mMinor ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mBuild ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 5: { index = index * sizeof mData._data.mFPGAId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 6: { index = index * sizeof mData._data.mFPGAMajor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 7: { index = index * sizeof mData._data.mFPGAMinor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 8: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 9: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 10: { index = index * sizeof mData._data.mCompatibilityRev ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mBuild ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mFPGAId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mFPGAMajor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mFPGAMinor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 8: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 9: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 10: { index = index * sizeof mData._data.mCompatibilityRev ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); @@ -3482,19 +3087,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesHDResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesHDResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceDatesHDResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mLastServiceDateEpoch ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mServiceIntervalSeconds", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mLastServiceDateEpoch", "mServiceIntervalSeconds" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesHDResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceDatesHDResponse() { @@ -3525,19 +3118,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRinsebackResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRinsebackResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRinsebackResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRinsebackResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRinsebackResponse() { @@ -3568,19 +3149,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRecirculateResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRecirculateResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRecirculateResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustRecirculateResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustRecirculateResponse() { @@ -3612,19 +3181,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentEndResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentEndResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustTreatmentEndResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustTreatmentEndResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustTreatmentEndResponse() { @@ -3655,19 +3212,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustSalineResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustSalineResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustSalineResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); - lastElementCount = helperFunction_addSetOfFour_rows("mTarget", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason", "mTarget"}); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustSalineResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustSalineResponse() { @@ -3699,18 +3244,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustWaterSampleResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustWaterSampleResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustWaterSampleResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustWaterSampleResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustWaterSampleResponse() { @@ -3741,18 +3275,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustStartTreatmentResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustStartTreatmentResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustStartTreatmentResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(3*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustStartTreatmentResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustStartTreatmentResponse() { @@ -3783,18 +3306,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionConfirmResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionConfirmResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionConfirmResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionConfirmResponse() { @@ -3825,18 +3337,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionBeginResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionBeginResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionBeginResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientConnectionBeginResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientConnectionBeginResponse() { @@ -3868,18 +3369,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesPrimeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesPrimeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesPrimeResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesPrimeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesPrimeResponse() { @@ -3910,18 +3400,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesConfirmResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesConfirmResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesConfirmResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesConfirmResponse() { @@ -3952,18 +3431,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectStartResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectStartResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectStartResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectStartResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectStartResponse() { @@ -3994,18 +3462,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectModeResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectModeResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectModeResponse_data () { - QTest::addColumn("errorIndex"); - QTest::addColumn("data"); - - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(helperFunction_createArray(2*4)); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - - int lastElementCount = 3; // The number of elements in the last row - int errorIndex_index = 1; // the errorIndex of the current string key - lastElementCount = helperFunction_addSetOfFour_rows("mReason", ++errorIndex_index, lastElementCount+1); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisinfectModeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisinfectModeResponse() { @@ -4036,18 +3493,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustPatientDisconnectionConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustPatientDisconnectionConfirmResponse() { @@ -4078,18 +3524,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDisposablesRemovalConfirmResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDisposablesRemovalConfirmResponse() { @@ -4121,29 +3556,20 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); - + HelperFunctions_tstModel::generate_ByteDataSet( { + "mAccepted" , + "mReason" , + "mAlarmID0" , + "mAlarmID1" , + "mAlarmID2" , + "mAlarmID3" , + "mAlarmID4" , + "mAlarmID5" , + "mAlarmID6" , + "mAlarmID7" , + "mAlarmID8" , + "mAlarmID9" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmActiveListResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmActiveListResponse() { @@ -4185,14 +3611,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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")); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAlarmID" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAlarmClearedCondition test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAlarmClearedCondition() { @@ -4223,27 +3642,18 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); - + HelperFunctions_tstModel::generate_ByteDataSet( { + "mRoWaterGenTotalL" , + "mRoWaterGenSinceLastServiceL" , + "mLastBasicFlushCompleteDateEpoch" , + "mLastChemDisStartDateEpoch" , + "mLastChemDisCompleteDateEpoch" , + "mLastChemDisFlushCompleteDateEpoch" , + "mLastHeatDisCompleteDateEpoch" , + "mLastHeatActiveCoolCompleteDateEpoch" , + "mLastFilterFlushCompleteDateEpoch" , + "mLastResetTimeEpoch" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGCleaningUsageResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDGCleaningUsageResponse() { @@ -4282,18 +3692,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustDGDateTimeResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustDGDateTimeResponse() { @@ -4324,18 +3723,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mLastServiceDateEpoch", "mServiceIntervalSeconds" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustServiceDatesDGResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustServiceDatesDGResponse() { @@ -4366,54 +3754,66 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsDGResponse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsDGResponse data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MAdjustVersionsDGResponse_data () { +void tst_models::tst_MAdjustVersionsDGResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); + QTest::addColumn("expectedIndex"); - 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 lastFlag = 0; + int errorIndex = 1; - 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); + // The "msg complete" has a total of 9+4 bytes since nine u8 (or 1-bytes) and one U32 ( or 4 bytes) + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(HelperFunctions_tstModel::createByteDataArray(9+4))<< 0; + QTest::newRow("mMajor") << errorIndex << QByteArray() << 0; + int currentBit = 1; + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMajor ", errorIndex++, currentBit, 1); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMinor ", errorIndex++, currentBit, 2); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMicro ", errorIndex++, currentBit, 3); + + // mBuild is U16, this requires us to add two sets of 8-bits. + // The first set of 8-bit, the expected index is data-index less 1 since it's not possible to get the full 16-bits + // yet. When we add the second byte's bits, the expected index is 5 since we are handling full bytes not partials + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mBuild ", errorIndex++, currentBit, 3); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mBuild ", errorIndex++, currentBit, 5); + + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGAId ", errorIndex++, currentBit, 6); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGAMajor ", errorIndex++, currentBit, 7); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGAMinor ", errorIndex++, currentBit, 8); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFPGALab ", errorIndex++, currentBit, 9); + + // U32 parameter - expecting one short to check for "false" case only + (void) HelperFunctions_tstModel::addRowsForByteData("mCompatibilityRev", errorIndex, currentBit/8, 9); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAdjustVersionsDGResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MAdjustVersionsDGResponse() { Model::MAdjustVersionsDGResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); + QFETCH(int , expectedIndex ); int startIndex = 0; - int index = errorIndex - 1; + int index = errorIndex; // Note: this is not being use in test, but only to show which param is being checked 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; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mMicro ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mBuild ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mFPGAId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mFPGAMajor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mFPGAMinor; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 8: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 9: { index = index * sizeof mData._data.mFPGALab ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 10: { index = index * sizeof mData._data.mCompatibilityRev ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); @@ -4425,18 +3825,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted" , "mReason" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetRoWaterModeDGr test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDuetRoWaterModeDGr() { @@ -4468,30 +3857,20 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mRORejectionRatio" , + "mCPi" , + "mCPo" , + "mCD1" , + "mCD2" , + "mCPiRaw" , + "mCPoRaw" , + "mCD1Raw" , + "mCD2Raw" , + "mCPiSensorStatus" , + "mCPoSensorStatus" , + "mCD1SensorStatus" , + "mCD2SensorStatus" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGConductivityData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGConductivityData() { @@ -4533,25 +3912,16 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mX" , + "mY" , + "mZ" , + "mXMax" , + "mYMax" , + "mZMax" , + "mXTilt", + "mYTilt", + "mZTilt" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGAccelerometer test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGAccelerometer() { @@ -4588,18 +3958,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mTimeout", "mCountdown" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGFilterFlush test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGFilterFlush() { @@ -4629,18 +3988,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); + HelperFunctions_tstModel::generate_ByteDataSet( { "mResult", "mIndex" }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostSingleResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGPostSingleResult() { @@ -4670,14 +4018,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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")); + HelperFunctions_tstModel::generate_ByteDataSet( { "mResult"}); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDGPostFinalResult test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDGPostFinalResult() { @@ -4708,35 +4049,58 @@ void tst_models::tst_MUIBloodPressure_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); + QTest::addColumn("expectedIndex"); - 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 lastFlag = 0; + int errorIndex = 1; - 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); + // The "msg complete" has a total of 7*1 + 6*2 ( seven 1-byte and six 2-byte parameters) + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(HelperFunctions_tstModel::createByteDataArray(7*1 + 6*2))<< 0; + QTest::newRow("mMajor") << errorIndex << QByteArray() << 0; + int currentBit = 1; + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mFlags ", errorIndex++, currentBit, 1); + + // mBuild is U16, this requires us to add two sets of 8-bits. + // The first set of 8-bit, the expected index is data-index less 1 since it's not possible to get the full 16-bits + // yet. When we add the second byte's bits, the expected index is 5 since we are handling full bytes not partials + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mSystolic ", errorIndex, currentBit, 1); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mSystolic ", errorIndex++, currentBit, 3); + + // U16 + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mDiastolic ", errorIndex, currentBit, 3); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mDiastolic ", errorIndex++, currentBit, 5); + + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMeanArterial ", errorIndex, currentBit, 5); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMeanArterial ", errorIndex++, currentBit, 7); + + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mYear ", errorIndex, currentBit, 7); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mYear ", errorIndex++, currentBit, 9); + + // U8 + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMonth ", errorIndex++, currentBit, 10); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mDay ", errorIndex++, currentBit, 11); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mHour ", errorIndex++, currentBit, 12); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mMinute ", errorIndex++, currentBit, 13); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mSecond ", errorIndex++, currentBit, 14); + + // U16 + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mPulseRate ", errorIndex, currentBit, 14); + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mPulseRate ", errorIndex++, currentBit, 16); + + // U8 + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mUserId ", errorIndex++, currentBit, 17); + + // U16 - Since this is the last one, only considering the failed case of GetValue(), not handling second half of the U16 + currentBit = HelperFunctions_tstModel::addTestDataRow_bitRows("mStatus ", errorIndex, currentBit, 17); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MUIBloodPressure test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MUIBloodPressure() { Model::MUIBloodPressure mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); + QFETCH(int , expectedIndex ); int startIndex = 0; int index = errorIndex - 1; @@ -4747,20 +4111,20 @@ #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; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mFlags ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mSystolic ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mDiastolic ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mMeanArterial ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mYear ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mMonth ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mDay ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 8: { index = index * sizeof mData._data.mHour ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 9: { index = index * sizeof mData._data.mMinute ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 10: { index = index * sizeof mData._data.mSecond ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 11: { index = index * sizeof mData._data.mPulseRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 12: { index = index * sizeof mData._data.mUserId ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; + case 13: { index = index * sizeof mData._data.mStatus ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( expectedIndex, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); @@ -4772,20 +4136,10 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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); - + HelperFunctions_tstModel::generate_ByteDataSet( { "mId" , + "mCommand" , + "mReason" + }); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDuetConfirmHDi test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MDuetConfirmHDi() { Index: unittests/tst_models.h =================================================================== diff -u -r914a8c335771f23cc98780cfd5b0a48c9b44a3b9 -rded9f686d2c96837cc4a23f54a917d04cd257bd4 --- unittests/tst_models.h (.../tst_models.h) (revision 914a8c335771f23cc98780cfd5b0a48c9b44a3b9) +++ unittests/tst_models.h (.../tst_models.h) (revision ded9f686d2c96837cc4a23f54a917d04cd257bd4) @@ -260,4 +260,229 @@ void tst_MAlarmCleared_data(); void tst_MAlarmCleared(); void tst_MAlarmAcknowledgeRequest(); + +private: + class HelperFunctions_tstModel + { + protected: + explicit HelperFunctions_tstModel() {} + + public : + /* + * generateDataSet + * @params vDataNames - the list of string names of the data structure's member variable. + * + * @brief The main purpose of this function is to properly generate the QTest::newRow for data used in the testing + * This function is making use of two additional helper functions that will create the appropriate test data + * + * For example, if the Model::MSomeExampleModel has a data structure that is: + * struct { + * Types::U32 mAccepted ; + * Types::U32 mReason ; + * Types::U32 mBloodFlowRate ; + * Types::U32 mDialysateFlowRate ; + * } _data; + * + * We would expect the data set to be the following: + * QTest::addColumn("errorIndex"); + * QTest::addColumn("data"); + * QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + * QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); + * QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); + * QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + * QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + * QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + * QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + * QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + * QTest::newRow("mReason ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + * QTest::newRow("mBloodFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + * QTest::newRow("mBloodFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + * QTest::newRow("mBloodFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + * QTest::newRow("mBloodFlowRate") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + * QTest::newRow("mDialysateFlowRate") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + * QTest::newRow("mDialysateFlowRate") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + * QTest::newRow("mDialysateFlowRate") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + * QTest::newRow("mDialysateFlowRate") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + * + * This function is called as : + * HelperFunctions_tstModel::generate_ByteDataSet( { "mAccepted", "mReason", "mBloodFlowRate", "mDialysateFlowRate" } ); + * + * Overall Structure: + * - There are two columns: errorIndex and data. + * - The row with the dataTag as "msg complete" will contain the number of variables * 4 (bytes), which is a complete message with all the data elements + * - The first parameter is handled as a special case where it will contain a zero array, a one, two, three element array. + * - All the other parameters beyond the first one contains four rows, where each row contains one more element than the last to build up from an incomplete + * data element. + * - The errorIndex only incrementals with each set of four rows. + * + * - totalNameLength overrides the total length count of dataNames for the "msg complete" data set. default, it uses the length of the passed QStringList + */ + static int generate_ByteDataSet(const QStringList& vDataNames, int totalNameLength = -1 ) + { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + + int errorIndex = 0; + const int totalLengthForComplete = totalNameLength > 0 ? totalNameLength : vDataNames.length(); + QTest::newRow("msg complete") << errorIndex << QByteArray::fromHex(createByteDataArray(totalLengthForComplete*4)); + + // Special case for the first parameter of the data list: + errorIndex++; // increment vErrorIndex to 1 + QTest::newRow(vDataNames.at(0).toUtf8()) << errorIndex << QByteArray::fromHex(QByteArray()); + QTest::newRow(vDataNames.at(0).toUtf8()) << errorIndex << QByteArray::fromHex(QByteArray("00")); + QTest::newRow(vDataNames.at(0).toUtf8()) << errorIndex << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow(vDataNames.at(0).toUtf8()) << errorIndex << QByteArray::fromHex(QByteArray("00" "01" "02")); + + // do the newRow for the rest of the parameters + int lastElementCount = 3; // The number of elements in the last row + for(int dataNameIndex = 1; dataNameIndex < vDataNames.length(); dataNameIndex++) + { + errorIndex++; // increment the error index for each set of 4 rows + QString paramName = vDataNames.at(dataNameIndex); + lastElementCount = addRowsForByteData(paramName.toUtf8(), errorIndex, lastElementCount+1); + } + return errorIndex; + } + + + /* + * addBit_Data + * @params dataTag - the row tag + * @params errorIndexStart - the starting index for errorIndex variable/column + * @params flagStartAt - The initial starting point to set flag to true + * @params totalRows - the total number of rows to generate, default is 8 rows for 8-bits + * + * @brief The main purpose of this function is to properly generate the QTest::newRow for data used in the testing + * This function is making use of one additional helper function that will convert the bit array to a byte array before + * inserting into the row + * + * For example, if the Model::MSomeExampleModel has a data structure that is: + * struct { + * Types::U8 mAccepted ; + * } _data; + * + * We would expect the data set to be the following: + * QTest::addColumn("errorIndex"); + * QTest::addColumn("data"); + * QTest::newRow("mAccepted ") << 1 << converted_bitArray(one_byte_first_bit_set); + * QTest::newRow("mAccepted ") << 1 << converted_bitArray(one_byte_second_bit_set); + * QTest::newRow("mAccepted ") << 1 << converted_bitArray(one_byte_third_bit_set); + * ...and so on for 8 rows, since 8-bits = 1 byte + * + * This function is called as : + * HelperFunctions::addBit_Data( "mAccepted", 0, 0); // default 8-bits so 8 rows + * + * Overall Structure: + * - There are two columns: errorIndex and data. + * -- if vExpectedIndex is not negative, it is expected that there are three columns (errorIndex, data, and expectedIndex) + */ + static int addTestDataRow_bitRows(const QString& vDataTag, const int vErrorIndex, const int vBitCount, const int vExpectedIndex = -1) + { + int currentBitCount = vBitCount; + for(int i=0; i<8; i++) + { + if(vExpectedIndex < 0) + { + QTest::newRow(vDataTag.toUtf8()) << vErrorIndex << HelperFunctions_tstModel::makeByteArray(currentBitCount++); + } + else + { + QTest::newRow(vDataTag.toUtf8()) << vErrorIndex << HelperFunctions_tstModel::makeByteArray(currentBitCount++) << vExpectedIndex; + } + } + return currentBitCount; + } + + static int generate_bitDataRow(const QString& vDataTag, const int vErrorIndexStart, const int vFlagStartAt, const int vTotalRows = 8) + { + int currentFlags = 0; + for(int rowCountIndex = 0; rowCountIndex < vTotalRows; rowCountIndex++) + { + currentFlags = vFlagStartAt + rowCountIndex; + QTest::newRow(vDataTag.toUtf8()) << vErrorIndexStart << makeByteArray(currentFlags); + } + return currentFlags; + } + + static QByteArray makeByteArray(const int vNumberOfBits, bool vDefaultSet = true) + { + QBitArray flag(vNumberOfBits, vDefaultSet); + QByteArray dataByteArray = bitsToBytes(flag); + return dataByteArray; + } + + static QByteArray createByteDataArray(int vCount) + { + /* + * Based on the existing tests and test data, this helper function will reduce the need to copy-paste + * and creating data sets by hand. The function generates a QByteArray of elements "00"..."xx" up to + * vCount of them. + * + * Expected return for a vCount == 5 is: + * { "00" "01" "02" "03" "04" } + */ + QByteArray returnArray = {}; + for(int i = 0; i int expectedIndex + */ + int elementCount = vStartArrayCount; + if(vExpectedIndex < 0) + { + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)); elementCount++; + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)); elementCount++; + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)); elementCount++; + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)); + } else { + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)) << vExpectedIndex; elementCount++; + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)) << vExpectedIndex; elementCount++; + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)) << vExpectedIndex; elementCount++; + QTest::newRow(vKey) << vErrorIndex << QByteArray::fromHex(createByteDataArray(elementCount)) << vExpectedIndex; + } + return elementCount; // returns the last element count used + } + private: + static QByteArray bitsToBytes(QBitArray bits) { + /* + * Converts a QBitArray to a QByteArray + * + */ + QByteArray bytes; + + // Determine if there is a partially full byte + bool isPartialByteExist = (bits.count() % 8) > 0 ; + int addPartialByte = isPartialByteExist ? 1 : 0; + int fullBytesCount = bits.count() / 8 ; + + // Resize byte array to fit expected bytes for bits passed + bytes.resize(fullBytesCount + addPartialByte); + + // initialize with 0s + bytes.fill(0); + + // copy the bits into the byte array based on index + for(int bit = 0; bit < bits.count(); ++bit) + bytes[bit/8] = ( bytes.at(bit/8) | ((bits[bit]?1:0)<<(bit%8))); + + return bytes; + } + + }; };