Adapted basic interpolator tests

refs #169
This commit is contained in:
Roland Winklmeier
2014-03-14 18:15:26 +01:00
parent 00356bbef6
commit 7f333da322
2 changed files with 14 additions and 1 deletions

View File

@@ -4,7 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "testinterpolator.h" #include "testinterpolator.h"
#include "blackcore/interpolator_linear.h"
using namespace BlackCore; using namespace BlackCore;
using namespace BlackMisc::Aviation;
using namespace BlackMisc::PhysicalQuantities;
namespace BlackCoreTest namespace BlackCoreTest
{ {
@@ -14,7 +18,17 @@ namespace BlackCoreTest
*/ */
void CTestInterpolator::interpolatorBasics() void CTestInterpolator::interpolatorBasics()
{ {
IInterpolator *interpolator = new CInterpolatorLinear();
QVERIFY2(!interpolator->hasEnoughAircraftSituations(), "Interpolator cannot have enough situations. They should be 0!");
CAircraftSituation situation;
interpolator->addAircraftSituation(situation);
QTest::qSleep(6100);
situation.setHeight(CLength(500, CLengthUnit::ft()));
interpolator->addAircraftSituation(situation);
QVERIFY2(interpolator->hasEnoughAircraftSituations(), "Interpolator should have enough situations!");
} }
} // namespace } // namespace

View File

@@ -6,7 +6,6 @@
#ifndef BLACKCORETEST_TESTAVIATIONBASE_H #ifndef BLACKCORETEST_TESTAVIATIONBASE_H
#define BLACKCORETEST_TESTAVIATIONBASE_H #define BLACKCORETEST_TESTAVIATIONBASE_H
#include "blackcore/interpolator.h"
#include <QtTest/QtTest> #include <QtTest/QtTest>
namespace BlackCoreTest namespace BlackCoreTest