would prefer if cpgverify ran forever without -i option.

Regards
-steve

On 10/21/2010 03:48 PM, Angus Salkeld wrote:
> Signed-off-by: Angus Salkeld<asalk...@redhat.com>
> ---
>   test/cpgverify.c |   16 ++++++++++++++--
>   1 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/test/cpgverify.c b/test/cpgverify.c
> index c7b400a..ae5d450 100644
> --- a/test/cpgverify.c
> +++ b/test/cpgverify.c
> @@ -34,6 +34,7 @@
>
>   #include<config.h>
>
> +#include<unistd.h>
>   #include<stdio.h>
>   #include<stdlib.h>
>   #include<sys/socket.h>
> @@ -102,7 +103,7 @@ static struct cpg_name group_name = {
>
>
>   static unsigned char buffer[200000];
> -int main (void)
> +int main (int argc, char *argv[])
>   {
>       cpg_handle_t handle;
>       cs_error_t result;
> @@ -111,6 +112,17 @@ int main (void)
>       hash_state sha1_hash;
>       struct iovec iov[2];
>       int res;
> +     const char *options = "i:";
> +     int iter = 1000000000;
> +     int opt;
> +
> +     while ((opt = getopt(argc, argv, options)) != -1) {
> +             switch (opt) {
> +             case 'i':
> +                     iter = atoi(optarg);
> +                     break;
> +             }
> +     }
>
>       result = cpg_initialize (&handle,&callbacks);
>       if (result != CS_OK) {
> @@ -131,7 +143,7 @@ int main (void)
>       /*
>        * Demonstrate cpg_mcast_joined
>        */
> -     for (i = 0; i<  1000000000; i++) {
> +     for (i = 0; i<  iter; i++) {
>               msg.msg_size = 100 + rand() % 100000;
>               iov[1].iov_len = msg.msg_size;
>               for (j = 0; j<  msg.msg_size; j++) {

_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to