LinkManagerTest.h 1.24 KB
Newer Older
1 2
/****************************************************************************
 *
3
 *   (c) 2009-2018 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

Don Gagne's avatar
Don Gagne committed
10

11
#pragma once
Don Gagne's avatar
Don Gagne committed
12

Don Gagne's avatar
Don Gagne committed
13
#include "UnitTest.h"
Don Gagne's avatar
Don Gagne committed
14
#include "LinkManager.h"
Don Gagne's avatar
Don Gagne committed
15
#include "MultiSignalSpy.h"
Don Gagne's avatar
Don Gagne committed
16 17 18 19 20 21

/// @file
///     @brief LinkManager Unit Test
///
///     @author Don Gagne <don@thegagnes.com>

Don Gagne's avatar
Don Gagne committed
22
class LinkManagerTest : public UnitTest
Don Gagne's avatar
Don Gagne committed
23 24
{
    Q_OBJECT
25

Don Gagne's avatar
Don Gagne committed
26 27 28 29 30 31 32
public:
    LinkManagerTest(void);
    
private slots:
    void init(void);
    void cleanup(void);
    
Don Gagne's avatar
Don Gagne committed
33 34 35 36
    void _add_test(void);
    void _delete_test(void);
    void _addSignals_test(void);
    void _deleteSignals_test(void);
37

Don Gagne's avatar
Don Gagne committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
private:
    enum {
        newLinkSignalIndex = 0,
        linkDeletedSignalIndex,
        maxSignalIndex
    };
    
    enum {
        newLinkSignalMask =     1 << newLinkSignalIndex,
        linkDeletedSignalMask = 1 << linkDeletedSignalIndex,
    };

    LinkManager*        _linkMgr;
    MultiSignalSpy*     _multiSpy;
    static const size_t _cSignals = maxSignalIndex;
    const char*         _rgSignals[_cSignals];
Don Gagne's avatar
Don Gagne committed
54 55
};