datacommsserver/esockserver/test/TE_Socket/SocketTestSection1.cpp
branchRCL_3
changeset 25 9d7ce34704c8
parent 12 8b5d60ce1e94
child 26 b564fb5fd78b
--- a/datacommsserver/esockserver/test/TE_Socket/SocketTestSection1.cpp	Thu Aug 19 11:05:47 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_Socket/SocketTestSection1.cpp	Tue Aug 31 16:25:36 2010 +0300
@@ -384,15 +384,21 @@
 		{
 		sockNum--;
 		}
-	Logger().WriteFormat(_L("Created %d sockets, expected at least %d sockets"), sockNum, sockCount1);
-	TESTL(sockNum >= sockCount1);
+	Logger().WriteFormat(_L("Created %d sockets"), sockNum);
+	
+	// Not sure what use it is to test whether we can open at least as many sockets as previously.
+	// We can't assume that once we've freed all the sockets first time around that the ESock heap will
+	// go back exactly to where it was before - this makes assumptions about the ESock algorithms.  Why
+	// wouldn't ESock legitimately cache objects, for example?
+	//TESTL(sockNum >= sockCount1);
 
-	Logger().WriteFormat(_L("Freeing sockets in creation order"));
-	for (i=0; i<sockNum; i++)
-		{
-		socks[i].Close();
-		}
-
+	//
+	// NOTE:
+	// We do *not* free up the sockets but just close the session.  This is to exercise the subsession
+	// cleanup behaviour in ESock with a large number of sockets.  We test that this cleanup operation
+	// does not overflow the transport queue, as each subsession cleanup results in a message being sent.
+	//
+	
 #endif	// (_DEBUG) }
 
 	CleanupStack::PopAndDestroy(socks);