Add tests for Pernegg an der Mur

This commit is contained in:
Gerhard Hoffmann 2024-05-15 15:19:13 +02:00
parent eb20410849
commit 1a4265372e

View File

@ -41,9 +41,9 @@ extern "C" char* strptime(const char* s,
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_BILEXA_GALTUER (0)
#define NEUHAUSER_KIRCHDORF (0)
#define BAD_NEUENAHR_AHRWEILER (1)
#define BAD_NEUENAHR_AHRWEILER (0)
#define NEUHAUSER_CHRISTOPH_REISEN (0)
#define NEUHAUSER_PERNEGG_AN_DER_MUR (0)
#define NEUHAUSER_PERNEGG_AN_DER_MUR (1)
#if NEUHAUSER_KIRCHDORF==1
static bool test_neuhauser_kirchdorf(int step, double cost) {
@ -207,6 +207,9 @@ int main() {
.arg(__LINE__)
.arg(start.time().toString(Qt::ISODate)) << price;
price = get_minimal_parkingprice(&cfg, PERMIT_TYPE::DAY_TICKET, 0, start);
qCritical() << QString("line=%1 get_minimal_parkingprice:").arg(__LINE__) << price;
start.setTime(QTime(6, 0, 0));
productStart = productEnd = QDateTime();
price = compute_product_price(&cfg, PERMIT_TYPE::DAY_TICKET, start, &productStart, &productEnd);
@ -216,6 +219,10 @@ int main() {
.arg(productEnd.time().toString(Qt::ISODate))
<< price;
price = get_minimal_parkingprice(&cfg, PERMIT_TYPE::DAY_TICKET, 0, start);
qCritical() << QString("line=%1 get_minimal_parkingprice:").arg(__LINE__)
<< price;
price = compute_product_price(&cfg, PERMIT_TYPE::DAY_TICKET, start);
qCritical() << QString("line=%1 price:").arg(__LINE__) << price;
@ -228,6 +235,9 @@ int main() {
.arg(productEnd.time().toString(Qt::ISODate))
<< price;
price = get_minimal_parkingprice(&cfg, PERMIT_TYPE::DAY_TICKET, 0, start);
qCritical() << QString("line=%1 get_minimal_parkingprice:").arg(__LINE__) << price;
start.setTime(QTime(16, 0, 0));
productStart = productEnd = QDateTime();
price = compute_product_price(&cfg, PERMIT_TYPE::DAY_TICKET, start, &productStart, &productEnd);
@ -237,14 +247,23 @@ int main() {
.arg(productEnd.time().toString(Qt::ISODate))
<< price;
price = get_minimal_parkingprice(&cfg, PERMIT_TYPE::DAY_TICKET, 0, start);
qCritical() << QString("line=%1 get_minimal_parkingprice:").arg(__LINE__) << price;
start.setTime(QTime(17, 0, 0));
productStart = productEnd = QDateTime();
price = compute_product_price(&cfg, PERMIT_TYPE::INVALID, start, &productStart, &productEnd);
price = compute_product_price(&cfg, PERMIT_TYPE::DAY_TICKET, start, &productStart, &productEnd);
qCritical() << QString("line=%1 price (%2-%3) :")
.arg(__LINE__)
.arg(productStart.time().toString(Qt::ISODate))
.arg(productEnd.time().toString(Qt::ISODate))
<< price;
price = get_minimal_parkingprice(&cfg, PERMIT_TYPE::DAY_TICKET, 0, start);
qCritical() << QString("line=%1 get_minimal_parkingprice:").arg(__LINE__) << price;
price = get_minimal_parkingprice(&cfg, PERMIT_TYPE::DAY_TICKET);
qCritical() << QString("line=%1 get_minimal_parkingprice:").arg(__LINE__) << price;
}
#endif
@ -372,7 +391,7 @@ int main() {
int pop_carry_over;
int pop_carry_over_time_range_id;
for (int zone=5; zone < 6; ++zone) {
for (int zone=6; zone < 7; ++zone) {
//for (int t=6; t < 7; t+=20) {
switch (zone) {
case 1: {
@ -831,6 +850,7 @@ int main() {
}
if (zone == 6) { // sondertarif: 24h ticket wohnmobile
// 8 euro; hoechstparkdauer 24h
pop_min_time = get_minimal_parkingtime(&cfg);
pop_max_time = get_maximal_parkingtime(&cfg);
pop_min_price = get_minimal_parkingprice(&cfg);
@ -858,8 +878,18 @@ int main() {
<< productEnd.toString(Qt::ISODate);
exit(-1);
} else {
qCritical() << v << productStart.toString(Qt::ISODate)
int const secs = productStart.secsTo(productEnd);
if (secs != 86400) {
qCritical() << "ERROR" << i << secs << v
<< productStart.toString(Qt::ISODate)
<< productEnd.toString(Qt::ISODate);
exit(-1);
} else {
qCritical() << i << secs << v
<< productStart.toString(Qt::ISODate)
<< productEnd.toString(Qt::ISODate);
}
}
start = start.addSecs(60);