sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\earlyextension\t_testextension.cpp sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include "d_testearlyextension.h" sl@0: sl@0: RLddEarlyExtensionTest lddChan; sl@0: GLDEF_D RTest test(_L("LDD tests")); sl@0: _LIT(KLddFileName, "D_TESTEARLYEXTENSION.LDD"); sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: test.Title(); sl@0: test.Start(_L("Testing early extension...\n")); sl@0: //Load logical device sl@0: TInt r = User::LoadLogicalDevice(KLddFileName); sl@0: test((r == KErrNone) || (r == KErrAlreadyExists)); sl@0: //Open the channel sl@0: r = lddChan.Open(); sl@0: test(r==KErrNone || r==KErrAlreadyExists); sl@0: Int64 earlyExtTime = 0, extTime = 0; sl@0: //Get system time stamps sl@0: r = lddChan.Test_getSystemTimeStamps(earlyExtTime, extTime); sl@0: test(r == KErrNone); sl@0: //Compare the time stamps for correctness. sl@0: //Time stamps got in early extension should be less than (valuewise) the one got in normal extension entry point. sl@0: if(earlyExtTime > extTime) sl@0: { sl@0: test.Printf(_L("Early Extension time stamp %ld is greater than extension time stamp %ld\n"), earlyExtTime, extTime); sl@0: test(0); sl@0: } sl@0: test.Printf(_L("Time stamps are as expected!!!\n")); sl@0: test.Printf(_L("Closing the channel\n")); sl@0: lddChan.Close(); sl@0: sl@0: test.Printf(_L("Freeing logical device\n")); sl@0: r = User::FreeLogicalDevice(KLddFileName); sl@0: test(r==KErrNone); sl@0: User::After(100000); sl@0: test.End(); sl@0: test.Close(); sl@0: return r; sl@0: }