os/kernelhwsrv/kerneltest/e32test/mmu/t_asid_dummy.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/mmu/t_asid_dummy.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,88 @@
     1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\misc\t_asid.cpp
    1.18 +// 
    1.19 +//
    1.20 +#define __E32TEST_EXTENSION__
    1.21 +#include <e32test.h>
    1.22 +#include "t_asid.h"
    1.23 +#include "d_asid.h"
    1.24 +
    1.25 +RTest test(_L("T_ASID_DUMMY"));
    1.26 +
    1.27 +class RAsidSession : RSessionBase
    1.28 +	{
    1.29 +public:
    1.30 +	TInt CreateSession(const TDesC& aServerName, TInt aMsgSlots) 
    1.31 +		{ 
    1.32 +		return RSessionBase::CreateSession(aServerName,User::Version(),aMsgSlots);
    1.33 +		}
    1.34 +	TInt PublicSendReceive(TInt aFunction, const TIpcArgs &aPtr)
    1.35 +		{
    1.36 +		return (SendReceive(aFunction, aPtr));
    1.37 +		}
    1.38 +	TInt PublicSend(TInt aFunction, const TIpcArgs &aPtr)
    1.39 +		{
    1.40 +		return (Send(aFunction, aPtr));
    1.41 +		}
    1.42 +	};
    1.43 +
    1.44 +GLDEF_C TInt E32Main()
    1.45 +	{
    1.46 +
    1.47 +	TUint len = User::CommandLineLength();
    1.48 +	if (len > 0)
    1.49 +		{
    1.50 +		HBufC* buf = HBufC::New(len);
    1.51 +		test(buf != NULL);
    1.52 +		TPtr ptr = buf->Des();
    1.53 +		User::CommandLine(ptr);
    1.54 +
    1.55 +		if (ptr == KAsidIpcServerName)
    1.56 +			{
    1.57 +			TUint8 array[KAsidDesLen];
    1.58 +			memset(array, KAsidValue, KAsidDesLen);
    1.59 +			TPtr8 buf(array, KAsidDesLen, KAsidDesLen);
    1.60 +
    1.61 +			RAsidSession session;
    1.62 +			test_KErrNone(session.CreateSession(KAsidIpcServerName, 1));
    1.63 +
    1.64 +			test_KErrNone(session.PublicSendReceive(EIpcData, TIpcArgs(&buf)));
    1.65 +			test_KErrNone(session.PublicSend(EIpcData, TIpcArgs(&buf)));
    1.66 +			// Just exit badly, i.e. without disconnecting...
    1.67 +			}
    1.68 +		else if (ptr == KAsidDesServerName)
    1.69 +			{
    1.70 +			TUint8 array[KAsidDesLen];
    1.71 +			memset(array, KAsidValue, KAsidDesLen);
    1.72 +			TPtr8 buf(array, KAsidDesLen, KAsidDesLen);
    1.73 +
    1.74 +			// Get the current thread pointer to pass to server.		
    1.75 +			TAny* threadPtr;
    1.76 +			RAsidLdd asidLdd;
    1.77 +			test_KErrNone(asidLdd.Open());
    1.78 +			test_KErrNone(asidLdd.GetCurrentThread(threadPtr));
    1.79 +
    1.80 +			RAsidSession session;
    1.81 +			test_KErrNone(session.CreateSession(KAsidDesServerName, 1));
    1.82 +
    1.83 +			test_KErrNone(session.PublicSendReceive(EDesData, TIpcArgs((TAny*)&buf, threadPtr)));
    1.84 +			test_KErrNone(session.PublicSend(EDesData, TIpcArgs((TAny*)&buf, threadPtr)));
    1.85 +			// Just exit badly, i.e. without disconnecting...
    1.86 +			}
    1.87 +			
    1.88 +		}
    1.89 +
    1.90 +	return KErrNone;
    1.91 +	}