[PATCH] test for fegetround and fesetround

Aditya Upadhyay aadit0402 at gmail.com
Mon Mar 2 15:05:25 UTC 2020


Hi Eshan,

Thanks for pointing this out again. I would appreciate if you can send
here a new v1 patch for the
fenv methods. I can see the list of functions what you have left
there, without any test.
https://lists.rtems.org/pipermail/devel/2020-February/057669.html

Could you please remove this? I have not yet tested the code due to
sparc-rtems-gdb and tar sim error.
I will have to resolve this issue.

For each tests, you need to understand the behavior of that function
based on different parameters. I assume that
you must have gone through the open group pages of these functions,
there you will get to know the different
outcomes. You will also have to look into some invalid set of inputs.

If you are interested to contribute in POSIX Compliance, then I would
suggest you to make yourself familiar with
newlib-cygwin building process. You can also fix some warnings while
building Newlib if you find one and send a patch to
newlib mailing list. You may be spending most of the gsoc duration
contributing to Newlib rather than RTEMS.

Regards,
Aditya Upadhyay




On Mon, Mar 2, 2020 at 1:26 AM Eshan Dhawan <eshandhawan51 at gmail.com> wrote:
>
> hello everyone,
> I am new here and I sent the patches:
> 1. > https://lists.rtems.org/pipermail/devel/2020-February/057669.html
> 2. > https://lists.rtems.org/pipermail/devel/2020-February/057671.html
> 3. > https://lists.rtems.org/pipermail/devel/2020-February/057711.html
> a few days ago.
> for adding tests to psxfenv01.
> but no one reviewed it.
> so I ping it back
> if someone could review it and give feedback.
>
> -- Eshan
>
> On Tue, Feb 25, 2020 at 11:15 PM Eshan Dhawan <eshandhawan51 at gmail.com> wrote:
>>
>> added tests for fegetround and fesetround in psxtests / psxfenv01
>>
>> fegetround fails to send the rounding direction due to soft float and returns to_nearest or zero  in the cases
>> fesetround sends zero if the rounding direction is set and sends anything else if the function fails to set the rounding direction
>>
>> can you check the patch for correctness
>>
>> - Eshan
>>
>> On Tue, Feb 25, 2020 at 8:26 PM Eshan dhawan <eshandhawan51 at gmail.com> wrote:
>>>
>>> ---
>>>  testsuites/psxtests/psxfenv01/init.c | 42 +++++++++++++++++++++++++++-
>>>  1 file changed, 41 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/testsuites/psxtests/psxfenv01/init.c b/testsuites/psxtests/psxfenv01/init.c
>>> index 05f3cdc880..4339139c58 100644
>>> --- a/testsuites/psxtests/psxfenv01/init.c
>>> +++ b/testsuites/psxtests/psxfenv01/init.c
>>> @@ -106,7 +106,47 @@ rtems_task Init(rtems_task_argument ignored)
>>>        printf("fesetexceptflag ==> 0x%x\n", r);
>>>      rtems_test_assert(r == 0);
>>>
>>> -
>>> +
>>> +    /*test for fegetround() and fesetround()*/
>>> +    /*they have four main macros to be tested seperated by ifdef*/
>>> +    /* since all the architectures dont support them */
>>> +    /*the test cases gets and sets the rounding directions */
>>> +#ifdef FE_TONEAREST
>>> +
>>> +    r=fegetround();
>>> +    if(r)
>>> +       printf("fegetround ==> 0x%x\n", r);
>>> +    rtems_test_assert(r == FE_TONEAREST) ;
>>> +#endif
>>> +#ifdef FE_TOWARDZERO
>>> +
>>> +  r=fesetround(FE_TOWARDZERO);
>>> +  if(r)
>>> +       printf("fesetround ==> 0x%x\n", r);
>>> +  rtems_test_assert(r == 0) ;
>>> +  rtems_test_assert(fegetround() == FE_TOWARDZERO) ;
>>> +#endif
>>> +#ifdef FE_DOWNWARD
>>> +
>>> +  r=fesetround(FE_DOWNWARD);
>>> +  if(r)
>>> +       printf("fesetround ==> 0x%x\n", r);
>>> +  rtems_test_assert(r == 0) ;
>>> +  rtems_test_assert(fegetround() == FE_DOWNWARD) ;
>>> +#endif
>>> +#ifdef FE_UPWARD
>>> +  r=fesetround(FE_UPWARD);
>>> +  if(r)
>>> +       printf("fesetround ==> 0x%x\n", r);
>>> +  rtems_test_assert(r == 0) ;
>>> +  rtems_test_assert(fegetround() == FE_UPWARD) ;
>>> +#endif
>>> +#ifdef FE_TONEAREST
>>> +  r=fesetround(FE_TONEAREST);
>>> +  if(r)
>>> +       printf("fesetround ==> 0x%x\n", r);
>>> +  rtems_test_assert(r == 0) ;
>>> +#endif
>>>
>>>
>>>  #ifdef FE_DIVBYZERO
>>> --
>>> 2.17.1
>>>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list