Minor: add tests for special days in KORNEUBURG

This commit is contained in:
Gerhard Hoffmann 2024-04-24 10:52:18 +02:00
parent 76bb1eb56a
commit f17c4f240b

View File

@ -35,8 +35,8 @@ extern "C" char* strptime(const char* s,
#include "calculate_price.h"
#define SZEGED (0)
#define SCHOENAU_KOENIGSEE (1)
#define NEUHAUSER_KORNEUBURG (0)
#define SCHOENAU_KOENIGSEE (0)
#define NEUHAUSER_KORNEUBURG (1)
#define NEUHAUSER_LINSINGER_MASCHINENBAU (0)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_BILEXA_GALTUER (0)
@ -1012,6 +1012,21 @@ int main() {
// << "until" << duration.c_str() << start.secsTo(QDateTime::fromString(duration.c_str(), Qt::ISODate)) / 60;
}
}
Configuration::SpecialDaysType specialDays = cfg.SpecialDays;
for (Configuration::SpecialDaysType::const_iterator it = specialDays.cbegin();
it != specialDays.cend(); ++it) {
QDate d = QDate::fromString(QString::fromStdString(it->second.ped_date_start), Qt::ISODate);
s.setDate(d);
s.setTime(QTime(12, 0, 0));
int duration = 30;
double cost = Calculator::GetInstance().GetCostFromDuration(&cfg, 3, s, end, duration, nextDay, prePaid);
qCritical() << "start" << s.toString(Qt::ISODate)
<< "end" << end.toString(Qt::ISODate)
<< "duration" << duration
<< "cost" << cost;
}
}
}
return 0;