telephonyprotocols/pdplayer/umts/test/te_spudNetworkSide/src/te_spudNetworkSideSteps.cpp
changeset 23 6b1d113cdff3
parent 20 244d7c5f118e
child 24 6638e7f4bd8f
child 42 3adadc800673
child 44 8b72faa1200f
--- a/telephonyprotocols/pdplayer/umts/test/te_spudNetworkSide/src/te_spudNetworkSideSteps.cpp	Fri Apr 16 16:12:37 2010 +0300
+++ b/telephonyprotocols/pdplayer/umts/test/te_spudNetworkSide/src/te_spudNetworkSideSteps.cpp	Mon May 03 13:37:20 2010 +0300
@@ -29,6 +29,8 @@
 #include <nifvar.h> // Nifman Progress notifications
 #include <in_sock.h>
 #include <es_enum.h> 
+#include <comms-infras/es_config.h>
+#include <nifman.h>
 
 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
 #include <networking/qoslib.h>
@@ -2246,4 +2248,73 @@
 	return EPass;
 	}
 
+enum TVerdict CIoctlAddressRetrieve::RunTestStepL()
+    {
+    StartPrimaryOnlyL();    
+    
+    TPtrC addresse;
+    TBool checkSipAddress = ETrue;
+    if(!GetStringFromConfig(ConfigSection(), _L("ExpectedAddress"), addresse))            
+        {
+        checkSipAddress = EFalse;
+        }
+    
+    TInt expectedError = KErrNone;
+    if(!GetIntFromConfig(ConfigSection(), _L("SipAddressExpectedError"), expectedError))            
+        {
+        expectedError = KErrNone;
+        }
+    
+    TInt sipAddressIndex = 0;
+    if(!GetIntFromConfig(ConfigSection(), _L("IndexOfTheSIPAddressToGet"), sipAddressIndex))            
+        {
+        User::Leave(KErrNotFound);
+        }
+    
+    //call ioctl
+    TRequestStatus status;
+    
+    INFO_PRINTF1(_L("Calling ioctl.."));
+    
+    // Request the Sip address available
+    TSipServerAddrBuf sipServerAddr;
+    sipServerAddr().index = sipAddressIndex;
+    iInterface.Ioctl(KCOLConfiguration, KConnGetSipServerAddr, status, &sipServerAddr);
+    User::WaitForRequest(status);
+    
+    INFO_PRINTF2(_L("SIP address retrieval completed with Err[%d]..."), status.Int());
+    if(status.Int() == expectedError)
+        {
+        if (expectedError == KErrNone && checkSipAddress)
+            {
+            THostName addr;
+            sipServerAddr().address.Output(addr);
+        
+            // Verify the retrieved address is correct
+            TPtrC addressToCompare;
+        
+            addressToCompare.Set(addresse);
+            
+            INFO_PRINTF2(_L("Received SIP address: %S"), &addr);
+            if(addr.CompareF(addressToCompare) != 0)
+                {
+                INFO_PRINTF2(_L("Expected SIP address %S!"), &addressToCompare);
+                TESTEL(0, KErrNotFound);
+                }
+            }
+        else
+            {
+            INFO_PRINTF1(_L("As Expected"));
+            }
+        }
+    else
+        {
+        INFO_PRINTF1(_L("Unexpected"));
+        User::Leave(status.Int());
+        }
+    
+    iInterface.Stop();
+    iInterface.Close(); 
 
+    return EPass;
+    }