##// END OF EJS Templates
Implements validation of variable's data (2)...
Alexandre Leroux -
r1232:a199540869ec
parent child
Show More
@@ -1,4 +1,7
1 #include "FuzzingValidators.h"
1 #include "FuzzingValidators.h"
2 #include "FuzzingDefs.h"
3
4 #include <Data/DataSeries.h>
2 #include <Variable/Variable.h>
5 #include <Variable/Variable.h>
3
6
4 #include <QTest>
7 #include <QTest>
@@ -43,7 +46,22 class LocalhostServerDataValidatorHelper : public DataValidatorHelper {
43 public:
46 public:
44 void validate(const VariableState &variableState) const override
47 void validate(const VariableState &variableState) const override
45 {
48 {
46 /// @todo: complete
49 // Don't check data for null variable
50 if (!variableState.m_Variable || variableState.m_Range == INVALID_RANGE) {
51 return;
52 }
53
54 auto message = "Checking variable's data...";
55 auto toDateString = [](double value) { return DateUtils::dateTime(value).toString(); };
56
57 // Checks that data are defined
58 auto variableDataSeries = variableState.m_Variable->dataSeries();
59 if (variableDataSeries == nullptr && variableState.m_Range != INVALID_RANGE) {
60 qCInfo(LOG_FuzzingValidators()).noquote()
61 << message << "FAIL: the variable has no data while a range is defined";
62 QFAIL("");
63 }
64
47 }
65 }
48 };
66 };
49
67
General Comments 0
You need to be logged in to leave comments. Login now