|
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 * |
|
16 */ |
|
17 #ifndef UT_CNTPREFILTERING_H |
|
18 #define UT_CNTPREFILTERING_H |
|
19 |
|
20 #include <QObject> |
|
21 #include <qcontactmanager.h> |
|
22 |
|
23 QTM_USE_NAMESPACE |
|
24 |
|
25 class LogsCntFinder; |
|
26 |
|
27 |
|
28 class pt_LogsCntFinder : public QObject |
|
29 { |
|
30 Q_OBJECT |
|
31 public: |
|
32 |
|
33 inline pt_LogsCntFinder( int samples ) : mSamples(samples) {} |
|
34 |
|
35 private slots: |
|
36 |
|
37 /* |
|
38 * In addition, there are four private slots that are not treated as testfunctions. |
|
39 * They will be executed by the testing framework and can be used to initialize and clean up |
|
40 * either the entire test or the current test function. |
|
41 * |
|
42 * initTestCase() will be called before the first testfunction is executed. |
|
43 * cleanupTestCase() will be called after the last testfunction was executed. |
|
44 * init() will be called before each testfunction is executed. |
|
45 * cleanup() will be called after every testfunction. |
|
46 */ |
|
47 void initTestCase(); |
|
48 void cleanupTestCase(); |
|
49 void init(); |
|
50 void cleanup(); |
|
51 |
|
52 private slots: //test methods |
|
53 |
|
54 void testPredictiveQuery(); |
|
55 void testExtendedQuery(); |
|
56 void testDiffHitQuery(); |
|
57 void statistics(); |
|
58 |
|
59 private: |
|
60 void createContacts(); |
|
61 void createContact_one_Contact(QString& firstname, QString& Lastname, QString phnumber); |
|
62 |
|
63 QContactFilter::MatchFlags flag(int f); |
|
64 |
|
65 private: |
|
66 |
|
67 QContactManager *m_manager; |
|
68 LogsCntFinder *m_finder; |
|
69 int mSamples; |
|
70 }; |
|
71 |
|
72 |
|
73 #endif //UT_CNTSPREFILTERING_H |