Adapted tests for NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM

This commit is contained in:
Gerhard Hoffmann 2024-02-28 09:26:05 +01:00
parent 493d94aaa1
commit 3ad2c77467

View File

@ -34,13 +34,13 @@ extern "C" char* strptime(const char* s,
#include "calculator_functions.h"
#include "calculate_price.h"
#define SZEGED (1)
#define SZEGED (0)
#define SCHOENAU_KOENIGSEE (0)
#define NEUHAUSER_KORNEUBURG (0)
#define NEUHAUSER_LINSINGER_MASCHINENBAU (0)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (1)
#define NEUHAUSER_BILEXA_GALTUER (0)
#define NEUHAUSER_KIRCHDORF (1)
#define NEUHAUSER_KIRCHDORF (0)
#if NEUHAUSER_KIRCHDORF==1
static bool test_neuhauser_kirchdorf(int step, double cost) {
@ -429,13 +429,12 @@ int main() {
QDateTime end2 = QDateTime();
if (compute_duration_for_parking_ticket(&cfg, start, cost, end2)) { // return value
qCritical() << "XXXX start" << start.toString(Qt::ISODate)
qCritical() << "start" << start.toString(Qt::ISODate)
<< "offset" << offset
<< "cost" << cost
<< "end" << end2.toString(Qt::ISODate);
if (end != end2) {
qCritical() << "YYYY"
<< end.toString(Qt::ISODate)
qCritical() << end.toString(Qt::ISODate)
<< end2.toString(Qt::ISODate);
}
}
@ -603,39 +602,28 @@ int main() {
int w = compute_product_price(&cfg, PERMIT_TYPE::DAY_TICKET_TEEN);
qCritical() << "price teen" << w;
return 0;
QDateTime s(QDate(2023, 11, 30), QTime());
QDateTime end;
struct price_t price;
#define ADULT 0
#define TEEN 1
#define ADULT 1
//#define TEEN 1
for (int offset = 480; offset < 1200; ++offset) {
QDateTime start = s.addSecs(offset * 60);
CalcState cs = compute_price_for_daily_ticket(&cfg, start, end,
#if ADULT==1
for (int offset = 480; offset < 1080; ++offset) {
QDateTime start = s.addSecs(offset * 60);
// qCritical() << QString(Calculator::GetInstance().isParkingAllowed(&cfg, start));
CalcState cs = compute_price_for_daily_ticket(&cfg, start, end,
PERMIT_TYPE::DAY_TICKET_ADULT, &price);
PERMIT_TYPE::DAY_TICKET_ADULT,
#elif TEEN==1
PERMIT_TYPE::DAY_TICKET_TEEN,
#endif
&price);
qCritical() << "start=" << start.toString(Qt::ISODate)
<< "end" << end.toString(Qt::ISODate) << "price" << price.netto;
}
#endif
#if TEEN==1
for (int offset = 480; offset < 1080; ++offset) {
QDateTime start = s.addSecs(offset * 60);
CalcState cs = compute_price_for_daily_ticket(&cfg, start, end,
PERMIT_TYPE::DAY_TICKET_TEEN, &price);
qCritical() << "start=" << start.toString(Qt::ISODate)
<< "end" << end.toString(Qt::ISODate) << "price" << price.netto;
}
#endif
}
#undef ADULT
#undef TEEN
#endif
#if NEUHAUSER_LINSINGER_MASCHINENBAU==1