[PATCH] testsuites: Add TESTS_USE_PRINTF

Gedare Bloom gedare at rtems.org
Tue Feb 11 17:31:27 UTC 2014


I think it would be better and more consistent to put the check
#if defined(TESTS_USE_PRINTF)
or
#elif defined(TESTS_USE_PRINTF)
explicitly, and leave the
#else /* IPRINT */
as the fall-through case for if it is not specified. That way if
another check for print output should be added later, it can be done
the same way without having to rewrite the exclusion check of
!defined(TESTS_USE_PRINTF) to include the new check.

On Tue, Feb 11, 2014 at 11:41 AM, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
> Make it possible to use normal printf() if requested to allow output of
> floating point numbers.
> ---
>  testsuites/support/include/buffer_test_io.h |   17 ++++++++++++++++-
>  1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/testsuites/support/include/buffer_test_io.h b/testsuites/support/include/buffer_test_io.h
> index e0eb24d..465ae05 100644
> --- a/testsuites/support/include/buffer_test_io.h
> +++ b/testsuites/support/include/buffer_test_io.h
> @@ -139,7 +139,7 @@ extern "C" {
>  /*
>   *  USE IPRINT
>   */
> -#else
> +#elif !defined(TESTS_USE_PRINTF)
>
>    #include <stdio.h>
>    #include <stdlib.h>
> @@ -181,6 +181,21 @@ extern "C" {
>        fflush(stdout); \
>      } while (0)
>
> +#else
> +
> +  #include <stdio.h>
> +  #include <stdlib.h>
> +
> +  #define rtems_test_exit(_s) \
> +    do { \
> +      exit(_s); \
> +    } while (0)
> +
> +  #define FLUSH_OUTPUT() \
> +    do { \
> +      fflush(stdout); \
> +    } while (0)
> +
>  #endif
>
>  #ifdef __cplusplus
> --
> 1.7.7
>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel



More information about the devel mailing list