First public contribution.
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\misc\t_asid.cpp
17 #define __E32TEST_EXTENSION__
22 RTest test(_L("T_ASID_DUMMY"));
24 class RAsidSession : RSessionBase
27 TInt CreateSession(const TDesC& aServerName, TInt aMsgSlots)
29 return RSessionBase::CreateSession(aServerName,User::Version(),aMsgSlots);
31 TInt PublicSendReceive(TInt aFunction, const TIpcArgs &aPtr)
33 return (SendReceive(aFunction, aPtr));
35 TInt PublicSend(TInt aFunction, const TIpcArgs &aPtr)
37 return (Send(aFunction, aPtr));
41 GLDEF_C TInt E32Main()
44 TUint len = User::CommandLineLength();
47 HBufC* buf = HBufC::New(len);
49 TPtr ptr = buf->Des();
50 User::CommandLine(ptr);
52 if (ptr == KAsidIpcServerName)
54 TUint8 array[KAsidDesLen];
55 memset(array, KAsidValue, KAsidDesLen);
56 TPtr8 buf(array, KAsidDesLen, KAsidDesLen);
59 test_KErrNone(session.CreateSession(KAsidIpcServerName, 1));
61 test_KErrNone(session.PublicSendReceive(EIpcData, TIpcArgs(&buf)));
62 test_KErrNone(session.PublicSend(EIpcData, TIpcArgs(&buf)));
63 // Just exit badly, i.e. without disconnecting...
65 else if (ptr == KAsidDesServerName)
67 TUint8 array[KAsidDesLen];
68 memset(array, KAsidValue, KAsidDesLen);
69 TPtr8 buf(array, KAsidDesLen, KAsidDesLen);
71 // Get the current thread pointer to pass to server.
74 test_KErrNone(asidLdd.Open());
75 test_KErrNone(asidLdd.GetCurrentThread(threadPtr));
78 test_KErrNone(session.CreateSession(KAsidDesServerName, 1));
80 test_KErrNone(session.PublicSendReceive(EDesData, TIpcArgs((TAny*)&buf, threadPtr)));
81 test_KErrNone(session.PublicSend(EDesData, TIpcArgs((TAny*)&buf, threadPtr)));
82 // Just exit badly, i.e. without disconnecting...