|
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 <e32std.h> |
|
20 #include <StifParser.h> |
|
21 #include <Stiftestinterface.h> |
|
22 #include <logcli.h> |
|
23 #include <logwrap.h> |
|
24 |
|
25 #include "loggingasyncservice.h" |
|
26 #include "loggingservice.h" |
|
27 #include "loggingfilter.h" |
|
28 |
|
29 #include "tlogging.h" |
|
30 #include "tlogcallback.h" |
|
31 #include "loggingevent.h" |
|
32 |
|
33 |
|
34 //------------------------------------------------------------------ |
|
35 //Concurrenttest5, core class test for concurrent async calls |
|
36 // AddEvent and AddEvent async test |
|
37 //------------------------------------------------------------------ |
|
38 |
|
39 TInt concurrenttest5(void) |
|
40 { |
|
41 // TInt ret ; |
|
42 // TInt flag ; |
|
43 |
|
44 _LIT(KOwnEventSubject, "RandomLogEvent"); |
|
45 _LIT(KOwnEventRemoteParty, "OwnContact"); |
|
46 |
|
47 |
|
48 CLoggingService *LogService = CLoggingService :: NewL() ; |
|
49 CLogsEvent* event = CLogsEvent::NewL(); |
|
50 |
|
51 // Sets the duration of the event in seconds. |
|
52 // Randomize something between 0-299 |
|
53 |
|
54 event->SetDuration(300); |
|
55 |
|
56 TBuf<KLogMaxDirectionLength> direction; |
|
57 |
|
58 // Direction of the event is randomized |
|
59 |
|
60 TInt dirID = R_LOG_DIR_IN; |
|
61 TUid eventTypeID = KLogCallEventTypeUid; |
|
62 event->SetEventType(eventTypeID); |
|
63 event->SetSubject(KOwnEventSubject); |
|
64 TTime time; // creation time from the device clock |
|
65 time.HomeTime(); |
|
66 event->SetTime(time); |
|
67 |
|
68 TBuf<KLogMaxNumberLength> number; // Randomize number |
|
69 number.AppendNum(7000000); |
|
70 event->SetNumber(number); |
|
71 event->SetRemoteParty(KOwnEventRemoteParty); |
|
72 MLogCallback Mycb ; |
|
73 TLogId ret = LogService->AddEventL(1 , event , &Mycb) ; |
|
74 |
|
75 delete event ; |
|
76 delete LogService; |
|
77 return KErrNone ; |
|
78 |
|
79 |
|
80 } |
|
81 |