|
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_LOGSREADER_H |
|
18 #define UT_LOGSREADER_H |
|
19 |
|
20 #include <QObject> |
|
21 #include <f32file.h> |
|
22 #include "logsengdefs.h" |
|
23 #include "logsreaderobserver.h" |
|
24 |
|
25 class LogsDbConnector; |
|
26 class LogsEvent; |
|
27 class CLogClient; |
|
28 class LogsReader; |
|
29 |
|
30 class UT_LogsReader : public QObject, public LogsReaderObserver |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 private slots: |
|
35 |
|
36 /* |
|
37 * In addition, there are four private slots that are not treated as testfunctions. |
|
38 * They will be executed by the testing framework and can be used to initialize and clean up |
|
39 * either the entire test or the current test function. |
|
40 * |
|
41 * initTestCase() will be called before the first testfunction is executed. |
|
42 * cleanupTestCase() will be called after the last testfunction was executed. |
|
43 * init() will be called before each testfunction is executed. |
|
44 * cleanup() will be called after every testfunction. |
|
45 */ |
|
46 void initTestCase(); |
|
47 void cleanupTestCase(); |
|
48 void init(); |
|
49 void cleanup(); |
|
50 |
|
51 private slots: //test methods |
|
52 |
|
53 void testConstructor(); |
|
54 void testStart(); |
|
55 void testStart2(); |
|
56 void testStop(); |
|
57 void testMarkEventSeen(); |
|
58 void testReadDuplicates(); |
|
59 void testRunL(); |
|
60 void testRunError(); |
|
61 void testStateContext(); |
|
62 void testViewChange(); |
|
63 void testUpdateDetails(); |
|
64 |
|
65 protected: // From LogsReaderObserver |
|
66 |
|
67 void readCompleted(int readCount); |
|
68 void errorOccurred(int err); |
|
69 void temporaryErrorOccurred(int err); |
|
70 void eventModifyingCompleted(); |
|
71 void duplicatesReadingCompleted(QList<LogsEvent*> duplicates); |
|
72 |
|
73 private: |
|
74 |
|
75 LogsReader* mReader; |
|
76 |
|
77 bool mErrorOccurred; |
|
78 int mError; |
|
79 |
|
80 QList<LogsEvent*> mEvents; |
|
81 RFs mFs; |
|
82 CLogClient* mLogClient; |
|
83 LogsEventStrings mStrings; |
|
84 |
|
85 }; |
|
86 |
|
87 |
|
88 #endif //UT_LOGSREADER_H |