diff -r 000000000000 -r a41df078684a kerneltest/e32test/hcr/t_hcrut.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kerneltest/e32test/hcr/t_hcrut.cpp Mon Oct 19 15:55:17 2009 +0100 @@ -0,0 +1,97 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Hardware Configuration Respoitory Test Application +// + +#define __E32TEST_EXTENSION__ +#include +#include +#include +#include +#include +#include "d_hcrut.h" + +#define __TRACE_LINE__() test.Printf(_L("%d\n"),__LINE__) + +RTest test(_L("T_HCRUT")); + +_LIT(KTestDriver,"d_hcrut"); + +RHcrTest HcrTest; + +//--------------------------------------------- +//! @SYMTestCaseID +//! @SYMTestType +//! @SYMPREQ +//! @SYMTestCaseDesc +//! @SYMTestActions +//! +//! @SYMTestExpectedResults +//! +//! @SYMTestPriority +//! @SYMTestStatus +//--------------------------------------------- +TInt TestBasics () + { + test.Next(_L("Switch repository test")); +#ifdef __WINS__ + test.Printf(_L("Skipped on the emulator")); +#else + test_KErrNone( HcrTest.Test_SwitchRepository()); +#endif // __WINS__ + + // Wait for idle + async cleanup (waits for DKernelEventHandler to go away) + TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, (TAny*)5000, 0); + test_KErrNone(r); + + User::After(5000000); + + test.Next(_L("Free Physical Memory used for SDRs")); + test_KErrNone( HcrTest.Test_ReleaseSDRs()); + + return KErrNone; + } + + + + +GLDEF_C TInt E32Main() + { + TInt r; + + test.Title(); + test.Start(_L("=== HCR Test Suite")); + + + test.Next(_L("=== Open test LDD")); + r = User::LoadLogicalDevice(KTestDriver); + test_Assert((r==KErrNone || r==KErrAlreadyExists),void (0)); + + r = HcrTest.Open(); + test_KErrNone(r); + // Do test cases + // + TestBasics(); + + test.Next(_L("=== Close LDD")); + HcrTest.Close(); + + r = User::FreeLogicalDevice(RHcrTest::Name()); + test_KErrNone(r); + + test.End(); + + return(KErrNone); + } +