sysstatemgmt/systemstatemgr/sus/src/ssmadaptationcli.cpp
branchRCL_3
changeset 3 a811597961f0
parent 0 4e1aa6a622a0
--- a/sysstatemgmt/systemstatemgr/sus/src/ssmadaptationcli.cpp	Tue Feb 02 00:53:00 2010 +0200
+++ b/sysstatemgmt/systemstatemgr/sus/src/ssmadaptationcli.cpp	Sat Feb 20 00:05:00 2010 +0200
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -33,8 +33,7 @@
  */
 EXPORT_C TInt RSsmAdaptationBase::Connect()
 	{
-	const TInt err = DoConnect(KAsyncMessageSlots);
-	return err;
+	return Connect(KAsyncMessageSlots);	 
 	}
 
 /**
@@ -52,15 +51,30 @@
  */
 EXPORT_C TInt RSsmAdaptationBase::Connect(TInt aAsyncMessageSlotCount)
 	{
-	const TInt err = DoConnect(aAsyncMessageSlotCount);
+	const TInt err = DoConnect(KSusAdaptionServerName, aAsyncMessageSlotCount);
 	return err;
-	}
+	} 
+
+/**
+ * This exists for testing purposes only
+ * @internalComponent
+ */
+#ifdef TEST_SSM_SERVER
 
-TInt RSsmAdaptationBase::DoConnect(TInt aAsyncMessageSlotCount)
+TInt RSsmAdaptationBase::Connect(const TDesC& aServerName)
+    {
+    return DoConnect(aServerName, KAsyncMessageSlots);
+    }
+#endif //TEST_SSM_SERVER
+
+/**
+ @internalComponent
+ */
+TInt RSsmAdaptationBase::DoConnect(const TDesC& aServerName, const TInt aAsyncMessageSlotCount)
 	{
 	if(!Handle())
 		{
-		return CreateSession(KSusAdaptionServerName, Version(), aAsyncMessageSlotCount);
+		return CreateSession(aServerName, Version(), aAsyncMessageSlotCount);
 		}
 	
 	return KErrAlreadyExists;