<div dir="ltr"><div><div>This code was already present in the psxtests written by Vaibhav last year <br></div>I haven't changed any information related to copyright.<br></div><div>If anything needs to be changed. I will change it in the next patch.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 26, 2020 at 11:12 PM Aditya Upadhyay <<a href="mailto:aadit0402@gmail.com">aadit0402@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">One more thing, If Vaibhav has provided you this source code and you modified then put Vaibhav's name alongwith your name as Copyright info. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 26 Mar 2020, 23:10 Aditya Upadhyay, <<a href="mailto:aadit0402@gmail.com" target="_blank">aadit0402@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 26 Mar 2020, 22:59 Eshan dhawan, <<a href="mailto:eshandhawan51@gmail.com" rel="noreferrer" target="_blank">eshandhawan51@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---<br>
 testsuites/psxtests/psxfenv01/init.c  Â  Â  Â  | 87 ++++++++++++++++-----<br>
 testsuites/psxtests/psxfenv01/psxfenv01.doc |  9 ++-<br>
 testsuites/psxtests/psxfenv01/psxfenv01.scn |  4 -<br>
 3 files changed, 76 insertions(+), 24 deletions(-)<br>
<br>
diff --git a/testsuites/psxtests/psxfenv01/init.c b/testsuites/psxtests/psxfenv01/init.c<br>
index cdb0fa596e..158816888d 100644<br>
--- a/testsuites/psxtests/psxfenv01/init.c<br>
+++ b/testsuites/psxtests/psxfenv01/init.c<br>
@@ -46,11 +46,12 @@<br>
 #include <string.h><br>
 #include <rtems/test.h><br>
 #include <tmacros.h><br>
+#include <float.h><br>
<br>
 const char rtems_test_name[] = "PSXFENV 01";<br>
<br>
 /* forward declarations to avoid warnings */<br>
-rtems_task Init(rtems_task_argument ignored);<br>
+rtems_task Init( rtems_task_argument ignored );<br>
<br>
 /* Test Function Begins */<br>
 rtems_task Init(rtems_task_argument ignored)<br>
@@ -62,40 +63,90 @@ rtems_task Init(rtems_task_argument ignored)<br>
<br>
  Â /*<br>
  Â  * 'FE_ALL_EXCEPT' will be defined only when 'feclearexcept()',<br>
-  Â * 'fegetexceptflag()', 'feraiseexcept()', 'fesetexceptflag()' and<br>
-  Â * 'fetestexcept()' functions are supported by the architecture.<br>
+  Â * fegetexceptflag() , feraiseexcept(), fesetexceptflag() and<br>
+  Â * fetestexcept() functions are supported by the architecture.<br>
  Â  * Hence their testcases can be wrapped under #ifdef and #endif.<br>
  Â  */<br>
  Â #ifdef FE_ALL_EXCEPT /* floating-point exceptions */<br>
-  Â  puts( "fesetenv(FE_DFL_ENV)." );<br>
-  Â  r = fesetenv(FE_DFL_ENV);<br>
-  Â  if (r)<br>
-  Â  Â  printf("fesetenv ==> %d\n", r);<br>
+  Â  r = fesetenv( FE_DFL_ENV );<br>
+  Â  if ( r ) {<br>
+  Â  Â  printf( "fesetenv ==> %d\n", r);<br>
+  Â  }<br>
  Â  Â rtems_test_assert( r == 0 );<br>
<br>
-  Â  /* Test 'feclearexcept()' and 'fetestexcept()' in one go. */<br>
-  Â  puts( "feclearexcept(FE_ALL_EXCEPT)." );<br>
-  Â  r = feclearexcept(FE_ALL_EXCEPT);<br>
-  Â  if (r)<br>
-  Â  Â  printf("feclearexcept ==> 0x%x\n", r);<br>
+  Â  /* Test feclearexcept() and fetestexcept() in one go. */<br>
+  Â  r = feclearexcept( FE_ALL_EXCEPT );<br>
+  Â  if ( r ) {<br>
+  Â  Â  printf( "feclearexcept ==> 0x%x\n", r );<br>
+  Â  }  Â  <br>
  Â  Â rtems_test_assert( r == 0 );<br>
<br>
  Â  Â r = fetestexcept( FE_ALL_EXCEPT );<br>
-  Â  if (r)<br>
-  Â  Â  printf("fetestexcept ==> 0x%x\n", r);<br>
+  Â  if ( r ) {<br>
+  Â  Â  printf( "fetestexcept ==> 0x%x\n", r );<br>
+  Â  }<br>
  Â  Â rtems_test_assert( r == 0 );<br>
<br>
-  Â  /* Test 'FE_DIVBYZERO' */<br>
-  Â  puts( "Divide by zero and confirm fetestexcept()" );<br>
+  Â  /* Test 'FE_DIVBYZERO' <br>
+  Â  Â *Divide by zero and confirm fetestexcept() */<br>
  Â  Â a = 0.0;<br>
  Â  Â b = 1.0;<br>
  Â  Â c = b/a;<br>
  Â  Â (void) c;<br>
