Skip to content
Snippets Groups Projects
LinkManagerTest.h 1.28 KiB
Newer Older
  • Learn to ignore specific revisions
  • /****************************************************************************
     *
     *   (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.
     *
     ****************************************************************************/
    
    
    #ifndef LINKMANAGERTEST_H
    #define LINKMANAGERTEST_H
    
    Don Gagne's avatar
    Don Gagne committed
    #include "UnitTest.h"
    
    Don Gagne's avatar
    Don Gagne committed
    #include "LinkManager.h"
    
    Don Gagne's avatar
    Don Gagne committed
    #include "MultiSignalSpy.h"
    
    Don Gagne's avatar
    Don Gagne committed
    
    /// @file
    ///     @brief LinkManager Unit Test
    ///
    ///     @author Don Gagne <don@thegagnes.com>
    
    
    Don Gagne's avatar
    Don Gagne committed
    class LinkManagerTest : public UnitTest
    
    Don Gagne's avatar
    Don Gagne committed
    {
        Q_OBJECT
    
    Don Gagne's avatar
    Don Gagne committed
    public:
        LinkManagerTest(void);
        
    private slots:
        void init(void);
        void cleanup(void);
        
    
    Don Gagne's avatar
    Don Gagne committed
        void _add_test(void);
        void _delete_test(void);
        void _addSignals_test(void);
        void _deleteSignals_test(void);
    
    Don Gagne's avatar
    Don Gagne committed
    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
    };
    
    #endif