You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Randy Kobes <ra...@theoryx5.uwinnipeg.ca> on 2004/07/02 03:31:51 UTC

[apreq-2] make test fails

With the current cvs, on Win32 I get a failure in the
top-level 'make test' (not the perl glue):

=======================================================

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

	NMAKE /nologo /f
D:\unzipped\HTTPD-~2\win32\libapreq2.mak CFG="libapreq2 -
Win32 Release" APACHE="D:/Apache2"
APREQ_HOME="D:\unzipped\HTTPD-~2"
APR_LIB="D:\Apache2\lib\libapr.lib"
APU_LIB="D:\Apache2\lib\libaprutil.lib"

	NMAKE /nologo /f
D:\unzipped\HTTPD-~2\win32\mod_apreq.mak CFG="mod_apreq -
Win32 Release" APACHE="D:/Apache2"
APREQ_HOME="D:\unzipped\HTTPD-~2"
APR_LIB="D:\Apache2\lib\libapr.lib"
APU_LIB="D:\Apache2\lib\libaprutil.lib"

	link.exe @C:\DOCUME~1\RANDYK~1\LOCALS~1\Temp\nma03424.
   Creating library
D:\unzipped\HTTPD-~2\win32\libs\mod_apreq.lib and object
D:\unzipped\HTTPD-~2\win32\libs\mod_apreq.exp

	NMAKE /nologo /f
D:\unzipped\HTTPD-~2\win32\testall.mak CFG="testall - Win32
Release" APACHE="D:/Apache2"
APREQ_HOME="D:\unzipped\HTTPD-~2"
APR_LIB="D:\Apache2\lib\libapr.lib"
APU_LIB="D:\Apache2\lib\libaprutil.lib"

	set PATH=%PATH%;D:/Apache2\bin;D:\unzipped\HTTPD-~2\win32\libs

	cd D:\unzipped\HTTPD-~2\win32\libs && testall.exe -v
All APREQ Tests:
    Cookie:                   ....
    Param:                    ..F.
    Parsers:                  ...

11 tests run:  10 passed, 1 failed, 0 not implemented.

Failed tests in Param:
1) params_as: expected
---->
1, 2
<----
but saw
---->
1, 2, 1, 2, 1, 2
<----

================================================================
I can't quite follow though where the parameter string
gets duplicated like this - does this ring a bell with
anyone?

-- 
best regards,
randy

Re: [apreq-2] make test fails

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 2 Jul 2004, Joe Schaefer wrote:

[ ... ]
> Sorry, sleepy.  Ignore the previous and try this
>
> Index: src/apreq_params.c
> ===================================================================
> RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.c,v
> retrieving revision 1.42
> diff -u -r1.42 apreq_params.c
> --- src/apreq_params.c  29 Jun 2004 18:34:48 -0000      1.42
> +++ src/apreq_params.c  2 Jul 2004 05:58:16 -0000
> @@ -148,13 +148,13 @@
>      apr_array_header_t *arr = apr_array_make(p, apr_table_elts(req->args)->nelts,
>                                               sizeof(apreq_param_t *));
>
> -    apr_table_do(param_push, arr, req->args, key);
> +    apr_table_do(param_push, arr, req->args, key, NULL);
>
>      do s = apreq_env_read(req->env, APR_BLOCK_READ, APREQ_READ_AHEAD);
>      while (s == APR_INCOMPLETE);
>
>      if (req->body)
> -        apr_table_do(param_push, arr, req->body, key);
> +        apr_table_do(param_push, arr, req->body, key, NULL);
>
>      return arr;
>  }
>
>
> va_arg is looks borked because our table_do list isn't
> NULL-terminated in this situation.  We probably need
> to fix that throughout.

Yes, that works - thanks! And the env/ tests all pass
as well for me.

-- 
best regards,
randy

Re: [apreq-2] make test fails

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Schaefer <jo...@sunstarsys.com> writes:

> Joe Schaefer <jo...@sunstarsys.com> writes:
> 
> [...]
> 
> > Looks like 6 params to me, but ...
> 
> [...]
> 
> > this says there were actually 4?  *Boggle*
> 
> Randy, see if this patch helps at all

[...oops, wrong do()...]

Sorry, sleepy.  Ignore the previous and try this

Index: src/apreq_params.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.c,v
retrieving revision 1.42
diff -u -r1.42 apreq_params.c
--- src/apreq_params.c  29 Jun 2004 18:34:48 -0000      1.42
+++ src/apreq_params.c  2 Jul 2004 05:58:16 -0000
@@ -148,13 +148,13 @@
     apr_array_header_t *arr = apr_array_make(p, apr_table_elts(req->args)->nelts,
                                              sizeof(apreq_param_t *));

-    apr_table_do(param_push, arr, req->args, key);
+    apr_table_do(param_push, arr, req->args, key, NULL);

     do s = apreq_env_read(req->env, APR_BLOCK_READ, APREQ_READ_AHEAD);
     while (s == APR_INCOMPLETE);

     if (req->body)