+  Â  /* Test fegetexceptflag() and fesetexceptflag() */<br>
+  Â  r = fegetexceptflag( &excepts, FE_ALL_EXCEPT );<br>
+  Â  if ( r ) {<br>
+  Â  Â  printf( "fegetexceptflag ==> 0x%x\n", r );<br>
+  Â  }<br>
+  Â  rtems_test_assert( r == 0 );<br>
<br>
-  Â  fegetexceptflag(&excepts,FE_ALL_EXCEPT);<br>
+  Â  r = fesetexceptflag( &excepts, FE_ALL_EXCEPT );<br>
+  Â  if ( r ) {<br>
+  Â  Â  printf( "fesetexceptflag ==> 0x%x\n", r );<br>
+  Â  }<br>
+  Â  rtems_test_assert( r == 0 );<br>
<br>
+  Â  /* Test for fegetround() and fesetround() <br>
+  Â  Â * They have four main macros to be tested separated by ifdef<br>
+  Â  Â * Since not all architectures support them <br>
+  Â  Â * The test case gets and sets the rounding directions */<br>
+#ifdef FE_TONEAREST<br>
+  Â  rtems_test_assert( fegetround() == FE_TONEAREST );  Â <br>
+#endif<br>
+#ifdef FE_TOWARDZERO  Â  <br>
+  r = fesetround( FE_TOWARDZERO );<br>
+  if ( r ) {<br>
+  Â  Â  printf( "fesetround ==> 0x%x\n", r );  Â  Â <br>
+  Â  } <br>
+  rtems_test_assert( r == 0 );<br>
+  rtems_test_assert( fegetround() == FE_TOWARDZERO );<br>
+#endif<br>
+#ifdef FE_DOWNWARD<br>
+  r = fesetround( FE_DOWNWARD );<br>
+  if ( r ) {<br>
+  Â  Â  printf( "fesetround ==> 0x%x\n", r );  Â  Â <br>
+  Â  } <br>
+  rtems_test_assert( r == 0 );<br>
+  rtems_test_assert( fegetround() == FE_DOWNWARD );<br>
+#endif<br>
+#ifdef FE_UPWARD<br>
+  r = fesetround( FE_UPWARD );<br>
+  if ( r ) {<br>
+  Â  Â  printf( "fesetround ==> 0x%x\n", r );  Â  Â <br>
+  Â  }  Â <br>
+  rtems_test_assert( r == 0 );<br>
+  rtems_test_assert( fegetround() == FE_UPWARD );<br>
+#endif<br>
+#ifdef FE_TONEAREST<br>
+  r = fesetround( FE_TONEAREST );<br>
+  if ( r ) {<br>
+  Â  Â  printf( "fesetround ==> 0x%x\n", r );<br>
+  Â  }  Â  Â <br>
+  rtems_test_assert( r == 0 );<br>
+#endif<br>
+  <br>
 #ifdef FE_DIVBYZERO<br>
-  Â  r = feraiseexcept(FE_DIVBYZERO);<br>
+  Â  r = feraiseexcept( FE_DIVBYZERO ) ;<br>
  Â  Â rtems_test_assert( fetestexcept( FE_DIVBYZERO ) );<br>
 #endif<br>
<br>
diff --git a/testsuites/psxtests/psxfenv01/psxfenv01.doc b/testsuites/psxtests/psxfenv01/psxfenv01.doc<br>
index 3aa7757496..0238372013 100644<br>
--- a/testsuites/psxtests/psxfenv01/psxfenv01.doc<br>
+++ b/testsuites/psxtests/psxfenv01/psxfenv01.doc<br>
@@ -1,4 +1,4 @@<br>
-#  COPYRIGHT (c) 2019<br>
+#  COPYRIGHT (c) 2019<br>
 #  On-Line Applications Research Corporation (OAR).<br>
 #<br>
 # SPDX-License-Identifier: BSD-2-Clause<br>
@@ -12,8 +12,13 @@ Directives:<br>
  Â fesetenv<br>
  Â feclearexcept<br>
  Â fetestexcept<br>
-  texceptflag<br>
  Â feraiseexcept<br>
+  fesetexeptflag<br>
+  fegetexeptflag<br>
+  fegetround<br>
+  fesetround<br>
+  <br>
+<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Just remove this one unnecessary space after fesetround. Otherwise It looks good. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
 Concepts:<br>
<br>
diff --git a/testsuites/psxtests/psxfenv01/psxfenv01.scn b/testsuites/psxtests/psxfenv01/psxfenv01.scn<br>
index 21395e6712..6ea3bc255e 100644<br>
--- a/testsuites/psxtests/psxfenv01/psxfenv01.scn<br>
+++ b/testsuites/psxtests/psxfenv01/psxfenv01.scn<br>
@@ -1,7 +1,3 @@<br>
 *** BEGIN OF TEST PSXFENV 01 ***<br>
-fesetenv(FE_DFL_ENV).<br>
-feclearexcept(FE_ALL_EXCEPT).<br>
-Divide by zero and confirm fetestexcept()<br>
-<br>
 *** END OF TEST PSXFENV 01 ***<br>
<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div></div></div>
</blockquote></div>
</blockquote></div>