##// END OF EJS Templates
Implements validation of variable's data (4)...
Alexandre Leroux -
r1234:76dbe6c8f09b
parent child
Show More
@@ -41,6 +41,11 public:
41
41
42 /// Data resolution in local server's files
42 /// Data resolution in local server's files
43 const auto LOCALHOST_SERVER_RESOLUTION = 4;
43 const auto LOCALHOST_SERVER_RESOLUTION = 4;
44 /// Reference value used to generate the data on the local server (a value is the number of seconds
45 /// between the data date and this reference date)
46 const auto LOCALHOST_REFERENCE_VALUE
47 = DateUtils::secondsSinceEpoch(QDateTime{QDate{2000, 1, 1}, QTime{}, Qt::UTC});
48
44 /**
49 /**
45 * Implementation of @sa DataValidatorHelper for the local AMDA server
50 * Implementation of @sa DataValidatorHelper for the local AMDA server
46 */
51 */
@@ -103,6 +108,29 public:
103 QFAIL("");
108 QFAIL("");
104 }
109 }
105
110
111 // Checks values
112 auto dataIndex = 0;
113 for (auto dataIt = dataIts.first; dataIt != dataIts.second; ++dataIt, ++dataIndex) {
114 auto xAxisData = dataIt->x();
115 auto valuesData = dataIt->values();
116 for (auto valueIndex = 0, valueEnd = valuesData.size(); valueIndex < valueEnd;
117 ++valueIndex) {
118 auto value = valuesData.at(valueIndex);
119 auto expectedValue = xAxisData + valueIndex * LOCALHOST_SERVER_RESOLUTION
120 - LOCALHOST_REFERENCE_VALUE;
121
122 if (value != expectedValue) {
123 qCInfo(LOG_FuzzingValidators()).noquote()
124 << message << "FAIL: incorrect value data at time"
125 << toDateString(xAxisData) << ", index" << valueIndex << "(found:" << value
126 << ", expected:" << expectedValue << ")";
127 QFAIL("");
128 }
129 }
130 }
131
132 // At this step validation is OK
133 qCInfo(LOG_FuzzingValidators()).noquote() << message << "OK";
106 }
134 }
107 };
135 };
108
136
General Comments 0
You need to be logged in to leave comments. Login now