wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.h
changeset 38 2dc6da6fb431
child 39 7b3e49e4608a
equal deleted inserted replaced
29:dbe86d96ce5b 38:2dc6da6fb431
       
     1 /*
       
     2 * Copyright (c) 2009-2010 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 testAvailableWlan();
       
    40     void testAvailableWlanDuplicates();
       
    41     void testAvailableWlanSecModes();
       
    42     void testAvailableWlanSsids();
       
    43     void testAvailableWlanWithIaps();
       
    44     void testAvailableWlanSequence();
       
    45 
       
    46     void testCreateIapOk();
       
    47     void testCreateIapErr();
       
    48     void testCreateIapWepKeys();
       
    49     
       
    50     void testUpdateIapOk();
       
    51     void testUpdateIapErr();
       
    52     
       
    53     void testDeleteIapOk();
       
    54     void testDeleteIapErr();
       
    55     
       
    56     void testConnectIapOk();
       
    57     void testConnectIapErr();
       
    58     
       
    59     void testDisconnectIapOk();
       
    60     void testDisconnectIapIgnored();
       
    61 
       
    62     void testConnectionStatus();
       
    63     
       
    64     void testIapNameFound();
       
    65     void testIapNameNotFound();
       
    66     
       
    67     void testActiveIapFound();
       
    68     void testActiveIapFoundConstructor();
       
    69     void testActiveIapNotFound();
       
    70 
       
    71     void testScanWlans();
       
    72     void testScanWlansIgnored();
       
    73     
       
    74     void testStopWlanScanOk();
       
    75     void testStopWlanScanIgnored();
       
    76 
       
    77     void testWlanNetworkOpened();
       
    78     void testWlanNetworkClosed();
       
    79 
       
    80     void testApCopyConstructor();
       
    81     
       
    82     // Test functions for private implementation (tested via public interface)
       
    83     void testConnectionTestOk();
       
    84     void testConnectionTestErr();
       
    85 
       
    86     void testConnMonEventGprs();
       
    87     void testConnMonEventCreatedBeforeConstructor();
       
    88 
       
    89 private:
       
    90     
       
    91     // Helper functions, that is, sub test cases.
       
    92     void subTestSignalWaitAndTake(QSignalSpy *spy, QList<QVariant> *arguments);
       
    93     void subTestLoadCommsDatFile(QString newCommsdatFilename);
       
    94     void subTestNewWlanQtUtils();
       
    95 
       
    96     // Member variables.
       
    97     WlanQtUtils *wlanQtUtils_;
       
    98     QSignalSpy *signalScanReady_;
       
    99     QSignalSpy *signalWlanNetworkOpened_;
       
   100     QSignalSpy *signalWlanNetworkClosed_;
       
   101     QSignalSpy *signalIctResult_;
       
   102     
       
   103     /* Default CommsDat file name
       
   104     SNAP ID=3: Internet:
       
   105         IAP ID = 1: packet data 1
       
   106         IAP ID = 3: packet data 2
       
   107         IAP ID = 4: packet data 3
       
   108         IAP ID = 5: WLAN IAP 1, EWlanSecModeOpen
       
   109         IAP ID = 6: WLAN IAP 2, EWlanSecModeWep, w2key
       
   110         IAP ID = 7: WLAN IAP 3, EWlanSecModeWpa, wlan3key
       
   111     SNAP ID = 4: Multimedia msg.
       
   112     SNAP ID = 5: WAP services
       
   113     SNAP ID = 6: My Snap:
       
   114         IAP ID = 8: Home WLAN, EWlanSecModeOpen
       
   115         IAP ID = 9: Streaming
       
   116      */
       
   117     static const QString commsDatDefault_;
       
   118 };
       
   119 
       
   120 #endif // TESTWLANQTUTILS_H
       
   121