author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 17 Dec 2009 09:09:50 +0200 | |
changeset 26 | 5d0ec8b709be |
parent 23 | 50974a8b132e |
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 <e32std.h> |
|
20 |
#include <StifParser.h> |
|
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
21 |
#include <StifTestInterface.h> |
5 | 22 |
#include <logcli.h> |
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
23 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
5 | 24 |
#include <logwrap.h> |
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
25 |
#else |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
26 |
#include <logwrap.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
27 |
#include <logengevents.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
28 |
#include <logwraplimits.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
29 |
#include <logfilterandeventconstants.hrh> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
30 |
#include <logengdurations.h> |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
31 |
#endif |
5 | 32 |
|
33 |
#include "loggingasyncservice.h" |
|
34 |
#include "loggingservice.h" |
|
35 |
#include "loggingfilter.h" |
|
36 |
||
37 |
#include "tlogging.h" |
|
38 |
#include "tlogcallback.h" |
|
39 |
#include "loggingevent.h" |
|
40 |
||
41 |
||
42 |
//------------------------------------------------------------------ |
|
43 |
//Concurrenttest5, core class test for concurrent async calls |
|
44 |
// AddEvent and AddEvent async test |
|
45 |
//------------------------------------------------------------------ |
|
46 |
||
47 |
TInt concurrenttest5(void) |
|
48 |
{ |
|
49 |
// TInt ret ; |
|
50 |
// TInt flag ; |
|
51 |
||
52 |
_LIT(KOwnEventSubject, "RandomLogEvent"); |
|
53 |
_LIT(KOwnEventRemoteParty, "OwnContact"); |
|
54 |
||
55 |
||
56 |
CLoggingService *LogService = CLoggingService :: NewL() ; |
|
57 |
CLogsEvent* event = CLogsEvent::NewL(); |
|
58 |
||
59 |
// Sets the duration of the event in seconds. |
|
60 |
// Randomize something between 0-299 |
|
61 |
||
62 |
event->SetDuration(300); |
|
63 |
||
64 |
TBuf<KLogMaxDirectionLength> direction; |
|
65 |
||
66 |
// Direction of the event is randomized |
|
67 |
||
68 |
TInt dirID = R_LOG_DIR_IN; |
|
69 |
TUid eventTypeID = KLogCallEventTypeUid; |
|
70 |
event->SetEventType(eventTypeID); |
|
71 |
event->SetSubject(KOwnEventSubject); |
|
72 |
TTime time; // creation time from the device clock |
|
73 |
time.HomeTime(); |
|
74 |
event->SetTime(time); |
|
75 |
||
76 |
TBuf<KLogMaxNumberLength> number; // Randomize number |
|
77 |
number.AppendNum(7000000); |
|
78 |
event->SetNumber(number); |
|
79 |
event->SetRemoteParty(KOwnEventRemoteParty); |
|
80 |
MLogCallback Mycb ; |
|
81 |
TLogId ret = LogService->AddEventL(1 , event , &Mycb) ; |
|
82 |
||
83 |
delete event ; |
|
84 |
delete LogService; |
|
85 |
return KErrNone ; |
|
86 |
||
87 |
||
88 |
} |
|
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
89 |