Repeated tests for KIRCHDORF. Re-added utility test_neuhauser_kirchdorf(). Found bug during testing, accessing vector of size 0.

This commit is contained in:
Gerhard Hoffmann 2024-04-24 11:56:50 +02:00
parent f17c4f240b
commit d8ec41ebfc

View File

@ -36,15 +36,134 @@ extern "C" char* strptime(const char* s,
#define SZEGED (0)
#define SCHOENAU_KOENIGSEE (0)
#define NEUHAUSER_KORNEUBURG (1)
#define NEUHAUSER_KORNEUBURG (0)
#define NEUHAUSER_LINSINGER_MASCHINENBAU (0)
#define NEUHAUSER_NORDISCHES_AUSBILDUNGSZENTRUM (0)
#define NEUHAUSER_BILEXA_GALTUER (0)
#define NEUHAUSER_KIRCHDORF (0)
#define NEUHAUSER_KIRCHDORF (1)
#define BAD_NEUENAHR_AHRWEILER (0)
#define NEUHAUSER_CHRISTOPH_REISEN (0)
#define NEUHAUSER_PERNEGG_AN_DER_MUR (0)
#if NEUHAUSER_KIRCHDORF==1
static bool test_neuhauser_kirchdorf(int step, double cost) {
return true;
switch (step) {
case 30:
if (cost != 30) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 30;
return false;
}
break;
case 35:
if (cost != 40) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 40;
return false;
}
break;
case 40:
if (cost != 50) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 50;
return false;
}
break;
case 45:
if (cost != 60) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 60;
return false;
}
break;
case 50:
if (cost != 70) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 70;
return false;
}
break;
case 55:
if (cost != 80) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 80;
return false;
}
break;
case 60:
if (cost != 90) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 90;
return false;
}
break;
case 65:
if (cost != 100) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 100;
return false;
}
break;
case 70:
if (cost != 110) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 110;
return false;
}
break;
case 75:
if (cost != 120) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 120;
return false;
}
break;
case 80:
if (cost != 130) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 130;
return false;
}
break;
case 85:
if (cost != 140) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 140;
return false;
}
break;
case 90:
if (cost != 150) {
qCritical() << "ERROR COMPUTING COST"
<< "HAVE" << cost
<< "SHOULD" << 150;
return false;
}
break;
default:
break;
}
return true;
}
#endif
int main() {
#if NEUHAUSER_PERNEGG_AN_DER_MUR==1
std::ifstream input;
@ -527,6 +646,7 @@ int main() {
}
#endif
#if NEUHAUSER_KIRCHDORF==1
//if (QDir("/opt/app/tools/atbupdate/customer_743").exists()) {
// if(QFileInfo::exists("/etc/psa_tariff/tariff01.json")) {