kerneltest/e32test/hcr/t_hcrut.cpp
author John Imhofe
Mon, 19 Oct 2009 15:55:17 +0100
changeset 0 a41df078684a
child 4 56f325a607ea
permissions -rw-r--r--
Convert Kernelhwsrv package from SFL to EPL kernel\eka\compsupp is subject to the ARM EABI LICENSE userlibandfileserver\fatfilenameconversionplugins\unicodeTables is subject to the Unicode license kernel\eka\kernel\zlib is subject to the zlib license

// 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 <e32test.h>
#include <e32svr.h>
#include <u32hal.h>
#include <hal.h>
#include <hal_data.h>
#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);
    }