PlanMasterControllerTest.cc 1.45 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 31
    _masterController->setFlyView(false);
    _masterController->start();
32 33 34 35 36
}

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

    UnitTest::cleanup();
}

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


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