[PATCH v2 2/4] added test for fegetexeptflag and fesetexeptflag

Gedare Bloom gedare at rtems.org
Wed Mar 4 16:42:49 UTC 2020


I see you fixed some of the problems in this patch from the previous
patch.   Please "squash" the two patches together. Read about git
interactive rebase (fixup or squash options) to do this. You should
not include in one patch things that are broken and that you fix in
another patch in the same series. Go back and correct what was wrong
in the first place.

On Tue, Mar 3, 2020 at 12:50 PM Eshan dhawan <eshandhawan51 at gmail.com> wrote:
>
> ---
>  testsuites/psxtests/psxfenv01/init.c | 27 +++++++++------------------
>  1 file changed, 9 insertions(+), 18 deletions(-)
>
> diff --git a/testsuites/psxtests/psxfenv01/init.c b/testsuites/psxtests/psxfenv01/init.c
> index 8ffb9395b9..05f3cdc880 100644
> --- a/testsuites/psxtests/psxfenv01/init.c
> +++ b/testsuites/psxtests/psxfenv01/init.c
> @@ -47,8 +47,9 @@
>  #include <rtems/test.h>
>  #include <tmacros.h>
>  #include <assert.h>
> +#include <float.h>
> +
>
> -#define rtems_test_assert(x) assert(x)
>
>  const char rtems_test_name[] = "PSXFENV 01";
>
> @@ -74,19 +75,19 @@ rtems_task Init(rtems_task_argument ignored)
>      r = fesetenv(FE_DFL_ENV);
>      if (r)
>        printf("fesetenv ==> %d\n", r);
> -    assert( r == 0 );
> +    rtems_test_assert( r == 0 );
>
>      /* Test 'feclearexcept()' and 'fetestexcept()' in one go. */
>      puts( "feclearexcept(FE_ALL_EXCEPT)." );
>      r = feclearexcept(FE_ALL_EXCEPT);
>      if (r)
>        printf("feclearexcept ==> 0x%x\n", r);
> -    assert( r == 0 );
> +    rtems_test_assert( r == 0 );
>
>      r = fetestexcept( FE_ALL_EXCEPT );
>      if (r)
>        printf("fetestexcept ==> 0x%x\n", r);
> -    assert( r == 0 );
> +    rtems_test_assert( r == 0 );
>
>      /* Test 'FE_DIVBYZERO' */
>      puts( "Divide by zero and confirm fetestexcept()" );
> @@ -98,18 +99,19 @@ rtems_task Init(rtems_task_argument ignored)
>      r=fegetexceptflag(&excepts,FE_ALL_EXCEPT);
>      if(r)
>        printf("fegetexceptflag ==> 0x%x\n", r);
> -    assert(r == 0);
> +    rtems_test_assert(r == 0);
>
>      r=fesetexceptflag(&excepts, FE_ALL_EXCEPT);
>      if(r)
>        printf("fesetexceptflag ==> 0x%x\n", r);
> -    assert(r == 0);
> +    rtems_test_assert(r == 0);
>
> +
>
>
>  #ifdef FE_DIVBYZERO
>      r = feraiseexcept(FE_DIVBYZERO);
> -    assert( fetestexcept( FE_DIVBYZERO ) );
> +    rtems_test_assert( fetestexcept( FE_DIVBYZERO ) );
>  #endif
>
>      /* Test 'FE_INEXACT' */
> @@ -140,14 +142,3 @@ rtems_task Init(rtems_task_argument ignored)
>  /* end of file */
>
>
> -/*
> -    fegetenv()
> -
> -    fegetround()
> -    feholdexcept()
> -
> -    fesetexceptflag()
> -    fesetround()
> -
> -    feupdateenv()
> -*/
> --
> 2.17.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list