You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by su...@apache.org on 2004/01/12 17:06:40 UTC

cvs commit: ws-axis/c/src/client/samples/interoptests/base InteropBaseClient.cpp

susantha    2004/01/12 08:06:40

  Modified:    c/src/client/samples/interoptests/base InteropBaseClient.cpp
  Log:
  sample changed to loop
  
  Revision  Changes    Path
  1.7       +34 -24    ws-axis/c/src/client/samples/interoptests/base/InteropBaseClient.cpp
  
  Index: InteropBaseClient.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/client/samples/interoptests/base/InteropBaseClient.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- InteropBaseClient.cpp	12 Jan 2004 12:20:51 -0000	1.6
  +++ InteropBaseClient.cpp	12 Jan 2004 16:06:40 -0000	1.7
  @@ -1,38 +1,47 @@
  -// InteropBaseClient.cpp : Defines the entry point for the console application.
  -//
  -
   #include "InteropTestPortType.h" 
   
  -#define ARRAYSIZE 2
  +#define ARRAYSIZE 1000
  +#define LOOPFOR 100
   
   int main(int argc, char* argv[])
   {
   	int x;
   	char buffer1[100];
  -	char buffer2[100];
  -
  +	
   	InteropTestPortType ws;
  -	printf("invoking echoString...\n");
  +/*	printf("invoking echoString...\n");
   	//testing echoString 
   	if (0 == strcmp(ws.echoString("hello world"), "hello world"))
   		printf("successful\n");
   	else
   		printf("failed\n");
  -	// testing echoStringArray 
  +*/	// testing echoStringArray 
   	ArrayOfstring arrstr;
   	arrstr.m_Array = new char*[ARRAYSIZE];
   	arrstr.m_Size = ARRAYSIZE;
  -	sprintf(buffer1, "%dth element of string array", 0);
  -	sprintf(buffer2, "%dth element of string array", 1);
  -	arrstr.m_Array[0] = buffer1;
  -	arrstr.m_Array[1] = buffer2;
  +	for (x=0;x<ARRAYSIZE;x++)
  +	{
  +		sprintf(buffer1, "%dth element of string array", x);
  +		arrstr.m_Array[x] = strdup(buffer1);
  +	}
   	printf("invoking echoStringArray...\n");
  -	if (ws.echoStringArray(arrstr).m_Array != NULL)
  -		printf("successful\n");
  -	else
  -		printf("failed\n");
  +	for(int ix=0;ix<LOOPFOR; ix++)
  +	{
  +		ArrayOfstring retarrstr = ws.echoStringArray(arrstr);
  +		if ((retarrstr.m_Array != NULL) && (retarrstr.m_Size == ARRAYSIZE)) {
  +		/*	for (x=0;x<ARRAYSIZE;x++)
  +			{
  +				printf("%s\n", retarrstr.m_Array[x]);
  +			}
  +			printf("successful\n");
  +		*/
  +		}
  +		else
  +			printf("failed\n");
  +	}
  +	printf("Done\n");
   	// testing echoInteger 
  -	printf("invoking echoInteger...\n");
  +/*	printf("invoking echoInteger...\n");
   	if (ws.echoInteger(56) == 56)
   		printf("successful\n");
   	else
  @@ -73,7 +82,7 @@
   	SOAPStruct stct;
   	stct.varFloat = 12345.7346345;
   	stct.varInt = 5000;
  -	stct.varString = strdup("This is string in SOAPStruct");
  +	stct.varString = "This is string in SOAPStruct";
   	printf("invoking echoStruct...\n");
   	if (ws.echoStruct(&stct) != NULL)
   		printf("successful\n");
  @@ -88,7 +97,7 @@
   		arrstct.m_Array[x].varFloat = 1.1111*x;
   		arrstct.m_Array[x].varInt = x;
   		sprintf(buffer1, "varString of %dth element of SOAPStruct array", x);
  -		arrstct.m_Array[x].varString = buffer1;
  +		arrstct.m_Array[x].varString = strdup(buffer1);
   	}
   	//testing echo Struct Array
   	printf("invoking echoStructArray...\n");
  @@ -101,13 +110,13 @@
   	ws.echoVoid();
   	printf("successful\n");
   	//testing echo base 64 binary
  -/*	printf("invoking echoBase64...\n");
  +	printf("invoking echoBase64...\n");
   	if (0 == strcmp(ws.echoBase64("BCDF675E234242WHRTKMJDGKGUEJ898636JFJFHEJDGWTDHFJRURYGBCDHTWRSG"),
   		"BCDF675E234242WHRTKMJDGKGUEJ898636JFJFHEJDGWTDHFJRURYGBCDHTWRSG"))
   		printf("successful\n");
   	else
   		printf("failed\n");
  -*/	time_t tim;
  +	time_t tim;
   	time(&tim);
   	tm* lt = gmtime(&tim);
   	printf("invoking echoDate...\n");
  @@ -116,13 +125,13 @@
   	else
   		printf("failed\n");
   	//testing echo hex binary
  -/*	printf("invoking echoHexBinary...\n");
  +	printf("invoking echoHexBinary...\n");
   	if (0 == strcmp(ws.echoHexBinary("CCCFFA46552BC7D5A09BC5F23DE9E0FE7862AD45BC87D02FEE"),
   		"CCCFFA46552BC7D5A09BC5F23DE9E0FE7862AD45BC87D02FEE"))
   		printf("successful\n");
   	else
   		printf("failed\n");
  -*/	//testing echo decimal
  +	//testing echo decimal
   	printf("invoking echoDecimal...\n");
   	if (ws.echoDecimal(1234.567890) > 1234.56)
   		printf("successful\n");
  @@ -134,6 +143,7 @@
   		printf("successful\n");
   	else
   		printf("failed\n");
  -	getchar();
  +*/	getchar();
   	return 0;
   }
  +