PlanMasterControllerTest.cc 1.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * 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)
    : _masterController(NULL)
{
    
}

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

    _masterController = new PlanMasterController(this);
30
    _masterController->start(false /* flyView */);
31 32 33 34 35 36 37 38 39 40 41 42
}

void PlanMasterControllerTest::cleanup(void)
{
    delete _masterController;
    _masterController = NULL;

    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);
}