Add test cases BAD_NEUENAHR_AHRWEILER, zone2.
This commit is contained in:
		@@ -41,9 +41,9 @@ extern "C" char* strptime(const char* s,
 | 
				
			|||||||
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
 | 
					#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
 | 
				
			||||||
#define NEUHAUSER_BILEXA_GALTUER                (0)
 | 
					#define NEUHAUSER_BILEXA_GALTUER                (0)
 | 
				
			||||||
#define NEUHAUSER_KIRCHDORF                     (0)
 | 
					#define NEUHAUSER_KIRCHDORF                     (0)
 | 
				
			||||||
#define BAD_NEUENAHR_AHRWEILER                  (0)
 | 
					#define BAD_NEUENAHR_AHRWEILER                  (1)
 | 
				
			||||||
#define NEUHAUSER_CHRISTOPH_REISEN              (0)
 | 
					#define NEUHAUSER_CHRISTOPH_REISEN              (0)
 | 
				
			||||||
#define NEUHAUSER_PERNEGG_AN_DER_MUR            (1)
 | 
					#define NEUHAUSER_PERNEGG_AN_DER_MUR            (0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main() {
 | 
					int main() {
 | 
				
			||||||
#if NEUHAUSER_PERNEGG_AN_DER_MUR==1
 | 
					#if NEUHAUSER_PERNEGG_AN_DER_MUR==1
 | 
				
			||||||
@@ -408,29 +408,59 @@ int main() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					                bool fail;
 | 
				
			||||||
 | 
					                QDateTime start;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                for (int i=0; i < 4; ++i) {
 | 
				
			||||||
 | 
					                    switch (i) {
 | 
				
			||||||
 | 
					                    case 0:
 | 
				
			||||||
 | 
					                        start = QDateTime(QDate(2024, 5, 1), QTime(16, 0, 0)); // holiday
 | 
				
			||||||
 | 
					                        fail = false;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                    case 1:
 | 
				
			||||||
 | 
					                        start = QDateTime(QDate(2024, 4, 21), QTime(16, 0, 0)); // sunday
 | 
				
			||||||
 | 
					                        fail = false;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                    case 2:
 | 
				
			||||||
 | 
					                        start = QDateTime(QDate(2024, 4, 22), QTime(8, 0, 0)); // monday
 | 
				
			||||||
 | 
					                        fail = false;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                    case 3:
 | 
				
			||||||
 | 
					                        start = QDateTime(QDate(2024, 4, 22), QTime(17, 30, 0)); // monday
 | 
				
			||||||
 | 
					                        fail = true;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                    default:;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                QDateTime start(QDate(2024, 4, 14), QTime());
 | 
					 | 
				
			||||||
                    QDateTime end;
 | 
					                    QDateTime end;
 | 
				
			||||||
                    struct price_t price;
 | 
					                    struct price_t price;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    //start = QDateTime::currentDateTime();
 | 
					                    //start = QDateTime::currentDateTime();
 | 
				
			||||||
 | 
					                    QList<int> timeSteps;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                int paymentOptionIndex = cfg.getCurrentPaymentOptionIndex(start);
 | 
					                    int paymentOptionIndex = cfg.getPaymentOptionIndex(start);
 | 
				
			||||||
                    if (paymentOptionIndex != -1) {
 | 
					                    if (paymentOptionIndex != -1) {
 | 
				
			||||||
                        qCritical() << "paymentOptionIndex" << paymentOptionIndex;
 | 
					                        qCritical() << "paymentOptionIndex" << paymentOptionIndex;
 | 
				
			||||||
                    QList<int> const timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg, paymentOptionIndex);
 | 
					                        timeSteps = Calculator::GetInstance().GetTimeSteps(&cfg, paymentOptionIndex);
 | 
				
			||||||
                        qCritical() << "TimeSteps" << timeSteps;
 | 
					                        qCritical() << "TimeSteps" << timeSteps;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    // QDateTime start = s.addSecs(offset * 60);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        QList<int>::const_iterator step;
 | 
					                        QList<int>::const_iterator step;
 | 
				
			||||||
                        for (step = timeSteps.cbegin(); step != timeSteps.cend(); ++step) {
 | 
					                        for (step = timeSteps.cbegin(); step != timeSteps.cend(); ++step) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            double cost = 0;
 | 
					                            double cost = 0;
 | 
				
			||||||
 | 
					                            CalcState cs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        //if (compute_price_for_parking_ticket(&cfg, start, *step, end, &price)) {
 | 
					                            if ((cs = compute_price_for_parking_ticket(&cfg, start, *step, end, &price))) {
 | 
				
			||||||
                        //    cost = price.netto;
 | 
					                                cost = price.netto;
 | 
				
			||||||
                        //}
 | 
					                                qCritical() << "step" << *step << ": cost" << cost;
 | 
				
			||||||
 | 
					                            } else {
 | 
				
			||||||
 | 
					                                if (fail == false) {
 | 
				
			||||||
 | 
					                                    qCritical() << "<<<ERROR>>> cs =" << QString(cs);
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                        qCritical() << "ERROR paymentOptionIndex =" << paymentOptionIndex;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user