kerneltest/e32test/secure/t_shal.cpp
changeset 271 dc268b18d709
parent 121 661475905584
equal deleted inserted replaced
269:d57b86b1867a 271:dc268b18d709
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    28 // Failures and causes:
    28 // Failures and causes:
    29 // Base Port information:
    29 // Base Port information:
    30 // 
    30 // 
    31 //
    31 //
    32 
    32 
       
    33 #define __E32TEST_EXTENSION__
    33 #define __INCLUDE_CAPABILITY_NAMES__
    34 #define __INCLUDE_CAPABILITY_NAMES__
    34 
    35 
    35 #include <e32test.h>
    36 #include <e32test.h>
    36 #include <e32hal.h>
    37 #include <e32hal.h>
    37 #include <hal.h>
    38 #include <hal.h>
    80 	TInt r = HAL::Set(aAttribute,x);
    81 	TInt r = HAL::Set(aAttribute,x);
    81 	test(Check(r,aCap));
    82 	test(Check(r,aCap));
    82 	}
    83 	}
    83 
    84 
    84 #define SET_CHECK(a,c) 	GetSetCheck(#a,a,c);
    85 #define SET_CHECK(a,c) 	GetSetCheck(#a,a,c);
       
    86 
       
    87 LOCAL_C void TestUnusedFunctions()
       
    88     {
       
    89     TAny * mem = 0;
       
    90     TInt ret=0;
       
    91     ret=UserSvr::HalGet(HALData::EMemoryRAMFree, mem);
       
    92     test_Equal(KErrNotSupported, ret);
       
    93     ret=UserSvr::HalSet(HALData::EMemoryRAMFree, mem);
       
    94     test_Equal(KErrNotSupported, ret);
       
    95     ret=UserSvr::ResetMachine(EStartupCold);
       
    96     test_Equal(KErrNotSupported, ret);
       
    97     UserSvr::WsSwitchOnScreen();
       
    98     ret=User::Beep(220,1000000);
       
    99 	test_Equal(KErrNotSupported, ret);
       
   100     }
    85 
   101 
    86 LOCAL_C TInt DoTests()
   102 LOCAL_C TInt DoTests()
    87 	{
   103 	{
    88 	TInt r;
   104 	TInt r;
    89 //	TInt x = 0;
   105 //	TInt x = 0;
   192     {
   208     {
   193 	Capabilities = TSecurityInfo(RProcess()).iCaps;
   209 	Capabilities = TSecurityInfo(RProcess()).iCaps;
   194 
   210 
   195 	test.Title();
   211 	test.Title();
   196 
   212 
       
   213 	TestUnusedFunctions();
       
   214 	
   197 	if(User::CommandLineLength())
   215 	if(User::CommandLineLength())
   198 		{
   216 		{
   199 		TBuf<128> message;
   217 		TBuf<128> message;
   200 		__ASSERT_COMPILE(ECapability_Limit<64);
   218 		__ASSERT_COMPILE(ECapability_Limit<64);
   201 		message.AppendFormat(_L("Tests with capabilities %08x%08x"),((TUint32*)&Capabilities)[1],((TUint32*)&Capabilities)[0]);
   219 		message.AppendFormat(_L("Tests with capabilities %08x%08x"),((TUint32*)&Capabilities)[1],((TUint32*)&Capabilities)[0]);