From f17c4f240b1426f2d8df0747a3add5ccf013b12a Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 24 Apr 2024 10:52:18 +0200 Subject: [PATCH] Minor: add tests for special days in KORNEUBURG --- main/main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 58aafc5..2cce3df 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -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;