tests for bad neuenahr

This commit is contained in:
Gerhard Hoffmann 2024-09-27 13:42:04 +02:00
parent 515dfaf35c
commit 9ca7018fc1
2 changed files with 28 additions and 8 deletions

View File

@ -755,7 +755,7 @@ int main() {
int pop_max_price;
int pop_daily_card_price;
int zone = 3;
int zone = 1;
if (zone == 1) {
input.open("/opt/ptu5/opt/customer_502/etc/psa_tariff/tariff01.json");
@ -844,7 +844,7 @@ int main() {
CalcState calcState;
QDateTime s(QDateTime::currentDateTime());
s.setTime(QTime(12, 0, 0));
// s.setTime(QTime(12, 0, 0));
//calcState = compute_duration_for_parking_ticket(&cfg, s,
// (double)1200, end, PermitType(PERMIT_TYPE::SHORT_TERM_PARKING_PKW));
@ -852,9 +852,26 @@ int main() {
//qCritical() << calcState.toString();
calcState = compute_duration_for_parking_ticket(&cfg, s,
(double)50, end, PermitType(PERMIT_TYPE::SHORT_TERM_PARKING_BUS));
(double)9000, end, PermitType(PERMIT_TYPE::SHORT_TERM_PARKING_BUS));
qCritical() << end.toString(Qt::ISODate);
qCritical() << calcState.toString();
struct price_t costs;
CalcState cs;
for (int i = 0, j=timeSteps.size() ; i < timeSteps.size(); --j, ++i) {
QDateTime end = start.addSecs(timeSteps.at(i)*60);
qCritical() << "XXXXX end" << end.toString(Qt::ISODate);
cs = compute_price_for_parking_ticket(&cfg, s, timeSteps.at(i), end, &costs,
PermitType(PERMIT_TYPE::SHORT_TERM_PARKING));
if (cs.getStatus() != CalcState::State::SUCCESS) {
qCritical() << "ERROR STATUS" << costs.netto;
exit(-1);
}
}
}
if (zone == 2) {
@ -1391,7 +1408,8 @@ int main() {
case 2: {
qCritical() << " ZONE 2: KURZZEIT 1";
// kuzzeit-1-tarif
input.open("/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff02.json");
//input.open("/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff02.json");
input.open("/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff05.json");
//pop_max_time = 5*60;
} break;
case 3: {
@ -1583,7 +1601,8 @@ int main() {
break;
case 1:
//start = QDateTime(QDate(2024, 10, 3), QTime(17, 0, 0)); // sunday
start = QDateTime(QDate(2024, 9, 8), QTime(16, 2, 0)); // sunday
//start = QDateTime(QDate(2025, 4, 20), QTime(18, 0, 0)); // sunday
start = QDateTime(QDate(2024, 9, 27), QTime(17, 0, 0)); // friday
fail = false;
break;
case 2:
@ -1615,8 +1634,8 @@ int main() {
// << "START" << start.toString(Qt::ISODate)
// << "<duration" << *step;
// if (*step != 180)
// continue;
if (*step != 180)
continue;
double cost = 0;

View File

@ -38,7 +38,8 @@ OTHER_FILES += \
/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff04.json \
/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff05.json \
/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff06.json \
/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff07.json
/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff07.json \
/opt/ptu5/opt/customer_249/etc/psa_tariff/tariff08.json