author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 17 Dec 2009 09:09:50 +0200 | |
changeset 26 | 5d0ec8b709be |
parent 5 | 989d2f495d90 |
permissions | -rw-r--r-- |
5 | 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 the License "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 |
||
18 |
#include <e32svr.h> |
|
19 |
#include "tloggingservicetest.h" |
|
20 |
#include <logcli.h> |
|
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
21 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
5 | 22 |
#include <logwrap.h> |
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
23 |
#else |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
24 |
#include <logwrap.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
25 |
#include <logengevents.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
26 |
#include <logwraplimits.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
27 |
#include <logfilterandeventconstants.hrh> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
28 |
#include <logengdurations.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
29 |
#endif |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
30 |
|
5 | 31 |
|
32 |
#include "loggingasyncservice.h" |
|
33 |
#include "loggingsyncservice.h" |
|
34 |
#include "loggingfilter.h" |
|
35 |
#include "loggingservice.h" |
|
36 |
#include "loggingevent.h" |
|
37 |
#include "tlogcallback.h" |
|
38 |
||
39 |
||
40 |
||
41 |
#include "logiter.h" |
|
42 |
||
43 |
||
44 |
||
45 |
||
46 |
||
47 |
||
48 |
//addevents1() |
|
49 |
||
50 |
||
51 |
TInt addevents1(void ) |
|
52 |
{ |
|
53 |
||
54 |
CLoggingService *iLoggingService = CLoggingService::NewL(); |
|
55 |
CLogsEvent *iLogsEvent = CLogsEvent::NewL(); |
|
56 |
MLogCallback icallback; |
|
57 |
||
58 |
||
59 |
TInt error1 = iLoggingService->AddEventL(iLogsEvent); |
|
60 |
iLogsEvent->SetDuration(300); |
|
61 |
TRAPD(ret2, iLoggingService->AddEventL(iLogsEvent)); |
|
62 |
TUid tuid = KLogCallEventTypeUid; |
|
63 |
iLogsEvent->SetEventType(tuid); |
|
64 |
TInt error2= iLoggingService->AddEventL(iLogsEvent); |
|
65 |
iLogsEvent->SetSubject(_L("Testing")); |
|
66 |
TRAPD(ret4, iLoggingService->AddEventL(iLogsEvent)); |
|
67 |
TTime itime; |
|
68 |
itime.HomeTime(); |
|
69 |
iLogsEvent->SetTime(itime); |
|
70 |
TRAPD(ret5, iLoggingService->AddEventL(iLogsEvent)); |
|
71 |
||
72 |
TBuf<KLogMaxNumberLength> number; // Randomize number |
|
73 |
number.AppendNum(9886665142); |
|
74 |
iLogsEvent->SetNumber(number); |
|
75 |
iLogsEvent->SetDirection(R_LOG_DIR_IN); |
|
76 |
iLogsEvent->SetRemoteParty(_L("contact")); |
|
77 |
||
78 |
TRAPD(ret6, iLoggingService->AddEventL(iLogsEvent)); |
|
79 |
||
80 |
||
81 |
||
82 |
// TRAPD(ret7, iLoggingService->AddEventL(iLogsEvent)); |
|
83 |
||
84 |
TInt iint = 0; |
|
85 |
||
86 |
||
87 |
//TLogId ret8= iLoggingService->AddEventL(iLogsEvent); |
|
88 |
// iLoggingService->DeleteEventL(1 , ret8 ,&icallback); |
|
89 |
// icallback.Start() ; |
|
90 |
||
91 |
CLogsEvent *DeletedEvent = CLogsEvent :: NewL() ; |
|
92 |
// DeletedEvent->SetId(ret8) ; |
|
93 |
||
94 |
delete iLogsEvent; |
|
95 |
delete iLoggingService; |
|
96 |
delete DeletedEvent; |
|
97 |
||
98 |
if(error1<0) |
|
99 |
if(error2>0) |
|
100 |
if(ret2==0) |
|
101 |
if(ret4==0) |
|
102 |
if(ret5==0) |
|
103 |
if(ret6==0) |
|
104 |
// if(ret7==0) |
|
105 |
// if(ret8>0) |
|
106 |
||
107 |
||
108 |
return KErrNone; |
|
109 |
return KErrGeneral; |
|
110 |
||
111 |
} |
|
112 |
||
113 |
||
114 |
||
115 |
||
116 |
||
117 |
||
118 |
||
119 |
||
120 |
//addevents2() |
|
121 |
||
122 |
||
123 |
TInt addevents2(void ) |
|
124 |
{ |
|
125 |
||
126 |
CLoggingService *iLoggingService = CLoggingService::NewL(); |
|
127 |
CLogsEvent *iLogsEvent = CLogsEvent::NewL(); |
|
128 |
MLogCallback icallback; |
|
129 |
const TUid KLogtestEventTypeUid = {0x1000550C}; |
|
130 |
||
131 |
iLogsEvent->SetDuration(300); |
|
132 |
TUid tuid = KLogtestEventTypeUid; |
|
133 |
// iLogsEvent->SetEventType(tuid); |
|
134 |
iLogsEvent->SetSubject(_L("Testing")); |
|
135 |
TTime itime; |
|
136 |
itime.HomeTime(); |
|
137 |
iLogsEvent->SetTime(itime); |
|
138 |
||
139 |
TBuf<KLogMaxNumberLength> number; // Randomize number |
|
140 |
number.AppendNum(919886665142); |
|
141 |
iLogsEvent->SetNumber(number); |
|
142 |
||
143 |
iLogsEvent->SetRemoteParty(_L("contact")); |
|
144 |
iLogsEvent->SetDirection(1); |
|
145 |
||
146 |
TInt error2= iLoggingService->AddEventL(iLogsEvent); |
|
147 |
||
148 |
// TUid tuid1 = -1; |
|
149 |
||
150 |
// TInt error3 = iLoggingService->AddEventL(iLogsEvent,tuid1); |
|
151 |
||
152 |
delete iLoggingService; |
|
153 |
delete iLogsEvent; |
|
154 |
||
155 |
if(error2<0) |
|
156 |
||
157 |
||
158 |
return KErrNone; |
|
159 |
return KErrGeneral; |
|
160 |
||
161 |
} |
|
162 |
||
163 |
||
164 |
||
165 |
||
166 |
||
167 |
||
168 |
||
169 |
||
170 |
||
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
171 |