PlanMasterControllerTest.cc 1.43 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

#include "PlanMasterControllerTest.h"
#include "LinkManager.h"
#include "MultiVehicleManager.h"
#include "SimpleMissionItem.h"
#include "MissionSettingsItem.h"
#include "QGCApplication.h"
#include "SettingsManager.h"
#include "AppSettings.h"

PlanMasterControllerTest::PlanMasterControllerTest(void)
20
    : _masterController(nullptr)
21 22 23 24 25 26 27 28 29
{
    
}

void PlanMasterControllerTest::init(void)
{
    UnitTest::init();

    _masterController = new PlanMasterController(this);
30
    _masterController->start(false /* flyView */);
31 32 33 34 35
}

void PlanMasterControllerTest::cleanup(void)
{
    delete _masterController;
36
    _masterController = nullptr;
37 38 39 40 41 42

    UnitTest::cleanup();
}

void PlanMasterControllerTest::_testMissionFileLoad(void)
{
DonLakeFlyer's avatar
DonLakeFlyer committed
43
    _masterController->loadFromFile(":/unittest/OldFileFormat.mission");
44 45 46 47 48 49
    QCOMPARE(_masterController->missionController()->visualItems()->count(), 7);
}


void PlanMasterControllerTest::_testMissionPlannerFileLoad(void)
{
DonLakeFlyer's avatar
DonLakeFlyer committed
50
    _masterController->loadFromFile(":/unittest/MissionPlanner.waypoints");
51 52
    QCOMPARE(_masterController->missionController()->visualItems()->count(), 6);
}