[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r38094 - trunk/subversion/tests

From: David Glasser <glasser_at_davidglasser.net>
Date: Thu, 25 Jun 2009 13:52:59 -0700

So do you care about backwards compatibility of these symbols or not?

If you don't care, adding a "2" to everything is confusing and unnecessary.

If you do care, then this change technically does break compatibility
in a perhaps-1.x-inappropriate way. (It is certainly the case that
there exist codebases which are forks of Subversion which use the svn
test driver to run their own tests in addition to Subversion's C
tests, all of which will be broken by this revision.)

I won't go so far as to actually object to this change, but well, if
you're going to be a pain to codebases outside of Subversion trunk
anyway, you might as well just reuse the old names...

--dave

On Fri, Jun 19, 2009 at 7:44 AM, Hyrum K. Wright<hyrum_at_hyrumwright.org> wrote:
> Author: hwright
> Date: Fri Jun 19 07:44:55 2009
> New Revision: 38094
>
> Log:
> Followup to r38093: Remove obsolete, and no-longer-used macros, as well as
> fields in the test func structure.
>
> * subversion/tests/svn_test_main.c
>  (get_array_size): Update for the new function variable names.
>  (do_test_num): Don't try to run an old-style test function.
>
> * subversion/tests/svn_test.h
>  (svn_test_driver_t): Remove.
>  (svn_test_descriptor_t): Remove old test func pointer.
>  (SVN_TEST_PASS2, SVN_TEST_XFAIL2, SVN_TEST_XFAIL_COND2, SVN_TEST_SKIP2,
>   SVN_TEST_OPTS_PASS, SVN_TEST_OPTS_XFAIL, SVN_TEST_OPS_XFAIL_COND,
>   SVN_TEST_OPTS_SKIP, SVN_TEST_WIMP, SVN_TEST_WIMP_COND, SVN_TEST_OPTS_WIMP,
>   SVN_TEST_OPTS_WIMP_COND):
>    Remove old-style func field.
>  (SVN_TEST_PASS, SVN_TEST_XFAIL, SVN_TEST_XFAIL_COND, SVN_TEST_SKIP,
>   SVN_TEST_WIMP0):
>    Remove.
>
> Modified:
>   trunk/subversion/tests/svn_test.h
>   trunk/subversion/tests/svn_test_main.c
>
> Modified: trunk/subversion/tests/svn_test.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/svn_test.h?pathrev=38094&r1=38093&r2=38094
> ==============================================================================
> --- trunk/subversion/tests/svn_test.h   Fri Jun 19 07:30:19 2009        (r38093)
> +++ trunk/subversion/tests/svn_test.h   Fri Jun 19 07:44:55 2009        (r38094)
> @@ -69,13 +69,6 @@ typedef svn_error_t* (*svn_test_driver2_
>  typedef svn_error_t* (*svn_test_driver_opts_t)(const svn_test_opts_t *opts,
>                                                apr_pool_t *pool);
>
> -/* Prototype for test driver functions.
> -   @deprecated Use svn_test_driver2_t instead.  */
> -typedef svn_error_t* (*svn_test_driver_t)(const char **msg,
> -                                          svn_boolean_t msg_only,
> -                                          svn_test_opts_t *opts,
> -                                          apr_pool_t *pool);
> -
>  /* Test modes. */
>  enum svn_test_mode_t
>   {
> @@ -89,9 +82,6 @@ enum svn_test_mode_t
>  */
>  struct svn_test_descriptor_t
>  {
> -  /* Obsolete. A pointer to an old-style test driver function. */
> -  svn_test_driver_t func;
> -
>   /* Is the test marked XFAIL? */
>   enum svn_test_mode_t mode;
>
> @@ -117,47 +107,36 @@ extern struct svn_test_descriptor_t test
>  #define SVN_TEST_NULL  {0}
>
>  /* Initializer for PASS tests */
> -#define SVN_TEST_PASS2(func, msg)  {NULL , svn_test_pass, func, NULL, msg}
> +#define SVN_TEST_PASS2(func, msg)  {svn_test_pass, func, NULL, msg}
>
>  /* Initializer for XFAIL tests */
> -#define SVN_TEST_XFAIL2(func, msg) {NULL, svn_test_xfail, func, NULL, msg}
> +#define SVN_TEST_XFAIL2(func, msg) {svn_test_xfail, func, NULL, msg}
>
>  /* Initializer for conditional XFAIL tests */
>  #define SVN_TEST_XFAIL_COND2(func, p, msg) \
> -  {NULL, (p) ? svn_test_xfail : svn_test_pass, func, NULL, msg}
> +  {(p) ? svn_test_xfail : svn_test_pass, func, NULL, msg}
>
>  /* Initializer for SKIP tests */
>  #define SVN_TEST_SKIP2(func, p, msg) \
> -  {NULL, (p) ? svn_test_skip : svn_test_pass, func, NULL, msg}
> +  {(p) ? svn_test_skip : svn_test_pass, func, NULL, msg}
>
>  /* Similar macros, but for tests needing options.  */
> -#define SVN_TEST_OPTS_PASS(func, msg)  {NULL, svn_test_pass, NULL, func, msg}
> -#define SVN_TEST_OPTS_XFAIL(func, msg) {NULL, svn_test_xfail, NULL, func, msg}
> +#define SVN_TEST_OPTS_PASS(func, msg)  {svn_test_pass, NULL, func, msg}
> +#define SVN_TEST_OPTS_XFAIL(func, msg) {svn_test_xfail, NULL, func, msg}
>  #define SVN_TEST_OPTS_XFAIL_COND(func, p, msg) \
> -  {NULL, (p) ? svn_test_xfail : svn_test_pass, NULL, func, msg}
> +  {(p) ? svn_test_xfail : svn_test_pass, NULL, func, msg}
>  #define SVN_TEST_OPTS_SKIP(func, p, msg) \
> -  {NULL, (p) ? svn_test_skip : svn_test_pass, NULL, func, msg}
> -
> -/* Obsolete initializer macros.  */
> -#define SVN_TEST_PASS(func)  {func, svn_test_pass}
> -#define SVN_TEST_XFAIL(func) {func, svn_test_xfail}
> -#define SVN_TEST_XFAIL_COND(func, p) \
> -                                {func, (p) ? svn_test_xfail : svn_test_pass}
> -#define SVN_TEST_SKIP(func, p) {func, ((p) ? svn_test_skip : svn_test_pass)}
> +  {(p) ? svn_test_skip : svn_test_pass, NULL, func, msg}
>
>  /* Initializer for XFAIL tests for works-in-progress. */
>  #define SVN_TEST_WIMP(func, msg, wip) \
> -  {NULL, svn_test_xfail, func, NULL, msg, wip}
> +  {svn_test_xfail, func, NULL, msg, wip}
>  #define SVN_TEST_WIMP_COND(func, p, msg, wip) \
> -  {NULL, (p) ? svn_test_xfail : svn_test_pass, func, NULL, msg, wip}
> +  {(p) ? svn_test_xfail : svn_test_pass, func, NULL, msg, wip}
>  #define SVN_TEST_OPTS_WIMP(func, msg, wip) \
> -  {NULL, svn_test_xfail, NULL, func, msg, wip}
> +  {svn_test_xfail, NULL, func, msg, wip}
>  #define SVN_TEST_OPTS_WIMP_COND(func, p, msg, wip) \
> -  {NULL, (p) ? svn_test_xfail : svn_test_pass, NULL, func, msg, wip}
> -
> -/* Obsolete version of work-in-progress macros. */
> -#define SVN_TEST_WIMP0(func, wip) \
> -  {func, svn_test_xfail, NULL, NULL, NULL, wip}
> +  {(p) ? svn_test_xfail : svn_test_pass, NULL, func, msg, wip}
>
>
>
>
> Modified: trunk/subversion/tests/svn_test_main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/svn_test_main.c?pathrev=38094&r1=38093&r2=38094
> ==============================================================================
> --- trunk/subversion/tests/svn_test_main.c      Fri Jun 19 07:30:19 2009        (r38093)
> +++ trunk/subversion/tests/svn_test_main.c      Fri Jun 19 07:44:55 2009        (r38094)
> @@ -150,7 +150,7 @@ get_array_size(void)
>  {
>   int i;
>
> -  for (i = 1; test_funcs[i].msg || test_funcs[i].func; i++)
> +  for (i = 1; test_funcs[i].func2 || test_funcs[i].func_opts; i++)
>     {
>     }
>
> @@ -188,18 +188,13 @@ do_test_num(const char *progname,
>   wimp = xfail && desc->wip;
>
>   /* Do test */
> -  if (desc->func)
> -    err = (*desc->func)(&msg, msg_only || skip, opts, pool);
> +  msg = desc->msg;
> +  if (msg_only || skip)
> +    ; /* pass */
> +  else if (desc->func2)
> +    err = (*desc->func2)(pool);
>   else
> -    {
> -      msg = desc->msg;
> -      if (msg_only || skip)
> -        ; /* pass */
> -      else if (desc->func2)
> -        err = (*desc->func2)(pool);
> -      else
> -        err = (*desc->func_opts)(opts, pool);
> -    }
> +    err = (*desc->func_opts)(opts, pool);
>
>   if (err && err->apr_err == SVN_ERR_TEST_SKIPPED)
>     {
> @@ -252,7 +247,7 @@ do_test_num(const char *progname,
>       if (apr_isupper(msg[0]))
>         printf("WARNING: Test docstring is capitalized\n");
>     }
> -  if (desc->func == NULL && desc->msg == NULL)
> +  if (desc->msg == NULL)
>     printf("WARNING: New-style test descriptor is missing a docstring.\n");
>
>   skip_cleanup = test_failed;
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=2363534
>

-- 
glasser_at_davidglasser.net | langtonlabs.org | flickr.com/photos/glasser/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2365475
Received on 2009-06-25 22:53:16 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.