-        apr_table_do(param_push, arr, req->body, key);
+        apr_table_do(param_push, arr, req->body, key, NULL);

     return arr;
 }


va_arg is looks borked because our table_do list isn't
NULL-terminated in this situation.  We probably need
to fix that throughout.

-- 
Joe Schaefer


Re: [apreq-2] make test fails

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Schaefer <jo...@sunstarsys.com> writes:

[...]

> Looks like 6 params to me, but ...

[...]

> this says there were actually 4?  *Boggle*

Randy, see if this patch helps at all

Index: src/apreq_params.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/apreq_params.c,v
retrieving revision 1.42
diff -u -r1.42 apreq_params.c
--- src/apreq_params.c  29 Jun 2004 18:34:48 -0000      1.42
+++ src/apreq_params.c  2 Jul 2004 05:55:03 -0000
@@ -154,7 +154,7 @@
     while (s == APR_INCOMPLETE);

     if (req->body)
-        apr_table_do(param_push, arr, req->body, key);
+        apr_table_do(param_push, arr, req->body, key, NULL);

     return arr;
 }

-- 
Joe Schaefer


Re: [apreq-2] make test fails

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:


[...]

> > > Failed tests in Param:
> > > 1) params_as: expected
> > > ---->
> > > 1, 2
> > > <----
> > > but saw
> > > ---->
> > > 1, 2, 1, 2, 1, 2
> > > <----

Looks like 6 params to me, but ...

[...]

> > +    apr_array_header_t *arr;
> > +    arr = apreq_params_as_array(p,r,"a");
> > +    CuAssertIntEquals(tc,2,arr->nelts);

[...]

> > What do you see now?

[...]

> Failed tests in Param:
> 1) params_as: expected <2> but was <4>
> 

this says there were actually 4?  *Boggle*

[...]

> I take it it's not a problem on linux?

Not for me:

All APREQ Tests:
    Version:                  .....
    Cookie:                   ....
    Param:                    ....
    Parsers:                  ...

16 tests run:  16 passed, 0 failed, 0 not implemented.

-- 
Joe Schaefer


Re: [apreq-2] make test fails

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Thu, 1 Jul 2004, Joe Schaefer wrote:

> Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:
>
> > With the current cvs, on Win32 I get a failure in the
> > top-level 'make test' (not the perl glue):
>
> [...]
>
> > Failed tests in Param:
> > 1) params_as: expected
> > ---->
> > 1, 2
> > <----
> > but saw
> > ---->
> > 1, 2, 1, 2, 1, 2
> > <----
>
> Just committed this patch:
>
> Index: t/params.c
> ===================================================================
> RCS file: /home/cvs/httpd-apreq-2/t/params.c,v
> retrieving revision 1.12
> diff -u -r1.12 params.c
> --- t/params.c  28 Jun 2004 04:50:14 -0000      1.12
> +++ t/params.c  2 Jul 2004 01:44:14 -0000
> @@ -56,6 +56,9 @@
>  static void params_as(CuTest *tc)
>  {
>      const char *val;
> +    apr_array_header_t *arr;
> +    arr = apreq_params_as_array(p,r,"a");
> +    CuAssertIntEquals(tc,2,arr->nelts);
>      val = apreq_params_as_string(p,r,"a",APREQ_JOIN_AS_IS);
>      CuAssertStrEquals(tc,"1, 2", val);
>  }
>
> What do you see now?

Still a failure :(
======================================================
	cd D:\unzipped\HTTPD-~2\win32\libs && testall.exe -v
All APREQ Tests:
    Version:                  .....
    Cookie:                   ....
    Param:                    ..F.
    Parsers:                  ...

16 tests run:  15 passed, 1 failed, 0 not implemented.

Failed tests in Param:
1) params_as: expected <2> but was <4>

===========================================================

I take it it's not a problem on linux?

-- 
best regards,
randy

Re: [apreq-2] make test fails

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Randy Kobes <ra...@theoryx5.uwinnipeg.ca> writes:

> With the current cvs, on Win32 I get a failure in the
> top-level 'make test' (not the perl glue):

[...]

> Failed tests in Param:
> 1) params_as: expected
> ---->
> 1, 2
> <----
> but saw
> ---->
> 1, 2, 1, 2, 1, 2
> <----

Just committed this patch:

Index: t/params.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/params.c,v
retrieving revision 1.12
diff -u -r1.12 params.c
--- t/params.c  28 Jun 2004 04:50:14 -0000      1.12
+++ t/params.c  2 Jul 2004 01:44:14 -0000
@@ -56,6 +56,9 @@
 static void params_as(CuTest *tc)
 {
     const char *val;
+    apr_array_header_t *arr;
+    arr = apreq_params_as_array(p,r,"a");
+    CuAssertIntEquals(tc,2,arr->nelts);
     val = apreq_params_as_string(p,r,"a",APREQ_JOIN_AS_IS);
     CuAssertStrEquals(tc,"1, 2", val);
 }

What do you see now?

-- 
Joe Schaefer