wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.h
changeset 38 2dc6da6fb431
parent 29 dbe86d96ce5b
child 41 a87deff717bc
child 45 d9ec2b8c6bad
equal deleted inserted replaced
29:dbe86d96ce5b 38:2dc6da6fb431
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * This is the header file for testing Wlan Qt Utilities library.
       
    16 */
       
    17 
       
    18 #ifndef TESTWLANQTUTILS_H_
       
    19 #define TESTWLANQTUTILS_H_
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 class QSignalSpy;
       
    24 class WlanQtUtils;
       
    25 
       
    26 class TestWlanQtUtils: public QObject
       
    27 {
       
    28     Q_OBJECT
       
    29     
       
    30 private slots:
       
    31 
       
    32     // Functions from QTest framework.
       
    33     void initTestCase();
       
    34     void cleanupTestCase();
       
    35     void init();
       
    36     void cleanup();
       
    37 
       
    38     // Test functions for public interface.
       
    39     void testAvailableWlanAps();
       
    40     void testAvailableWlanApsWithIaps();
       
    41     void testAvailableWlanApsSequence();
       
    42 
       
    43     void testCreateWlanIapOk();
       
    44     
       
    45     void testConnectIapOk();
       
    46     void testConnectIapErr();
       
    47     
       
    48     void testDisconnectIapOk();
       
    49 
       
    50     void testIapFound();
       
    51     void testIapNotFound();
       
    52     
       
    53     void testConnectedWlanIdFound();
       
    54     void testConnectedWlanIdFoundConstructor();
       
    55     void testConnectedWlanIdNotFound();
       
    56 
       
    57     void testScanWlans();
       
    58     
       
    59     void testWlanNetworkOpened();
       
    60     void testWlanNetworkClosed();
       
    61     
       
    62     // Test functions for private implementation (tested via public interface)
       
    63     void testConnectionTestPass();
       
    64     void testConnectionTestFail();
       
    65     
       
    66 private:
       
    67     
       
    68     // Helper functions, that is, sub test cases.
       
    69     void subTestSignalWaitAndTake(QSignalSpy *spy, QList<QVariant> *arguments);
       
    70     void subTestLoadCommsDatFile(QString newCommsdatFilename);
       
    71     void subTestNewWlanQtUtils();
       
    72 
       
    73     // Member variables.
       
    74     WlanQtUtils *wlanQtUtils_;
       
    75     QSignalSpy *signalScanReady_;
       
    76     QSignalSpy *signalWlanNetworkOpened_;
       
    77     QSignalSpy *signalWlanNetworkClosed_;
       
    78     
       
    79     /* Default CommsDat file name
       
    80     SNAP ID=3: Internet:
       
    81         IAP ID = 1: packet data 1
       
    82         IAP ID = 3: packet data 2
       
    83         IAP ID = 4: packet data 3
       
    84         IAP ID = 5: WLAN IAP 1, EWlanSecModeOpen
       
    85         IAP ID = 6: WLAN IAP 2, EWlanSecModeWep, w2key
       
    86         IAP ID = 7: WLAN IAP 3, EWlanSecModeWpa, wlan3key
       
    87     SNAP ID = 4: Multimedia msg.
       
    88     SNAP ID = 5: WAP services
       
    89     SNAP ID = 6: My Snap:
       
    90         IAP ID = 8: Home WLAN, EWlanSecModeOpen
       
    91         IAP ID = 9: Streaming
       
    92      */
       
    93     static const QString commsDatDefault_;
       
    94 };
       
    95 
       
    96 #endif /* TESTWLANQTUTILS_H_ */
       
    97