First public contribution.
1 // Copyright (c) 1997-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\system\t_mstim2.cpp
22 RTest test(_L("T_MSTIM2"));
25 TBool PauseOnError = 0;
26 #define GETCH() (PauseOnError&&test.Getch())
28 #define TEST(c) ((void)((c)||(test.Printf(_L("Failed at line %d\n"),__LINE__),GETCH(),test(0),0)))
29 #define CHECK(c) ((void)(((c)==0)||(test.Printf(_L("Error %d at line %d\n"),(c),__LINE__),GETCH(),test(0),0)))
31 const TPtrC KLddFileName=_L("D_MSTIM.LDD");
33 GLDEF_C TInt E32Main()
35 // Test millisecond timers
38 // test.SetLogged(EFalse);
41 test.Start(_L("Load test LDD"));
42 TInt r=User::LoadLogicalDevice(KLddFileName);
43 TEST(r==KErrNone || r==KErrAlreadyExists);
48 test.Next(_L("Repeated long period timer"));
54 CConsoleBase* console=test.Console();
56 mstim.StartOneShotInt(ts,0,30000);
59 User::WaitForRequest(cs,ts);
60 if (ts!=KRequestPending)
62 console->ReadCancel();
65 if (cs!=KRequestPending)
67 TKeyCode k=console->KeyCode();
75 r=mstim.GetInfo(0,info);
78 test.Printf(_L("30s timer took %dus\n"),info.iMin);