Add test cases BAD_NEUENAHR_AHRWEILER, zone2.

This commit is contained in:
Gerhard Hoffmann 2024-04-19 13:24:10 +02:00
parent e20eb93abf
commit 1240abbbec

View File

@ -41,9 +41,9 @@ extern "C" char* strptime(const char* s,
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0) #define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_BILEXA_GALTUER (0) #define NEUHAUSER_BILEXA_GALTUER (0)
#define NEUHAUSER_KIRCHDORF (0) #define NEUHAUSER_KIRCHDORF (0)
#define BAD_NEUENAHR_AHRWEILER (0) #define BAD_NEUENAHR_AHRWEILER (1)
#define NEUHAUSER_CHRISTOPH_REISEN (0) #define NEUHAUSER_CHRISTOPH_REISEN (0)
#define NEUHAUSER_PERNEGG_AN_DER_MUR (1) #define NEUHAUSER_PERNEGG_AN_DER_MUR (0)
int main() { int main() {
#if NEUHAUSER_PERNEGG_AN_DER_MUR==1 #if NEUHAUSER_PERNEGG_AN_DER_MUR==1
@ -408,29 +408,59 @@ int main() {
} }
#endif #endif
bool fail;
QDateTime start;
QDateTime start(QDate(2024, 4, 14), QTime()); for (int i=0; i < 4; ++i) {
QDateTime end; switch (i) {
struct price_t price; case 0:
start = QDateTime(QDate(2024, 5, 1), QTime(16, 0, 0)); // holiday
fail = false;
break;
case 1:
start = QDateTime(QDate(2024, 4, 21), QTime(16, 0, 0)); // sunday
fail = false;
break;
case 2:
start = QDateTime(QDate(2024, 4, 22), QTime(8, 0, 0)); // monday
fail = false;
break;
case 3:
start = QDateTime(QDate(2024, 4, 22), QTime(17, 30, 0)); // monday
fail = true;
break;
default:;
}
//start = QDateTime::currentDateTime(); QDateTime end;
struct price_t price;
int paymentOptionIndex = cfg.getCurrentPaymentOptionIndex(start); //start = QDateTime::currentDateTime();
if (paymentOptionIndex != -1) { QList<int> timeSteps;
qCritical() << "paymentOptionIndex" << paymentOptionIndex;
QList<int> const timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg, paymentOptionIndex);
qCritical() << "TimeSteps" << timeSteps;
// QDateTime start = s.addSecs(offset * 60); int paymentOptionIndex = cfg.getPaymentOptionIndex(start);
if (paymentOptionIndex != -1) {
qCritical() << "paymentOptionIndex" << paymentOptionIndex;
timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg, paymentOptionIndex);
qCritical() << "TimeSteps" << timeSteps;
QList<int>::const_iterator step; QList<int>::const_iterator step;
for (step = timeSteps.cbegin(); step != timeSteps.cend(); ++step) { for (step = timeSteps.cbegin(); step != timeSteps.cend(); ++step) {
double cost = 0; double cost = 0;
CalcState cs;
//if (compute_price_for_parking_ticket(&cfg, start, *step, end, &price)) { if ((cs = compute_price_for_parking_ticket(&cfg, start, *step, end, &price))) {
// cost = price.netto; cost = price.netto;
//} qCritical() << "step" << *step << ": cost" << cost;
} else {
if (fail == false) {
qCritical() << "<<<ERROR>>> cs =" << QString(cs);
}
}
}
} else {
qCritical() << "ERROR paymentOptionIndex =" << paymentOptionIndex;
} }
} }
} }