LinkManagerTest.h 1.28 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/

Don Gagne's avatar
Don Gagne committed
10

11 12
#ifndef LINKMANAGERTEST_H
#define LINKMANAGERTEST_H
Don Gagne's avatar
Don Gagne committed
13

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

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

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

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

Don Gagne's avatar
Don Gagne committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
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
55 56 57
};

#endif