Index: denali.pro.user =================================================================== diff -u -re23f7e606dc9ed8247a68a3aba7b61e4544e7460 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- denali.pro.user (.../denali.pro.user) (revision e23f7e606dc9ed8247a68a3aba7b61e4544e7460) +++ denali.pro.user (.../denali.pro.user) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -93,23 +93,19 @@ 0 0 + true + 2 /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Debug + /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Debug true - qmake - QtProjectManager.QMakeBuildStep - false false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -125,8 +121,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -142,30 +136,26 @@ 2 false - Debug Debug Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /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-Release true - qmake - QtProjectManager.QMakeBuildStep - false false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -181,8 +171,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -198,30 +186,26 @@ 2 false - Release Release Qt4ProjectManager.Qt4BuildConfiguration 0 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_threads + /home/denali/Projects/tmp/build/unittest/tst_threads true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_threads CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -234,35 +218,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -273,8 +249,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -292,30 +266,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_threads tst_threads Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_messaging + /home/denali/Projects/tmp/build/unittest/tst_messaging true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_messaging CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -328,35 +298,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -367,8 +329,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -386,30 +346,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_messaging tst_messaging Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Profile + /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Profile true - qmake - QtProjectManager.QMakeBuildStep - false true - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -425,8 +381,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -442,30 +396,26 @@ 2 false - Profile Profile Qt4ProjectManager.Qt4BuildConfiguration 0 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_canbus + /home/denali/Projects/tmp/build/unittest/tst_canbus true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_canbus CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -478,35 +428,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -517,8 +459,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -536,30 +476,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_canbus tst_canbus Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_logging + /home/denali/Projects/tmp/build/unittest/tst_logging true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_logging CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -572,35 +508,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -611,8 +539,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -630,30 +556,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_logging tst_logging Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_utilities + /home/denali/Projects/tmp/build/unittest/tst_utilities true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_utilities CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -666,35 +588,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -705,8 +619,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -724,30 +636,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_utilities tst_utilities Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_acknow + /home/denali/Projects/tmp/build/unittest/tst_acknow true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_acknow CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -760,35 +668,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -799,8 +699,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -818,30 +716,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_acknow tst_acknow Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_models + /home/denali/Projects/tmp/build/unittest/tst_models true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_models CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -854,35 +748,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -893,8 +779,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -912,30 +796,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_models tst_models Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_initializations + /home/denali/Projects/tmp/build/unittest/tst_initializations true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_initializations CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -948,35 +828,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -987,8 +859,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -1006,30 +876,26 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_initializations tst_initializations Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/unittest/tst_views + /home/denali/Projects/tmp/build/unittest/tst_views true - qmake - QtProjectManager.QMakeBuildStep - false CONFIG+=tst_views CONFIG+=CodeCoverage false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -1042,35 +908,27 @@ %{buildDir}/denali %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true -m denali.csmes -t UnitTests denali.csexe cmcsexeimport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --html=Coverage/index cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep true --csmes=denali.csmes --csv-excel=Coverage/coverage.csv cmreport %{buildDir} - Custom Process Step - ProjectExplorer.ProcessStep 6 @@ -1081,8 +939,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -1100,11 +956,11 @@ PATH=/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin:/opt/Qt5.12.5/5.12.5/gcc_64/bin:/usr/bin:/home/denali/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - tst_views tst_views Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 12 @@ -1115,8 +971,8 @@ ProjectExplorer.BuildSteps.Deploy 1 - Deploy Configuration - + + false ProjectExplorer.DefaultDeployConfiguration 1 @@ -1128,6 +984,14 @@ 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + -F true 4096 @@ -1173,11 +1037,11 @@ 2 - denali - denali2 Qt4ProjectManager.Qt4RunConfiguration:/home/denali/Projects/application/denali.pro + /home/denali/Projects/application/denali.pro - 3768 + false + false true true @@ -1200,23 +1064,19 @@ 0 0 + true + 2 /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Debug + /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Debug true - qmake - QtProjectManager.QMakeBuildStep - false false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -1232,8 +1092,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -1249,30 +1107,26 @@ 2 false - Debug Debug Qt4ProjectManager.Qt4BuildConfiguration 2 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Release + /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Release true - qmake - QtProjectManager.QMakeBuildStep - false false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -1288,8 +1142,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -1305,30 +1157,26 @@ 2 false - Release Release Qt4ProjectManager.Qt4BuildConfiguration 0 - true + 2 + 2 + true + 2 /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Profile + /home/denali/Projects/tmp/build/denali-Qt_5_12_5_iMX8-Profile true - qmake - QtProjectManager.QMakeBuildStep - false false - false - true true - Make - Qt4ProjectManager.MakeStep false @@ -1344,8 +1192,6 @@ true - Make - Qt4ProjectManager.MakeStep true @@ -1361,19 +1207,17 @@ 2 false - Profile Profile Qt4ProjectManager.Qt4BuildConfiguration 0 - true + 2 + 2 3 true - Check for free disk space - RemoteLinux.CheckForFreeDiskSpaceStep @@ -1386,8 +1230,6 @@ true - Kill current application instance - RemoteLinux.KillAppStep @@ -1398,8 +1240,6 @@ true - Deploy files via rsync - RemoteLinux.RsyncDeployStep @@ -1416,8 +1256,8 @@ ProjectExplorer.BuildSteps.Deploy 1 - Deploy to Remote Linux Host - + + false DeployToGenericLinux 1 @@ -1429,6 +1269,14 @@ 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + -F true 4096 @@ -1474,14 +1322,15 @@ 1 - - denali (on Generic Linux Device (iMX8)) + denali (on Generic Linux Device)2 RemoteLinuxRunConfiguration:/home/denali/Projects/application/denali.pro + /home/denali/Projects/application/denali.pro 1 false - 3768 + false + false true false Index: sources/gui/qml/pages/ManagerHome.qml =================================================================== diff -u -r90bcc276f2a879169fef20e9168711cf906c0e54 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision 90bcc276f2a879169fef20e9168711cf906c0e54) +++ sources/gui/qml/pages/ManagerHome.qml (.../ManagerHome.qml) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -75,7 +75,7 @@ vDGROPump.pwm .toFixed(2) ] Text { - objectName: "_DGROPump" + index + objectName: "_DGROPumpData" + index text: modelData width: _DGROPumpColumn.width horizontalAlignment: Text.AlignRight @@ -108,7 +108,7 @@ vDGPressures.drainOutletPSI .toFixed(2) ] Text { - objectName: "_DGPressures" + index + objectName: "_DGPressuresData" + index text: modelData width: _DGPressuresColumn.width horizontalAlignment: Text.AlignRight @@ -139,7 +139,7 @@ vDGReservoir.drainToVol , ] Text { - objectName: "_DGReservoir" + index + objectName: "_DGReservoirData" + index text: modelData width: _DGReservoirColumn.width horizontalAlignment: Text.AlignRight @@ -170,7 +170,7 @@ vDGHeaters.trimmerDC , ] Text { - objectName: "_DGHeaters" + index + objectName: "_DGHeatersData" + index text: modelData width: _DGHeatersColumn.width horizontalAlignment: Text.AlignRight @@ -202,7 +202,7 @@ vDGLoadCellReadings.reservoir2Bkup .toFixed(2) ] Text { - objectName: "_DGLoadCellReadings" + index + objectName: "_DGLoadCellReadingsData" + index text: modelData width: _LoadCellReadingsColumn.width horizontalAlignment: Text.AlignRight @@ -242,7 +242,7 @@ vDGTemperatures.trimmerHeaterInternal .toFixed(2) ] Text { - objectName: "_DGTemperatures" + index + objectName: "_DGTemperaturesData" + index text: modelData width: _DGTemperaturesColumn.width horizontalAlignment: Text.AlignRight @@ -273,7 +273,7 @@ vDGDrainPump.dac , ] Text { - objectName: "_DGDrainPump" + index + objectName: "_DGDrainPumpData" + index text: modelData width: _DGDrainPumpColumn.width horizontalAlignment: Text.AlignRight @@ -299,7 +299,7 @@ font.underline: true } Text { - objectName: "_DGValvesStates" + objectName: "_DGValvesStatesData" text: vDGValvesStates.text width: _DGValvesStatesColumn.width horizontalAlignment: Text.AlignRight @@ -323,7 +323,7 @@ font.underline: true } Text { - objectName: "_DGOperationMode" + objectName: "_DGOperationModeData" text: vDGOperationMode.text width: _DGOperationModeColumn.width horizontalAlignment: Text.AlignRight Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -r15de0cd12dad1ea5107c52e5ed89280bc9e29b1d -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 15de0cd12dad1ea5107c52e5ed89280bc9e29b1d) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -226,6 +226,7 @@ vTreatmentPressureOcclusion.pressureocclusion_DialysateOutletPumpOcclusion .toFixed(2) ] Text { + objectName: "_PressureOcclusionData" + index text: modelData width: _PressureOcclusionColumn.width horizontalAlignment: Text.AlignRight @@ -250,7 +251,7 @@ font.pixelSize: Fonts.fontPixelTitle } Text { - objectName: "_HDOperationMode" + objectName: "_HDOperationModeData" text: vHDOperationMode.text //width: _HDOperationModeColumn.width horizontalAlignment: Text.AlignRight Index: sources/maintimer.cpp =================================================================== diff -u -r0a2ca0373a422201d5316df8fb891ef38799e3f9 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/maintimer.cpp (.../maintimer.cpp) (revision 0a2ca0373a422201d5316df8fb891ef38799e3f9) +++ sources/maintimer.cpp (.../maintimer.cpp) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -68,6 +68,8 @@ static int oH,oM,oS; int cH,cM,cS; QDateTime::currentDateTime().date().getDate(&cy, &cm, &cd); + // coco begin validated: Decided to not to check each second + // has been tested manually if (vIncludeTime) { QTime currentTime = QDateTime::currentDateTime().time(); cH = currentTime.hour(); @@ -90,6 +92,7 @@ oM = cM; oS = cS; } + // coco end } else return false; Index: sources/model/hd/adjustment/MTreatmentAdjustRequests.h =================================================================== diff -u -rcb2101c6f2596d9131a5369420db345fe7125e71 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision cb2101c6f2596d9131a5369420db345fe7125e71) +++ sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -43,12 +43,14 @@ class MAdjustPowerOffReq : public MModel { public: quint8 state; + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({state}); } explicit MAdjustPowerOffReq(quint8 vState) : state(vState) { } - + // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("PowerOff", vParameters); } @@ -58,11 +60,12 @@ public: quint32 bloodFlow = 0; quint32 dialysateFlow = 0; - + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({bloodFlow , dialysateFlow}); } - + // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustBloodDialisate", vParameters); } @@ -71,10 +74,12 @@ class MAdjustDurationReq : public MModel { public: quint32 duration = 0; - + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({duration}); } + // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustDuration", vParameters); } @@ -87,10 +92,12 @@ eRunning = 1, }; State requestedState = ePaused; // the requested state. Initially it's running => paused. - + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({requestedState}); } + // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustUFState", vParameters); } @@ -99,10 +106,12 @@ class MAdjustUltrafiltrationEditReq : public MModel { public: float volume = 0; - + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({volume}); } + // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustUFEdit", vParameters); } @@ -116,9 +125,12 @@ }; float volume = 0; Options option = eDuration; + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({volume , option}); } + // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustUFConfirm", vParameters); } Index: sources/model/hd/data/MTreatmentFlowsData.h =================================================================== diff -u -r3aab84456cfbdc4c4f495975ba9b8968eb844309 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/model/hd/data/MTreatmentFlowsData.h (.../MTreatmentFlowsData.h) (revision 3aab84456cfbdc4c4f495975ba9b8968eb844309) +++ sources/model/hd/data/MTreatmentFlowsData.h (.../MTreatmentFlowsData.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -21,6 +21,9 @@ #include "MAbstract.h" #include "types.h" +// forward declarations +class tst_models; + namespace Model { /*! @@ -56,6 +59,9 @@ */ class MBloodFlow : public MFlow { + // friends + friend class ::tst_models; + public: QString infoText () const override { return QString("BloodFlow"); } @@ -79,6 +85,9 @@ */ class MDialysateFlow : public MFlow { + // friends + friend class ::tst_models; + public: QString infoText () const override { return QString("DialysateFlow"); } Index: sources/model/hd/data/MTreatmentOutletFlowData.h =================================================================== diff -u -r3aab84456cfbdc4c4f495975ba9b8968eb844309 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/model/hd/data/MTreatmentOutletFlowData.h (.../MTreatmentOutletFlowData.h) (revision 3aab84456cfbdc4c4f495975ba9b8968eb844309) +++ sources/model/hd/data/MTreatmentOutletFlowData.h (.../MTreatmentOutletFlowData.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -20,10 +20,16 @@ #include "MAbstract.h" #include "types.h" +// forward declarations +class tst_models; + namespace Model { class MOutletFlow : public MAbstract { + // friends + friend class ::tst_models; + QVariantList parameters() const override; struct { Index: sources/model/hd/data/MTreatmentPressureOcclusionData.h =================================================================== diff -u -r3aab84456cfbdc4c4f495975ba9b8968eb844309 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/model/hd/data/MTreatmentPressureOcclusionData.h (.../MTreatmentPressureOcclusionData.h) (revision 3aab84456cfbdc4c4f495975ba9b8968eb844309) +++ sources/model/hd/data/MTreatmentPressureOcclusionData.h (.../MTreatmentPressureOcclusionData.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -20,11 +20,16 @@ #include "MAbstract.h" #include "types.h" +// forward declarations +class tst_models; + namespace Model { class MPressureOcclusion : public MAbstract { -public: + // friends + friend class ::tst_models; + QVariantList parameters() const override; struct { Index: sources/model/hd/data/MTreatmentTimeData.h =================================================================== diff -u -r3aab84456cfbdc4c4f495975ba9b8968eb844309 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/model/hd/data/MTreatmentTimeData.h (.../MTreatmentTimeData.h) (revision 3aab84456cfbdc4c4f495975ba9b8968eb844309) +++ sources/model/hd/data/MTreatmentTimeData.h (.../MTreatmentTimeData.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -21,10 +21,16 @@ #include "MAbstract.h" #include "types.h" +// forward declarations +class tst_models; + namespace Model { class MTreatmentTime : public MAbstract { + // friends + friend class ::tst_models; + QVariantList parameters() const override; struct { Index: sources/storage/filehandler.cpp =================================================================== diff -u -r920342d3f8cb8c29966f2354ebc7d241df23ccf7 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/storage/filehandler.cpp (.../filehandler.cpp) (revision 920342d3f8cb8c29966f2354ebc7d241df23ccf7) +++ sources/storage/filehandler.cpp (.../filehandler.cpp) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -49,11 +49,13 @@ QFile::Text | QFile::Append : QFile::Text | QFile::WriteOnly; if (! file.open(openMode)) { + // coco begin validated : This has been manually test. Needs filesystem access to make file the way it can't be opened for writing. QString msg = QString("Can't open file for write (%1).Possible corrupted file system").arg(vFileName); errOut (msg); LOG_DEBUG(msg); return false; } + // coco end QTextStream out(&file); out << vContent; out.flush(); @@ -129,13 +131,17 @@ LOG_DEBUG(QString("%1 File(s) %2 removed").arg(countRemoved).arg(fileName)); } else { + // coco begin validated : This has been manually tested since requires to change in file system to reproduce the error. LOG_DEBUG(QString("Can't delete file : ") + fileName); } + // coco end } } else { + // coco begin validated : This has been manually tested since requires to change in file system to reproduce the error. LOG_DEBUG(QString("Can't get last modified date of file : ") + fileName); } + // coco end } } return countRemoved; Index: sources/storage/logger.cpp =================================================================== diff -u -rc421ddadef2ade71d3abe269493a84b12b85296b -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/storage/logger.cpp (.../logger.cpp) (revision c421ddadef2ade71d3abe269493a84b12b85296b) +++ sources/storage/logger.cpp (.../logger.cpp) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -279,6 +279,8 @@ bool Logger::exportLogs() { + // coco begin validated: This needs user interaction to check the old files deleted + // has been tested manually int result = 0; static QString mOSource; QString mDestination = USB_Mount_Point; @@ -293,6 +295,7 @@ mOSource = ""; return result >= 0; // refer to QProcess::execute(hit F1 on execute) doc. } +// coco end /*! * \brief Logger::concurrentExportLogs Index: sources/view/dg/data/VDGValvesStatesData.h =================================================================== diff -u -r6ae83fa9a1a3204864fc5b50fe906ac09e9c1ea5 -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- sources/view/dg/data/VDGValvesStatesData.h (.../VDGValvesStatesData.h) (revision 6ae83fa9a1a3204864fc5b50fe906ac09e9c1ea5) +++ sources/view/dg/data/VDGValvesStatesData.h (.../VDGValvesStatesData.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -27,7 +27,9 @@ { Q_OBJECT + // coco begin validated: Has been tested manually. This is a general messages received trigger, but is not used yet. TRIGGER ( bool , refresh , false) + // coco end PROPERTY( bool , valveStates_01 , false) PROPERTY( bool , valveStates_02 , false) Index: unittests/tst_models.cpp =================================================================== diff -u -rc421ddadef2ade71d3abe269493a84b12b85296b -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- unittests/tst_models.cpp (.../tst_models.cpp) (revision c421ddadef2ade71d3abe269493a84b12b85296b) +++ unittests/tst_models.cpp (.../tst_models.cpp) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -19,13 +19,25 @@ #include "MTreatmentAdjustBloodDialysateResponse.h" #include "MTreatmentAdjustDurationResponse.h" #include "MTreatmentRangesData.h" +#include "MPowerOff.h" #include "MDGDrainPumpData.h" #include "MDGHeatersData.h" #include "MDGLoadCellReadingsData.h" #include "MDGOperationModeData.h" +#include "MDGPressuresData.h" +#include "MDGReservoirData.h" +#include "MDGROPumpData.h" #include "MDGTemperaturesData.h" +#include "MDGValvesStatesData.h" +#include "MHDOperationModeData.h" +#include "MTreatmentStatesData.h" +#include "MTreatmentOutletFlowData.h" +#include "MTreatmentFlowsData.h" +#include "MTreatmentTimeData.h" +#include "MTreatmentPressureOcclusionData.h" + #include "MTreatmentAdjustUltrafiltrationStateResponse.h" #include "MTreatmentAdjustUltrafiltrationEditResponse.h" #include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" @@ -202,33 +214,18 @@ } } -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DG Load Cell Readings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MDGLoadCellReadings_data () +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration State Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MAdjustUltrafiltrationStateResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); - QTest::newRow("mReservoir1Prim")<< 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mReservoir1Prim")<< 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mReservoir1Prim")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mReservoir1Prim")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mReservoir1Bkup")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("mReservoir1Bkup")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mReservoir1Bkup")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mReservoir1Bkup")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); - QTest::newRow("mReservoir2Prim")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mReservoir2Prim")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); - QTest::newRow("mReservoir2Prim")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); - QTest::newRow("mReservoir2Prim")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("mReservoir2Bkup")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mReservoir2Bkup")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("mReservoir2Bkup")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("mReservoir2Bkup")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); } -void tst_models::tst_MDGLoadCellReadings () +void tst_models::tst_MAdjustUltrafiltrationStateResponse () { - Model::MDGLoadCellReadings mData; + Model::MAdjustUltrafiltrationStateResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); @@ -237,82 +234,62 @@ int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) - #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mReservoir1Prim ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mReservoir1Bkup ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mReservoir2Prim ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mReservoir2Bkup ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + 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; default: QVERIFY2(false, "Incorrect Test"); break; } } -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DG Temperatures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MDGTemperatures_data () +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Edit Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MAdjustUltrafiltrationEditResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F")); - 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("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); + QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); + QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); + QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); + QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); + QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); + QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); + QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); + QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); + QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); + QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); + QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); } -void tst_models::tst_MDGTemperatures () +void tst_models::tst_MAdjustUltrafiltrationEditResponse () { - Model::MDGTemperatures mData; + Model::MAdjustUltrafiltrationEditResponse mData; QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); @@ -327,43 +304,193 @@ #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mInletPrimaryHeater ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mOutletPrimaryHeater ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mConductivitySensor1 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mConductivitySensor2 ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 5: { index = index * sizeof mData._data.mOutletRedundancy ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 6: { index = index * sizeof mData._data.mInletDialysate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 7: { index = index * sizeof mData._data.mPrimaryHeaterThermoCouple ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 8: { index = index * sizeof mData._data.mTrimmerHeaterThermoCouple ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 9: { index = index * sizeof mData._data.mPrimaryHeaterColdJunction ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 10: { index = index * sizeof mData._data.mTrimmerHeaterColdJunction ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 11: { index = index * sizeof mData._data.mPrimaryHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 12: { index = index * sizeof mData._data.mTrimmerHeaterInternal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mDurationDiff ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mRateDiff ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 8: { index = index * sizeof mData._data.mRateOld ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DG Drain Pump ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MDGDrainPump_data () +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Confirm Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MAdjustUltrafiltrationConfirmResponse_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mRPM" )<< 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mRPM" )<< 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mRPM" )<< 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mRPM" )<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mDAC" )<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("mDAC" )<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mDAC" )<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mDAC" )<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); } -void tst_models::tst_MDGDrainPump () +void tst_models::tst_MAdjustUltrafiltrationConfirmResponse () { + Model::MAdjustUltrafiltrationConfirmResponse mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) + +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGROPumpData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mFlowRate ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mPWM ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGROPumpData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGROPumpData() { + Model::MDGROPump mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mFlowRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mPWM ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGPressuresData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGPressuresData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGPressuresData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mROInletPSI ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mROOutletPSI ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mDrainInletPSI ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mDrainOutletPSI") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGPressuresData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGPressuresData() { + Model::MDGPressures mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mROInletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mROOutletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mDrainInletPSI ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mDrainOutletPSI; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGDrainPumpData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGDrainPumpData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGDrainPumpData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mRPM ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mRPM ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mRPM ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mRPM ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mDAC ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGDrainPumpData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGDrainPumpData() { Model::MDGDrainPump mData; QFETCH(int , errorIndex ); @@ -373,43 +500,158 @@ 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.mRPM ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mDAC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGOperationMode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGOperationMode data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGOperationMode_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGOperationMode test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGOperationMode() { + Model::MDGOperationMode mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mRPM ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mDAC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mOpMode ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DG Heaters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MDGHeaters_data () -{ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGReservoirData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGReservoirData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGReservoirData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mMainPrimaryDC ")<< 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mMainPrimaryDC ")<< 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mMainPrimaryDC ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mMainPrimaryDC ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mSmallPrimaryDC")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("mSmallPrimaryDC")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mSmallPrimaryDC")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mSmallPrimaryDC")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); - QTest::newRow("mTrimmerDC ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mTrimmerDC ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); - QTest::newRow("mTrimmerDC ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); - QTest::newRow("mTrimmerDC ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mActiveReservoir") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mFillToVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mDrainToVol ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGReservoirData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGReservoirData() { + Model::MDGReservoir mData; -void tst_models::tst_MDGHeaters () -{ + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mActiveReservoir ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mFillToVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mDrainToVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGValvesStates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGValvesStates data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGValvesStates_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mStates ") << 1 << QByteArray::fromHex(QByteArray("00")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGValvesStates test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGValvesStates() { + Model::MDGValvesStates mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mStates ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGHeatersData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGHeatersData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGHeatersData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mMainPrimaryDC ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mMainPrimaryDC ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mMainPrimaryDC ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mMainPrimaryDC ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mSmallPrimaryDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mSmallPrimaryDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mSmallPrimaryDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mSmallPrimaryDC") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mTrimmerDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mTrimmerDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mTrimmerDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mTrimmerDC ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGHeatersData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGHeatersData() { Model::MDGHeaters mData; QFETCH(int , errorIndex ); @@ -419,35 +661,187 @@ 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.mMainPrimaryDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mSmallPrimaryDC; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mTrimmerDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGLoadCellReadingsData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGLoadCellReadingsData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGLoadCellReadingsData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mReservoir1Prim") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mReservoir1Bkup") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mReservoir2Prim") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mReservoir2Bkup") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGLoadCellReadingsData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGLoadCellReadingsData() { + Model::MDGLoadCellReadings mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mMainPrimaryDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mSmallPrimaryDC ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mTrimmerDC ; 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.mReservoir1Prim; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mReservoir1Bkup; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mReservoir2Prim; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mReservoir2Bkup; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration State Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MAdjustUltrafiltrationStateResponse_data () -{ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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")); - 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" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "2A" "2B" "2C" "2D" "2E" "2F")); + 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")); } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DGTemperaturesData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_DGTemperaturesData() { + Model::MDGTemperatures mData; -void tst_models::tst_MAdjustUltrafiltrationStateResponse () -{ - Model::MAdjustUltrafiltrationStateResponse mData; + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.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; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStateData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStateData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MTreatmentStateData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mSubmode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mUFState ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mSalineState") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mSalineState") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mSalineState") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mSalineState") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentStateData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MTreatmentStateData() { + Model::MTreatmentStates mData; + QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); @@ -460,139 +854,383 @@ #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.mSubMode ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mUFState ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mSalineState; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Edit Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MAdjustUltrafiltrationEditResponse_data () -{ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDOperationModeData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDOperationModeData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MHDOperationModeData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E" "1F")); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); - QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); - QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); - QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); - QTest::newRow("mDurationDiff ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); - QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); - QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); - QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); - QTest::newRow("mRate ")<< 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); - QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); - QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); - QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); - QTest::newRow("mRateDiff ")<< 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); - QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); - QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C")); - QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D")); - QTest::newRow("mRateOld ")<< 8 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B" "1C" "1D" "1E")); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mOpMode ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MHDOperationModeData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MHDOperationModeData() { + Model::MHDOperationMode mData; -void tst_models::tst_MAdjustUltrafiltrationEditResponse () -{ - Model::MAdjustUltrafiltrationEditResponse mData; + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mOpMode; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MOutletFlowData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MOutletFlowData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MOutletFlowData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); + QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mRefUFVol ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mMeasUFVol ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); + QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); + QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); + QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); + QTest::newRow("mPWMDtCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MOutletFlowData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MOutletFlowData() { + Model::MOutletFlow mData; + QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mRefUFVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mMeasUFVol ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mRotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mMotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mMotorCtlSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mMotorCtlCurrent; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mPWMDtCycle ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBloodFlowData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBloodFlowData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MBloodFlowData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A" "1B")); + QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MBloodFlowData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MBloodFlowData() { + Model::MBloodFlow mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 5: { index = index * sizeof mData._data.mDurationDiff ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 6: { index = index * sizeof mData._data.mRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 7: { index = index * sizeof mData._data.mRateDiff ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 8: { index = index * sizeof mData._data.mRateOld ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mFlowSetPoint ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mMeasuredFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mRotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mMotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mMotorCtlSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mMotorCtlCurrent; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mPWMDutyCycle ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adjust Ultrafiltration Confirm Response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -void tst_models::tst_MAdjustUltrafiltrationConfirmResponse_data () -{ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDialysateFlowData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDialysateFlowData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MDialysateFlowData_data () { QTest::addColumn("errorIndex"); QTest::addColumn("data"); - QTest::newRow("msg complete ")<< 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray()); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00")); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01")); - QTest::newRow("mAccepted ")<< 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); - QTest::newRow("mReason ")<< 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); - QTest::newRow("mVolume ")<< 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); - QTest::newRow("mDuration ")<< 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); - QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); - QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); - QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); - QTest::newRow("mRate ")<< 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); + 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("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mFlowSetPoint ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mMeasuredFlow ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mRotorSpeed ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mMotorSpeed ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mMotorCtlSpeed ") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15")); + QTest::newRow("mMotorCtlCurrent") << 6 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19")); + QTest::newRow("mPWMDutyCycle ") << 7 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "1A")); } +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MDialysateFlowData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MDialysateFlowData() { + Model::MDialysateFlow mData; -void tst_models::tst_MAdjustUltrafiltrationConfirmResponse () -{ - Model::MAdjustUltrafiltrationConfirmResponse mData; + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mFlowSetPoint ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mMeasuredFlow ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mRotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mMotorSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mMotorCtlSpeed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 6: { index = index * sizeof mData._data.mMotorCtlCurrent; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 7: { index = index * sizeof mData._data.mPWMDutyCycle ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentTimeData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentTimeData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MTreatmentTimeData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mTotal ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mElapsed ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mRemaining ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MTreatmentTimeData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MTreatmentTimeData() { + Model::MTreatmentTime mData; + QFETCH(int , errorIndex ); QFETCH(QByteArray, data ); int startIndex = 0; int index = errorIndex - 1; bool ok = mData.fromByteArray(data, &startIndex); Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mTotal ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mElapsed ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mRemaining; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPressureOcclusionData ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPressureOcclusionData data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MPressureOcclusionData_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete ") << 0 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12" "13")); + QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray()); + QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01")); + QTest::newRow("mArterialPressure ") << 1 << QByteArray::fromHex(QByteArray("00" "01" "02")); + QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03")); + QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04")); + QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05")); + QTest::newRow("mVenousPressure ") << 2 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06")); + QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07")); + QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08")); + QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09")); + QTest::newRow("mBloodPumpOcclusion ") << 3 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A")); + QTest::newRow("mDialysateInletPumpOcclusion ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B")); + QTest::newRow("mDialysateInletPumpOcclusion ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C")); + QTest::newRow("mDialysateInletPumpOcclusion ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D")); + QTest::newRow("mDialysateInletPumpOcclusion ") << 4 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E")); + QTest::newRow("mDialysateOutletPumpOcclusion") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F")); + QTest::newRow("mDialysateOutletPumpOcclusion") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10")); + QTest::newRow("mDialysateOutletPumpOcclusion") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11")); + QTest::newRow("mDialysateOutletPumpOcclusion") << 5 << QByteArray::fromHex(QByteArray("00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "0A" "0B" "0C" "0D" "0E" "0F" "10" "11" "12")); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPressureOcclusionData test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MPressureOcclusionData() { + Model::MPressureOcclusion mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) #ifdef CONSOLEOUT qDebug() << index << errorIndex << startIndex << ok << data ; #endif switch (errorIndex) { - case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 1: { index = index * sizeof mData._data.mAccepted ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 2: { index = index * sizeof mData._data.mReason ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 3: { index = index * sizeof mData._data.mVolume ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 4: { index = index * sizeof mData._data.mDuration ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; - case 5: { index = index * sizeof mData._data.mRate ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mArterialPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 2: { index = index * sizeof mData._data.mVenousPressure ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 3: { index = index * sizeof mData._data.mBloodPumpOcclusion ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 4: { index = index * sizeof mData._data.mDialysateInletPumpOcclusion ; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 5: { index = index * sizeof mData._data.mDialysateOutletPumpOcclusion; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; default: QVERIFY2(false, "Incorrect Test"); break; } } + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPowerOff ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPowerOff data definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MPowerOff_data () { + QTest::addColumn("errorIndex"); + QTest::addColumn("data"); + QTest::newRow("msg complete") << 0 << QByteArray::fromHex(QByteArray("00")); + QTest::newRow("mStatus ") << 1 << QByteArray::fromHex(QByteArray()); +} +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MPowerOff test definition ~~~~~~~~~~~~~~~~~~~~~~~~ // +void tst_models::tst_MPowerOff() { + Model::MPowerOff mData; + + QFETCH(int , errorIndex ); + QFETCH(QByteArray, data ); + + int startIndex = 0; + int index = errorIndex - 1; + bool ok = mData.fromByteArray(data, &startIndex); + Q_UNUSED(ok) +#ifdef CONSOLEOUT + qDebug() << index << errorIndex << startIndex << ok << data ; +#endif + + switch (errorIndex) { + case 0: { index = 0 ; QVERIFY ( mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + case 1: { index = index * sizeof mData._data.mStatus; QVERIFY (! mData.fromByteArray(data)); QCOMPARE( index, startIndex ); } break; + default: + QVERIFY2(false, "Incorrect Test"); + break; + } +} + + Index: unittests/tst_models.h =================================================================== diff -u -rc421ddadef2ade71d3abe269493a84b12b85296b -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- unittests/tst_models.h (.../tst_models.h) (revision c421ddadef2ade71d3abe269493a84b12b85296b) +++ unittests/tst_models.h (.../tst_models.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -31,23 +31,6 @@ void tst_MTreatmentRanges_data (); void tst_MTreatmentRanges (); - - // - DG Data - // -- DG Drain Pump - void tst_MDGDrainPump_data (); - void tst_MDGDrainPump (); - - // -- DG Heaters - void tst_MDGHeaters_data (); - void tst_MDGHeaters (); - - // DG Load Cell Readings - void tst_MDGLoadCellReadings_data (); - void tst_MDGLoadCellReadings (); - - void tst_MDGTemperatures_data (); - void tst_MDGTemperatures (); - // - Treatment Adjustments // -- Treatment Duration @@ -69,5 +52,40 @@ void tst_MAdjustUltrafiltrationConfirmResponse_data (); void tst_MAdjustUltrafiltrationConfirmResponse (); + // - Data Messages + void tst_DGROPumpData_data(); + void tst_DGROPumpData(); + void tst_DGPressuresData_data(); + void tst_DGPressuresData(); + void tst_DGDrainPumpData_data(); + void tst_DGDrainPumpData(); + void tst_DGOperationMode_data(); + void tst_DGOperationMode(); + void tst_DGReservoirData_data(); + void tst_DGReservoirData(); + void tst_DGValvesStates_data(); + void tst_DGValvesStates(); + void tst_DGHeatersData_data(); + void tst_DGHeatersData(); + void tst_DGLoadCellReadingsData_data(); + void tst_DGLoadCellReadingsData(); + void tst_DGTemperaturesData_data(); + void tst_DGTemperaturesData(); + void tst_MTreatmentStateData_data(); + void tst_MTreatmentStateData(); + void tst_MHDOperationModeData_data(); + void tst_MHDOperationModeData(); + void tst_MOutletFlowData_data(); + void tst_MOutletFlowData(); + void tst_MBloodFlowData_data(); + void tst_MBloodFlowData(); + void tst_MDialysateFlowData_data(); + void tst_MDialysateFlowData(); + void tst_MTreatmentTimeData_data(); + void tst_MTreatmentTimeData(); + void tst_MPressureOcclusionData_data(); + void tst_MPressureOcclusionData(); + void tst_MPowerOff_data(); + void tst_MPowerOff(); }; Index: unittests/tst_utilities.cpp =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- unittests/tst_utilities.cpp (.../tst_utilities.cpp) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ unittests/tst_utilities.cpp (.../tst_utilities.cpp) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -184,6 +184,57 @@ QCOMPARE(Format::fromVariant(t.currentTime()).toHex(), ba.toHex()); } +void tst_utilities::tst_toStringList_Default() +{ + const QList data { + "A", + "B", + "C", + }; + QStringList mActual = Format::toStringList(data); + QStringList mExpected = { + "A", + "B", + "C", + }; + QCOMPARE(mActual, mExpected); +} + +void tst_utilities::tst_toStringList_RemoveDuplicate() +{ + const QList data { + "A", + "B", + "B", + "C", + }; + QStringList mActual = Format::toStringList(data, true); + QStringList mExpected = { + "A", + "B", + "C", + }; + QCOMPARE(mActual, mExpected); +} + +void tst_utilities::tst_toStringList_Prefix() +{ + const QList data { + "A", + "B", + "B", + "C", + }; + QStringList mActual = Format::toStringList(data, true, "*"); + QStringList mExpected = { + "*A", + "*B", + "*C", + }; + QCOMPARE(mActual, mExpected); +} + + void tst_utilities::tst_getValue_len() { Types::S32 vFlowSetPoint; Index: unittests/tst_utilities.h =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -raa0772fe1b0ff6b07e9f64e8c38acad66ad5468d --- unittests/tst_utilities.h (.../tst_utilities.h) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ unittests/tst_utilities.h (.../tst_utilities.h) (revision aa0772fe1b0ff6b07e9f64e8c38acad66ad5468d) @@ -41,6 +41,9 @@ void tst_fromvariant_Bool_True(); void tst_fromvariant_Bool_False(); void tst_fromvariant_Undefined(); + void tst_toStringList_Default(); + void tst_toStringList_RemoveDuplicate(); + void tst_toStringList_Prefix(); void tst_safeIncrement_StepZero(); void tst_safeIncrement_GtMaxValue_Step1 ();