First public contribution.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\emi\t_emi.cpp
21 #include <e32def_private.h>
22 #include "d_emitest.h"
26 LOCAL_D RTest test(_L("T_EMI"));
28 _LIT(KEMITestLddFileName,"D_EMITEST");
29 const TInt KHeapSize=0x200;
37 Tests initialisation of the logging system, ensuring no memory leaks, and then that user events can
38 be added and read correctly.
40 The test tries filling and emptying the buffer from each possible start position.
41 Each time it over fills it (Causing offset to rotate) and each time try and take too many.
42 The last record should show the event lost flag. Each field is checked for consistency.
46 void TestEventLogging()
56 TUserTaskEventRecord outrec;
57 TUserTaskEventRecord rec[5];
58 TUserTaskEventRecord blank;
61 //! @SYMTestCaseID t_emi_0
63 //! @SYMTestCaseDesc Set/Get State
65 //! @SYMTestActions Sets the EMI user state randomly 100 times, and reads back the state.
66 //! @SYMTestExpectedResults The read back state should always be the same as set.
67 //! @SYMTestPriority High
68 //! @SYMTestStatus Defined
70 test.Next(_L("(Set/Get)State"));
75 test(Ldd.GetState()==no);
78 //! @SYMTestCaseID t_emi_1
80 //! @SYMTestCaseDesc Log Alloc/Free
82 //! @SYMTestActions Allocates different sizes of event log.
83 //! @SYMTestExpectedResults No memory leak.
84 //! @SYMTestPriority High
85 //! @SYMTestStatus Defined
87 test.Next(_L("TaskEventLogging - Log Alloc/Free"));
90 test(Ldd.TaskEventLogging(EFalse,0,ENone)==KErrNone);
91 test(Ldd.TaskEventLogging(EFalse,2,ENone)==KErrNone);
92 test(Ldd.TaskEventLogging(EFalse,200,ENone)==KErrNone);
93 test(Ldd.TaskEventLogging(EFalse,0,ENone)==KErrNone);
99 test(Ldd.TaskEventLogging(EFalse,200,ENone)==KErrNoMemory);
104 //! @SYMTestCaseID t_emi_2
106 //! @SYMTestCaseDesc AddTaskEvent/GetTaskEvent
108 //! @SYMTestActions Tries filling and emptying the buffer from each possible start position. Each time it over fills it (Causing offset to rotate) and each time try and take too many.
109 //! @SYMTestExpectedResults The last record of each group should show the event lost flag. Except for the lost record, the contents should be consistant with when the record was added.
110 //! @SYMTestPriority High
111 //! @SYMTestStatus Defined
113 test.Next(_L("AddTaskEvent/GetTaskEvent"));
115 test(!Ldd.GetTaskEvent(outrec));
117 test(Ldd.TaskEventLogging(EFalse,5,ENone)==KErrNone);
119 test(Ldd.AddTaskEvent(blank));
120 test(Ldd.GetTaskEvent(outrec));
124 test(!Ldd.GetTaskEvent(outrec));
126 // This next test tries filling and emptying the buffer from each possible start position.
127 // Each time it over fills it (Causeing offset to rotate) and each time try and take too many.
128 // The last record should show the event lost flag.
130 // To ensure the time field is samething like you'd expect, let it tick over by 50.
134 for (ii=0; ii<5; ii++)
136 test(Ldd.AddTaskEvent(blank)); //will be lost
139 rec[i].iType=(TUint8) ((Math::Random() & 255) | 128);
141 rec[i].iExtra=(TUint16) (Math::Random() & 65535);
142 rec[i].iPrevious=&rec[i];
143 rec[i].iNext=&rec[ii];
146 test(Ldd.AddTaskEvent(rec[i]));
147 rec[i].iUserState=no;
152 test(Ldd.GetTaskEvent(outrec));
154 test.Printf(_L("%x : Type %x(%x), Time %x, flag %x, ThdA %x ThdB %x\n"),i,outrec.iType,rec[i].iType,outrec.iTime, outrec.iFlags, outrec.iPrevious,outrec.iNext);
157 test((outrec.iFlags & KEMI_EventLost)==KEMI_EventLost);
159 test((outrec.iFlags & KEMI_EventLost)!=KEMI_EventLost);
161 test(outrec.iType==rec[i].iType);
162 test(outrec.iExtra==rec[i].iExtra);
163 test(outrec.iPrevious==rec[i].iPrevious);
164 test(outrec.iNext==rec[i].iNext);
165 test(outrec.iUserState==rec[i].iUserState);
166 if (outrec.iTime!=time)
168 if (outrec.iTime<time)
174 test(!Ldd.GetTaskEvent(outrec));
177 test.Printf(_L("Time = %i\n"),time);
182 } while ((changecount<50) && (iii<50));
183 test(changecount>=50);
189 /* Used by TestStartStopMonitors() and TestScheduleEventLogging() */
191 TBool ShortLivedThreadDone;
193 LOCAL_C TInt ShortLivedThread(TAny*)
198 ShortLivedThreadDone=ETrue;
204 TestStartStopMonitors
206 Checks Start monitor was iterated with current thread list on startup.
207 It then creates and destroys a thread, and see if it triggered the
208 monitor callbacks in the test driver. The test driver will add
209 events to the event log, which are read and checked.
213 void TestStartStopMonitors()
217 TUserTaskEventRecord outrec;
227 //! @SYMTestCaseID t_emi_5
229 //! @SYMTestCaseDesc Null/Sigma
231 //! @SYMTestActions Get the null and sigma thread pointers.
232 //! @SYMTestExpectedResults Non-null pointers, which are usable in the following tests.
233 //! @SYMTestPriority High
234 //! @SYMTestStatus Defined
237 test.Next(_L("Check Null/Sigma"));
238 sigmaThread=Ldd.GetSigmaThread();
239 test(sigmaThread!=NULL);
241 idleThread=Ldd.GetIdleThread();
242 test(idleThread!=NULL);
244 sigmaThread=((TInt*) sigmaThread)+1;
245 idleThread=((TInt*) idleThread)+1;
247 //! @SYMTestCaseID t_emi_3
249 //! @SYMTestCaseDesc Thread start/stop Monitors
251 //! @SYMTestActions The start stop monitors are enabled. The start/stop monitors have been made to add event log entries, to allow there execution to be visible. After all existing threads have be iterated by the start monitor, the log is first filled with random entries for the thread, and then the log is watched as a thread is started and stopped.
252 //! @SYMTestExpectedResults At least 15 threads should be iterated on activation, and then both monitors should be called for the new thread. The random entries should have changed to refer to the sigma thread.
253 //! @SYMTestPriority High
254 //! @SYMTestStatus Defined
256 test.Next(_L("Thread start/stop Monitors"));
259 test(Ldd.TaskEventLogging(EFalse,50,ENone)==KErrNone);
260 test(Ldd.TaskEventLogging(EFalse,50,ENormal)==KErrNone);
263 // Check Start monitor was iterated with current thread list.
264 test.Printf(_L("Check start monitor called for theads. (try %d)\n"),i);
270 while (Ldd.GetTaskEvent(outrec))
272 test(outrec.iType==128);
273 if (outrec.iPrevious==sigmaThread)
275 test.Printf(_L("Seen Sigma Thread\n"));
278 if (outrec.iPrevious==idleThread)
280 test.Printf(_L("Seen Idle Thread\n"));
286 test.Printf(_L("Records = %d\n"),no);
294 test.Next(_L("Check monitor behaviour on thead creation/deletion"));
296 // To test monitors, we need to create and destroy a thread, and see if it
297 // triggered the callbacks in the test driver. The test driver will add
298 // events to the event log.
301 // First Check for background noise
304 test(!Ldd.GetTaskEvent(outrec));
308 test.Printf(_L("Create Thread..\n"));
309 // Start thread, and let it die
311 test(thread.Create(_L("ShortLivedThread"),ShortLivedThread,KDefaultStackSize,KHeapSize,KHeapSize,NULL)==KErrNone);
313 test(stat==KRequestPending);
315 myNThread = Ldd.GetNThread(thread);
317 // Fill with records - should not survive cleanup
320 outrec.iType=(TUint8) (((Math::Random() & 63) + 10) | 128);
322 outrec.iPrevious= i<5?myNThread:(TAny*) Math::Random();
323 outrec.iNext= i>10?myNThread:(TAny*) Math::Random();
325 test(Ldd.AddTaskEvent(outrec));
330 User::WaitForRequest(stat);
332 test(Ldd.TaskEventLogging(EFalse,50,ENone)==KErrNone);
334 // Did it leave log as expected?
335 test.Printf(_L("Check for logging/Clearing\n"));
338 while (Ldd.GetTaskEvent(outrec))
342 test.Printf(_L("%x : Type %x, Time %x,ThdA %x ThdB %x\n"),i,outrec.iType,outrec.iTime, outrec.iPrevious,outrec.iNext);
344 if (outrec.iType==128)
346 test((TInt)outrec.iPrevious==((TInt) myNThread)+4);
349 if (outrec.iType==129)
351 test(outrec.iPrevious==myNThread);
356 test(outrec.iPrevious!=myNThread);
357 test(outrec.iNext!=myNThread);
367 Thread Tracking functions,
368 used in TestScheduleEventLogging() and TestTagMaskDFC()
378 TThreadList ThreadList[51];
381 inline TUint LookupThread(TAny* aThread)
383 for (TInt i=0; i<NoThreads;i++)
384 if (aThread==ThreadList[i].iThread)
388 ThreadList[NoThreads].iThread=aThread;
389 ThreadList[NoThreads].iRan=0;
396 void AddThread(TAny* aThread)
399 ThreadList[NoThreads].iThread=aThread;
400 ThreadList[NoThreads].iRan=0;
406 TestScheduleEventLogging
408 Checks AfterIdle, Null/Sigma thread lookup, Set/Get Loggable, as well as
409 Schedule Event logging. Select threads are marked as loggable, and starts a
410 new thread (that repeatadly sleeps for short times, to generate events).
411 The events are then collected and all of the fields checked. The test
415 void TestScheduleEventLogging()
424 TInt changecount = 0;
425 TUserTaskEventRecord outrec;
428 //! @SYMTestCaseID t_emi_4
430 //! @SYMTestCaseDesc AfterIdle
432 //! @SYMTestActions Uses AfterIdle.
433 //! @SYMTestExpectedResults No panic.
434 //! @SYMTestPriority High
435 //! @SYMTestStatus Defined
438 test.Next(_L("Check AfterIdle"));
442 //! @SYMTestCaseID t_emi_6
444 //! @SYMTestCaseDesc Set/Get Loggable
446 //! @SYMTestActions Get/Set ThreadLoggable are used on multiple threads.
447 //! @SYMTestExpectedResults The Get function should confirm that the Set function changed the loggable state.
448 //! @SYMTestPriority High
449 //! @SYMTestStatus Defined
451 test.Next(_L("Check Set/Get Loggable"));
452 myNThread=Ldd.GetSigmaThread();
453 test(myNThread!=NULL);
454 AddThread(myNThread);
456 myNThread=Ldd.GetIdleThread();
457 test(myNThread!=NULL);
458 AddThread(myNThread);
461 Ldd.SetThreadLoggable(myNThread,ETrue);
462 test(Ldd.GetThreadLoggable(myNThread)!=EFalse);
464 Ldd.SetThreadLoggable(myNThread,EFalse);
465 test(Ldd.GetThreadLoggable(myNThread)==EFalse);
467 Ldd.SetThreadLoggable(myNThread,ETrue);
468 test(Ldd.GetThreadLoggable(myNThread)!=EFalse);
471 //! @SYMTestCaseID t_emi_7
473 //! @SYMTestCaseDesc Set/Get VEMSData
475 //! @SYMTestActions Get/Set VEMSData are used on a thread 100 times.
476 //! @SYMTestExpectedResults The Get function should confirm that the Set function set the value correctly.
477 //! @SYMTestPriority High
478 //! @SYMTestStatus Defined
481 test.Next(_L("(Set/Get) VEMSData"));
483 test.Printf(_L("Spawn Thread\n"));
484 ShortLivedThreadDone=EFalse;
485 test(thread.Create(_L("ShortLivedThread"),ShortLivedThread,KDefaultStackSize,KHeapSize,KHeapSize,NULL)==KErrNone);
487 test(stat==KRequestPending);
488 myNThread = Ldd.GetNThread(thread);
489 Ldd.SetThreadLoggable(myNThread,ETrue);
490 AddThread(myNThread);
491 test(Ldd.GetThreadLoggable(myNThread)!=EFalse);
493 for (i=0; i<100; i++)
496 Ldd.SetVEMSData(myNThread,(TAny*)ii);
497 test((TInt)Ldd.GetVEMSData(myNThread)==ii);
500 //! @SYMTestCaseID t_emi_8
502 //! @SYMTestCaseDesc Task Event Logging
504 //! @SYMTestActions Task event logging is turned on, with a thread running in the background. Some threads set as loggable. Each event record is inspected, and a count for the seen thread in incremented. User state is incremented on each iteration.
505 //! @SYMTestExpectedResults Each thread ran at lest 10 times. Time changed over 45 times, but wrapped no more then once. User state changed over 15, some events where seen to be waiting, thread order is consistent, record type is correct, and at lest 100 records where read before the test finished.
506 //! @SYMTestPriority High
507 //! @SYMTestStatus Defined
511 test.Next(_L("Task Event Logging"));
516 test(Ldd.TaskEventLogging(ETrue,50,ENone)==KErrNone);
519 TInt prevNextThread=-1;
522 TBool seenWaiting=EFalse;
525 TUint lastUserState=0;
526 TInt userStateChange=0;
530 if (!Ldd.GetTaskEvent(outrec))
532 if ((i>100) && ShortLivedThreadDone)
535 test((ii++)<500); //timeout!
539 lastThread=LookupThread(outrec.iPrevious);
540 nextThread=LookupThread(outrec.iNext);
542 test.Printf(_L("%x: Ty %x Tm %x ThdA %x ThdB %x F %x U %x\n"),
543 i,outrec.iType,outrec.iTime, lastThread,nextThread, outrec.iFlags, outrec.iUserState);
545 test(outrec.iType==0);
548 if (outrec.iTime!=time)
550 if ((outrec.iTime<time) && (time!=0))
556 if ((outrec.iFlags & KEMI_PrevWaiting)!=0)
559 if (((outrec.iFlags & KEMI_EventLost)==0) && (prevNextThread!=-1))
560 test (prevNextThread==lastThread);
561 prevNextThread=nextThread;
562 ThreadList[nextThread].iRan++;
564 test(outrec.iUserState>=lastUserState);
565 if (outrec.iUserState!=lastUserState)
568 lastUserState=outrec.iUserState;
574 if ((i>100) && ShortLivedThreadDone)
575 test(Ldd.TaskEventLogging(EFalse,50,ENone)==KErrNone);
578 test.Printf(_L("DTime %x DState %x Wrap %x\n"),changecount,userStateChange, wrapcount);
580 test(changecount>=45);
581 test(userStateChange>15);
586 User::WaitForRequest(stat);
589 for (i=0; i<NoThreads;i++)
591 test.Printf(_L("Thread %x ran %d times.\n"),i,ThreadList[i].iRan);
592 test(ThreadList[i].iRan>10);
599 /* TagMaskTestThread() - used by TestTagMaskDFC */
600 LOCAL_C TInt TagMaskTestThread(TAny*)
610 ShortLivedThreadDone=ETrue;
617 Checks Mask and Tag setting.
618 Checks a that a DFC (found in driver) is triggered my an apropriate tag and mask.
621 void TestTagMaskDFC()
626 TUserTaskEventRecord outrec;
640 //! @SYMTestCaseID t_emi_9
642 //! @SYMTestCaseDesc Set/Get Mask
644 //! @SYMTestActions Get/Set the mask 100 times.
645 //! @SYMTestExpectedResults The Get function should confirm that the Set function changed the mask state.
646 //! @SYMTestPriority High
647 //! @SYMTestStatus Defined
650 test.Next(_L("(Set/Get)Mask"));
651 for (i=0; i<100; i++)
655 test(Ldd.GetMask()==no);
658 //! @SYMTestCaseID t_emi_10
660 //! @SYMTestCaseDesc Tag/Mask DFC
662 //! @SYMTestActions A DFC is set than will change the user state to the results of GetDFCTriggerTag. The event log is monitored, with a background thread, which has had a tag set. This thread repeatedly changes the mask.
663 //! @SYMTestExpectedResults The state should be seen to change once to the correct tag for the thread. Other factors also checked in t_emi_7 should show the test running correctly.
664 //! @SYMTestPriority High
665 //! @SYMTestStatus Defined
668 test.Next(_L("Tag/Mask DFC."));
670 NoThreads=0; // Reset Thread Tracking
672 myNThread=Ldd.GetSigmaThread();
673 test(myNThread!=NULL);
674 AddThread(myNThread);
676 myNThread=Ldd.GetIdleThread();
677 test(myNThread!=NULL);
678 AddThread(myNThread);
680 Ldd.SetThreadLoggable(myNThread,ETrue);
681 test(Ldd.GetThreadLoggable(myNThread)!=EFalse);
684 test(Ldd.GetMask()==0);
686 test.Printf(_L("Spawn Thread\n"));
687 ShortLivedThreadDone=EFalse;
688 test(thread.Create(_L("TagMaskTestThread"),TagMaskTestThread,KDefaultStackSize,KHeapSize,KHeapSize,NULL)==KErrNone);
690 test(stat==KRequestPending);
691 myNThread = Ldd.GetNThread(thread);
692 test(Ldd.GetThreadLoggable(myNThread)==EFalse);
693 Ldd.SetThreadLoggable(myNThread,ETrue);
694 test(Ldd.GetThreadLoggable(myNThread)!=EFalse);
695 AddThread(myNThread);
696 Ldd.SetThreadTag(myNThread,(1<<9)+(1<<18)+(1<<27));
697 test(Ldd.GetThreadTag(myNThread)==(1<<9)+(1<<18)+(1<<27));
701 test.Printf(_L("Start Event Logging\n"));
702 test(Ldd.TaskEventLogging(ETrue,50,ENone)==KErrNone);
708 if (!Ldd.GetTaskEvent(outrec))
710 if ((i>100) && ShortLivedThreadDone)
713 test((ii++)<500); //timeout!
719 lastThread=LookupThread(outrec.iPrevious);
721 LookupThread(outrec.iPrevious);
723 nextThread=LookupThread(outrec.iNext);
726 test.Printf(_L("%x: Ty %x Tm %x ThdA %x ThdB %x F %x U %x\n"),
727 i,outrec.iType,outrec.iTime, lastThread,nextThread, outrec.iFlags, outrec.iUserState);
730 ThreadList[nextThread].iRan++;
732 switch(outrec.iUserState)
735 case (1<<9) : ++seen9; break;
736 case (1<<18): ++seen18; break;
737 case (1<<27): ++seen27; break;
738 default: test(0); // bad state
742 if ((i>100) && ShortLivedThreadDone)
743 test(Ldd.TaskEventLogging(EFalse,50,ENone)==KErrNone);
751 User::WaitForRequest(stat);
754 for (i=0; i<NoThreads;i++)
756 test.Printf(_L("Thread %x ran %d times.\n"),i,ThreadList[i].iRan);
757 test(ThreadList[i].iRan>10);
759 test(Ldd.TaskEventLogging(EFalse,0,ENone)==KErrNone);
766 Repeatedly changes the start/exit monitors, while repeatedly starting and stopping threads.
767 As threads exit, they are checked for consistency.
771 TBool FinishedSoak=EFalse;
773 LOCAL_C TInt SoakTest_Thread(TAny*)
777 for (i=(Math::Random() & 1); i<2; i++)
778 User::AfterHighRes(1000+(Math::Random() & 31));
783 TInt ThreadGenCount=0;
785 TBool Forever=EFalse;
789 LOCAL_C TInt SoakTest_ThreadGenerator(TAny*)
791 const TInt NOTHREADS=100;
793 RThread threadlist[NOTHREADS];
794 TRequestStatus threadlist_stat[NOTHREADS];
799 RThread thisThread = RThread();
803 switch (Math::Random() & 63)
805 case 1: thisThread.SetPriority(EPriorityLess);
807 case 2: thisThread.SetPriority(EPriorityNormal);
809 case 3: thisThread.SetPriority(EPriorityMore);
814 if (newHead==NOTHREADS)
816 if ((newHead!=tail) && !done) //not full & not finished
818 test(threadlist[head].Create(_L(""),SoakTest_Thread,KDefaultStackSize,NULL,NULL)==KErrNone);
819 threadlist[head].Logon(threadlist_stat[head]);
820 switch (Math::Random() & 3)
822 case 1: threadlist[head].SetPriority(EPriorityLess);
824 case 2: threadlist[head].SetPriority(EPriorityNormal);
826 case 3: threadlist[head].SetPriority(EPriorityMore);
830 threadlist[head].Resume();
835 if (head==tail)//empty
844 User::WaitForRequest(threadlist_stat[tail] );
848 State=(TInt) Ldd.GetVEMSData(Ldd.GetNThread(threadlist[tail]));
854 threadlist[tail].Close();
860 if ((Math::Random() & 63)==1)
861 User::AfterHighRes((Math::Random() & 32));
862 ThreadGenCount=MainCount;
863 if ((ThreadGenCount>=Maxloops) && !Forever)
873 RThread threadGenerator;
877 RThread thisThread = RThread();
879 TMonitors monitor=EStressSecond;
881 test.Next(_L("Repeated monitor switching Test"));
882 test(Ldd.TaskEventLogging(EFalse,0,EStressSecond)==KErrNone);
884 for (count=1; count<100; count++)
888 test(threadGenerator.Create(_L(""),SoakTest_Thread,KDefaultStackSize,NULL,NULL)==KErrNone);
889 threadGenerator.Logon(stat);
890 test(stat==KRequestPending);
891 threadGenerator.Resume();
892 while (!Going) User::AfterHighRes(Math::Random() & 15);
894 monitor= (monitor==EStressFirst)?EStressSecond:EStressFirst;
895 test(Ldd.TaskEventLogging(EFalse,0,monitor)==KErrNone);
899 monitor= (monitor==EStressFirst)?EStressSecond:EStressFirst;
900 test(Ldd.TaskEventLogging(EFalse,0,monitor)==KErrNone);
902 User::WaitForRequest(stat);
903 ret=(TInt) Ldd.GetVEMSData(Ldd.GetNThread(threadGenerator));
905 test.Printf(_L("Thread %x had VEMs value was %x \n"),count,ret);
906 threadGenerator.Close();
914 test.Next(_L("Soak test"));
915 test(Ldd.TaskEventLogging(EFalse,0,EStressSecond)==KErrNone);
917 // Start threadGenerator
918 test(threadGenerator.Create(_L("threadGenerator"),SoakTest_ThreadGenerator,KDefaultStackSize,KHeapSize,KHeapSize,NULL)==KErrNone);
919 threadGenerator.Logon(stat);
920 test(stat==KRequestPending);
921 threadGenerator.Resume();
923 for (;!FinishedSoak; MainCount=ThreadGenCount+1)
925 switch (Math::Random() & 63)
927 case 1: thisThread.SetPriority(EPriorityLess);
929 case 2: thisThread.SetPriority(EPriorityNormal);
931 case 3: thisThread.SetPriority(EPriorityMore);
935 // Now repeatadly start and stop the start/exit monitors.
936 test(Ldd.TaskEventLogging(EFalse,0,EStressFirst)==KErrNone);
937 if ((Math::Random() & 63)==1)
938 User::AfterHighRes((Math::Random() & 31));
939 test(Ldd.TaskEventLogging(EFalse,0,EStressSecond)==KErrNone);
940 if (MainCount>>7 != oldcount)
942 oldcount=MainCount>>7;
944 test.Printf(_L("\nCount: "));
945 test.Printf(_L("%x "),count);
949 if ((Math::Random() & 63)==1)
950 User::AfterHighRes((Math::Random() & 31));
953 test.Printf(_L("\nDone.\n: "));
954 User::WaitForRequest(stat);
955 threadGenerator.Close();
958 test.Printf(_L("Thread %x VEMs value was %x \n"),GoodCount,State);
962 test(Ldd.TaskEventLogging(EFalse,0,ENone)==KErrNone);
965 void ParseCommandLine()
968 User::CommandLine(args);
970 if (args == KNullDesC)
972 test.Printf(_L("No soaklength specified, using default.\n"));
975 else if (args == _L("-"))
977 test.Printf(_L("Infinate soaklength specified.\n"));
984 TInt r = l.Val(Maxloops);
987 test.Printf(_L("Bad parameter!\nUsage: t_emi <soaklength>\n '-' indicates infinity.\n\n"));
988 User::After(4000000);
993 test.Printf(_L("Soaklength set to 0x%x\n"),Maxloops);
994 Maxloops = Maxloops << 7;
1001 E32Main - Where it all begins.
1004 GLDEF_C TInt E32Main()
1011 test.Start(_L("Loading Device"));
1013 r=User::LoadLogicalDevice(KEMITestLddFileName);
1014 test(r==KErrNone || r==KErrAlreadyExists);
1016 test.Next(_L("Open Logical Channel"));
1021 test.Next(_L("Calling LDD"));
1023 if(Ldd.TaskEventLogging(EFalse,0,ENone)==KErrNotSupported)
1025 test.Printf(_L("********************\n"));
1026 test.Printf(_L("* NO EMI SUPPORT *\n"));
1027 test.Printf(_L("********************\n"));
1028 test.Printf(_L("* Testing SKIPPED *\n"));
1029 test.Printf(_L("********************\n"));
1030 User::After(2000000); //Time to read it!
1031 test.Next(_L("Close Logical Channel"));
1040 TestStartStopMonitors();
1041 TestScheduleEventLogging();
1045 test.Next(_L("Close Logical Channel"));