os/security/cryptomgmtlibs/securitycommonutils/test/inc_private/scstestcommon.inl
Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Defines inline functions which provide constant data to both the
16 * client and server implementations.
28 #ifndef SCSTESTCOMMON_INL
29 #define SCSTESTCOMMON_INL
33 #include "scstestcommon.h"
38 inline TVersion Version()
40 This function is defined because there is no literal constructor for TVersion.
42 @return Defines a version number which the client
43 can use to open the server. If the client
44 was built with a higher version number, then
45 it cannot open the server. This ensures that
46 a client only talks to a server whose version
47 is at least as high as its own.
50 TVersion v(KScsTestVerMajor, KScsTestVerMinor, KScsTestVerBuild);
54 inline TUidType ServerImageFullUid()
56 This function is defined because there is no literal constructor
57 for TUidType. It returns the server executable's UID, which is used
58 to ensure the client launches the correct server process, as opposed
59 to another application which uses the same executable name.
61 @return TUidType The server executable's full UID.
64 TUidType uidType(KExecutableImageUid, KNullUid, KScsTestServerUid);
70 inline T TAnyPtrToFuncPtr(TAny* aPtr)
72 ISO C++ doesn't allow converting directly between object and
73 function pointers, so this function goes via an integer.
75 @param aPtr Object pointer to convert to a (static) function pointer.
76 @return Function pointer, where the exact type of the function is
77 described by the T template parameter.
80 TUint32 funcAsInt = reinterpret_cast<TUint32>(aPtr);
81 return reinterpret_cast<T>(funcAsInt);
84 #endif // #ifndef SCSTESTCOMMON_INL