Index: denali.pro.user =================================================================== diff -u -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 -ra3f457785f86bd41a4df1dd3c6ca7300d5fca38e --- denali.pro.user (.../denali.pro.user) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) +++ denali.pro.user (.../denali.pro.user) (revision a3f457785f86bd41a4df1dd3c6ca7300d5fca38e) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -1185,7 +1185,7 @@ true false - /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Release + /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Debug 1 Index: unittests/tst_models.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -ra3f457785f86bd41a4df1dd3c6ca7300d5fca38e --- unittests/tst_models.cpp (.../tst_models.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision a3f457785f86bd41a4df1dd3c6ca7300d5fca38e) @@ -52,7 +52,7 @@ #include "MTreatmentParameters.h" #include "MTreatmentParametersResp.h" -// #define CONSOLEOUT +#undef CONSOLEOUT /*! * \brief tst_models::tst_models @@ -229,8 +229,19 @@ { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mState ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); } void tst_models::tst_MAdjustUltrafiltrationStateResponse () @@ -249,8 +260,10 @@ #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 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; @@ -1707,7 +1720,7 @@ void tst_models::tst_MSalineBolusResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray()); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00")); QTest::newRow("mAccepted ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); @@ -1720,6 +1733,10 @@ QTest::newRow("mTarget ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); QTest::newRow("mTarget ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); QTest::newRow("mTarget ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mState ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MSalineBolusResponse test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // void tst_models::tst_MSalineBolusResponse() { @@ -1741,6 +1758,7 @@ case 1: { index = index * sizeof mData._data.mAccepted; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; case 3: { index = index * sizeof mData._data.mTarget ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; Index: unittests/tst_views.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -ra3f457785f86bd41a4df1dd3c6ca7300d5fca38e --- unittests/tst_views.cpp (.../tst_views.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ unittests/tst_views.cpp (.../tst_views.cpp) (revision a3f457785f86bd41a4df1dd3c6ca7300d5fca38e) @@ -49,21 +49,22 @@ // try rejected v.adjustment_Accepted(false); - v.isPaused(true); + // SALINE_BOLUS_STATE_IDLE = 0, + // SALINE_BOLUS_STATE_WAIT_FOR_PUMPS_STOP + // SALINE_BOLUS_STATE_IN_PROGRESS, + // SALINE_BOLUS_STATE_MAX_DELIVERED, + // if not accepted and a reason passed then the parent should translate it and return v.adjustment_Reason(GuiRequestReasons::REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE); QCOMPARE(v.text(), tr("REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE")); - // if not accepted and not a reason passed then general message will be returned regarding the paused state - v.isPaused(true); - v.adjustment_Reason(GuiRequestReasons::REQUEST_REJECT_REASON_NONE); - QCOMPARE(v.text(), tr("Unable to Resume Ultrafiltration or already running")); + // if not accepted and not running + v.adjustment_Reason(GuiRequestReasons::REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS); + QCOMPARE(v.text(), tr("REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS")); - // if not accepted and not a reason passed then general message will be returned regarding the paused state - v.isPaused(false); - v.adjustment_Reason(GuiRequestReasons::REQUEST_REJECT_REASON_NONE); - QCOMPARE(v.text(), tr("Unable to Pause Ultrafiltration or already paused")); - v.isPaused(false); + // if not accepted and not paused + v.adjustment_Reason(GuiRequestReasons::REQUEST_REJECT_REASON_UF_NOT_PAUSED); + QCOMPARE(v.text(), tr("REQUEST_REJECT_REASON_UF_NOT_PAUSED")); } /*!