You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2006/02/10 01:10:01 UTC
svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Author: wrowe
Date: Thu Feb 9 16:09:59 2006
New Revision: 376501
URL: http://svn.apache.org/viewcvs?rev=376501&view=rev
Log:
This test can't be portably implemented until we define a symbol
to declare that apr_[ug]id_t is intregal, as opposed to the current
opaque definition on Win32.
Backports 376409
Modified:
apr/apr/branches/1.2.x/test/testuser.c
Modified: apr/apr/branches/1.2.x/test/testuser.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/test/testuser.c?rev=376501&r1=376500&r2=376501&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/testuser.c (original)
+++ apr/apr/branches/1.2.x/test/testuser.c Thu Feb 9 16:09:59 2006
@@ -94,6 +94,8 @@
apr_gid_compare(gid, retreived_gid));
}
+#ifdef APR_UID_GID_NUMERIC
+
static void fail_userinfo(abts_case *tc, void *data)
{
apr_uid_t uid;
@@ -138,6 +140,8 @@
rv != APR_SUCCESS || tmp != NULL);
}
+#endif
+
#else
static void users_not_impl(abts_case *tc, void *data)
{
@@ -155,7 +159,9 @@
abts_run_test(suite, uid_current, NULL);
abts_run_test(suite, username, NULL);
abts_run_test(suite, groupname, NULL);
+#ifdef APR_UID_GID_NUMERIC
abts_run_test(suite, fail_userinfo, NULL);
+#endif
#endif
return suite;
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Joe Orton wrote:
>
> I don't see anything wrong at all with exploiting platform-specific
> knowledge in the test suite to improve test coverage. Something like
> "is apr_uid_t an integer" is and should remain undefined in the API,
> adding some new #define to make that defined simply to avoid an #ifndef
> in the test suite is backwards.
The questions are;
* do our users trust apr/test/ to provide simple examples? Probably yes.
(If not did we spell this out? Answer; probably not.)
* do our users need the knowledge? In -this- case, probably yes, if you
want an example look at httpd.
* should we have architecture based tests? I agree that would potentially
be good, but then do we want a tree such as test/private/unix/*.c containing
such specific tests, to reflect that they aren't public examples?
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by Joe Orton <jo...@redhat.com>.
On Fri, Feb 10, 2006 at 02:00:37PM -0600, William Rowe wrote:
> Joe,
>
> I will mask this test ndef WIN32 for versions prior to 1.3.0, I agree
> we won't be changing semantics and surrender to the fact that we failed
> to make a portable library.
>
> I am removing ALL per-platform tests on 1.3.0 forward that introspect
> non-apr flags to determine OS behavior. Those tests *PROVE* non-portability
> and therefore indicate errors in our API which must be addressed.
I don't see anything wrong at all with exploiting platform-specific
knowledge in the test suite to improve test coverage. Something like
"is apr_uid_t an integer" is and should remain undefined in the API,
adding some new #define to make that defined simply to avoid an #ifndef
in the test suite is backwards.
joe
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Joe,
I will mask this test ndef WIN32 for versions prior to 1.3.0, I agree
we won't be changing semantics and surrender to the fact that we failed
to make a portable library.
I am removing ALL per-platform tests on 1.3.0 forward that introspect
non-apr flags to determine OS behavior. Those tests *PROVE* non-portability
and therefore indicate errors in our API which must be addressed.
In a portability library, every condition that indicates a feature is not
supported needs to be reflected in a constant, or in an ENOTIMPL result from
invoking the unsupported function or feature.
If our test framework *works*, it is using strictly the apr behavior to
prove or disprove the validitity of the apr's API and feature set. Anything
else illustrates bad examples to our user/developers who then follow our lead.
Does this strike you as reasonable, moving -forwards-, and ignoring the
issue in 1.2.x and prior?
Bill
Joe Orton wrote:
> On Fri, Feb 10, 2006 at 12:10:01AM -0000, William Rowe wrote:
>
>>Author: wrowe
>>Date: Thu Feb 9 16:09:59 2006
>>New Revision: 376501
>>
>>URL: http://svn.apache.org/viewcvs?rev=376501&view=rev
>>Log:
>>
>> This test can't be portably implemented until we define a symbol
>> to declare that apr_[ug]id_t is intregal, as opposed to the current
>> opaque definition on Win32.
>>
>>Backports 376409
>
>
> -1, please do not arbitrarily disable tests on all platforms just
> because one platform is "special". Use #ifndef WIN32, as I said *twice*
> already.
>
>
>>--- apr/apr/branches/1.2.x/test/testuser.c (original)
>>+++ apr/apr/branches/1.2.x/test/testuser.c Thu Feb 9 16:09:59 2006
>>@@ -94,6 +94,8 @@
>> apr_gid_compare(gid, retreived_gid));
>> }
>>
>>+#ifdef APR_UID_GID_NUMERIC
>>+
>> static void fail_userinfo(abts_case *tc, void *data)
>
>
>
> .
>
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
>>Author: wrowe
>>Date: Thu Feb 9 16:09:59 2006
>>New Revision: 376501
>>
>>URL: http://svn.apache.org/viewcvs?rev=376501&view=rev
>>Log:
>>
>> This test can't be portably implemented until we define a symbol
>> to declare that apr_[ug]id_t is intregal, as opposed to the current
>> opaque definition on Win32.
>>
>>+#ifdef APR_UID_GID_NUMERIC
>>+
For *trunk/* I'm open to a better name to indicate that apr_uid_t/apr_gid_t
is an intregal identifier :) Suggestions?
Bill
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
>>Author: wrowe
>>Date: Thu Feb 9 16:09:59 2006
>>New Revision: 376501
>>
>>URL: http://svn.apache.org/viewcvs?rev=376501&view=rev
>>Log:
>>
>> This test can't be portably implemented until we define a symbol
>> to declare that apr_[ug]id_t is intregal, as opposed to the current
>> opaque definition on Win32.
>>
>>+#ifdef APR_UID_GID_NUMERIC
>>+
For *trunk/* I'm open to a better name to indicate that apr_uid_t/apr_gid_t
is an intregal identifier :) Suggestions?
Bill
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Joe,
I will mask this test ndef WIN32 for versions prior to 1.3.0, I agree
we won't be changing semantics and surrender to the fact that we failed
to make a portable library.
I am removing ALL per-platform tests on 1.3.0 forward that introspect
non-apr flags to determine OS behavior. Those tests *PROVE* non-portability
and therefore indicate errors in our API which must be addressed.
In a portability library, every condition that indicates a feature is not
supported needs to be reflected in a constant, or in an ENOTIMPL result from
invoking the unsupported function or feature.
If our test framework *works*, it is using strictly the apr behavior to
prove or disprove the validitity of the apr's API and feature set. Anything
else illustrates bad examples to our user/developers who then follow our lead.
Does this strike you as reasonable, moving -forwards-, and ignoring the
issue in 1.2.x and prior?
Bill
Joe Orton wrote:
> On Fri, Feb 10, 2006 at 12:10:01AM -0000, William Rowe wrote:
>
>>Author: wrowe
>>Date: Thu Feb 9 16:09:59 2006
>>New Revision: 376501
>>
>>URL: http://svn.apache.org/viewcvs?rev=376501&view=rev
>>Log:
>>
>> This test can't be portably implemented until we define a symbol
>> to declare that apr_[ug]id_t is intregal, as opposed to the current
>> opaque definition on Win32.
>>
>>Backports 376409
>
>
> -1, please do not arbitrarily disable tests on all platforms just
> because one platform is "special". Use #ifndef WIN32, as I said *twice*
> already.
>
>
>>--- apr/apr/branches/1.2.x/test/testuser.c (original)
>>+++ apr/apr/branches/1.2.x/test/testuser.c Thu Feb 9 16:09:59 2006
>>@@ -94,6 +94,8 @@
>> apr_gid_compare(gid, retreived_gid));
>> }
>>
>>+#ifdef APR_UID_GID_NUMERIC
>>+
>> static void fail_userinfo(abts_case *tc, void *data)
>
>
>
> .
>
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by Joe Orton <jo...@redhat.com>.
On Fri, Feb 10, 2006 at 12:10:01AM -0000, William Rowe wrote:
> Author: wrowe
> Date: Thu Feb 9 16:09:59 2006
> New Revision: 376501
>
> URL: http://svn.apache.org/viewcvs?rev=376501&view=rev
> Log:
>
> This test can't be portably implemented until we define a symbol
> to declare that apr_[ug]id_t is intregal, as opposed to the current
> opaque definition on Win32.
>
> Backports 376409
-1, please do not arbitrarily disable tests on all platforms just
because one platform is "special". Use #ifndef WIN32, as I said *twice*
already.
> --- apr/apr/branches/1.2.x/test/testuser.c (original)
> +++ apr/apr/branches/1.2.x/test/testuser.c Thu Feb 9 16:09:59 2006
> @@ -94,6 +94,8 @@
> apr_gid_compare(gid, retreived_gid));
> }
>
> +#ifdef APR_UID_GID_NUMERIC
> +
> static void fail_userinfo(abts_case *tc, void *data)
Re: svn commit: r376501 - /apr/apr/branches/1.2.x/test/testuser.c
Posted by Joe Orton <jo...@redhat.com>.
On Fri, Feb 10, 2006 at 12:10:01AM -0000, William Rowe wrote:
> Author: wrowe
> Date: Thu Feb 9 16:09:59 2006
> New Revision: 376501
>
> URL: http://svn.apache.org/viewcvs?rev=376501&view=rev
> Log:
>
> This test can't be portably implemented until we define a symbol
> to declare that apr_[ug]id_t is intregal, as opposed to the current
> opaque definition on Win32.
>
> Backports 376409
-1, please do not arbitrarily disable tests on all platforms just
because one platform is "special". Use #ifndef WIN32, as I said *twice*
already.
> --- apr/apr/branches/1.2.x/test/testuser.c (original)
> +++ apr/apr/branches/1.2.x/test/testuser.c Thu Feb 9 16:09:59 2006
> @@ -94,6 +94,8 @@
> apr_gid_compare(gid, retreived_gid));
> }
>
> +#ifdef APR_UID_GID_NUMERIC
> +
> static void fail_userinfo(abts_case *tc, void *data)