axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dushshan...@apache.org
Subject svn commit: r629072 - in /webservices/axis2/trunk/c/util/test/rand: build.sh rand_test.c
Date Tue, 19 Feb 2008 11:28:43 GMT
Author: dushshantha
Date: Tue Feb 19 03:28:40 2008
New Revision: 629072

URL: http://svn.apache.org/viewvc?rev=629072&view=rev
Log:
applied the patch for AXIS2C-993

Modified:
    webservices/axis2/trunk/c/util/test/rand/build.sh
    webservices/axis2/trunk/c/util/test/rand/rand_test.c

Modified: webservices/axis2/trunk/c/util/test/rand/build.sh
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/rand/build.sh?rev=629072&r1=629071&r2=629072&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/test/rand/build.sh (original)
+++ webservices/axis2/trunk/c/util/test/rand/build.sh Tue Feb 19 03:28:40 2008
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-gcc rand_test.c ../util/create_env.c -g -I$AXIS2C_HOME/include/axis2-1.2 -L$AXIS2C_HOME/lib
-laxutil -laxis2_axiom -laxis2_parser -o rand_test 
+gcc rand_test.c ../util/create_env.c -g -Werror -I$AXIS2C_HOME/include/axis2-1.3.0 -L$AXIS2C_HOME/lib
-laxutil -laxis2_axiom -laxis2_parser -o rand_test 

Modified: webservices/axis2/trunk/c/util/test/rand/rand_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/rand/rand_test.c?rev=629072&r1=629071&r2=629072&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/test/rand/rand_test.c (original)
+++ webservices/axis2/trunk/c/util/test/rand/rand_test.c Tue Feb 19 03:28:40 2008
@@ -1,30 +1,47 @@
 #include "../util/create_env.h"
 
-int rand_number,rand_value,sleep_time,start = 2,end = 8,rand_range;
-unsigned seed = 10;
-unsigned int *seedp = &seed;
-
 /** @brief test_rand 
  *   create random variable and get it's value 
  */
 
 axis2_status_t test_rand(axutil_env_t *env)
-{
-    rand_number = axutil_rand(seedp);
-    rand_range = axutil_rand_with_range(seedp,start,end);
+{    
+    int rand_number,rand_value,sleep_time,start = 2,end = 8,rand_range;
+    unsigned seed = 10;
+    
+    rand_number = axutil_rand(&seed);
+    if(!rand_number)
+    {
+        printf("Test axutil_rand failed\n");         
+    }
+    else
+    {
+        printf("Test axutil_rand is successfull\n");
+        printf("The random value is %d\n",rand_number);
+    }
+    
+    rand_range = axutil_rand_with_range(&seed,start,end);
+    if(!rand_range)
+    {
+        printf("Test axutil_rand_with_range failed\n");
+    }
+    else
+    {
+        printf("Test axutil_rand_with_range is successfull\n");
+        printf("The random seed value is %d\n",rand_range);
+    }
+    
     rand_value = axutil_rand_get_seed_value_based_on_time(env);
-    printf("The random value is %d\n",rand_number);
-    printf("The random seed value is %d\n",rand_value);
-    printf("The random range is %d\n",rand_range);
-    if(rand_number && rand_range && rand_value)
+    if(!rand_value)
     {
-    printf("The test is SUCCESS\n");
+        printf("The test axutil_rand_get_seed_value_based_on_time failed\n");
     }
-    if(rand_number || rand_range || rand_value)
+    else
     {
-    printf("The test is FAIL");
+        printf("Test axutil_rand_get_seed_value_based_on_time is successfull\n");
+        printf("The random range is %d\n",rand_value);
     }
-  
+ 
     return AXIS2_SUCCESS;
 }
 
@@ -32,13 +49,16 @@
 {
     int status = AXIS2_SUCCESS;
     axutil_env_t *env = NULL;
+
     env = create_environment();
     status = test_rand(env);
+
     if(status == AXIS2_FAILURE)
     {
-        printf(" test  failed");
+        printf("Test  failed\n");
     }
     axutil_env_free(env);
     return 0;
 }
+
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message