<div dir="ltr"><div><div><div>I have added test for fegetflagexept and fesetflagexept in psxfenv test suite <br></div>can someone check the test case for the correctness <br></div>it runs fine in riscv <br></div>also i have sent another patch to change assert() back to rtems_test_assert()<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 24, 2020 at 9:18 PM Eshan dhawan <<a href="mailto:eshandhawan51@gmail.com">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 | 36 ++++++++++++++++++++++++----<br>
1 file changed, 31 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/testsuites/psxtests/psxfenv01/init.c b/testsuites/psxtests/psxfenv01/init.c<br>
index cdb0fa596e..8ffb9395b9 100644<br>
--- a/testsuites/psxtests/psxfenv01/init.c<br>
+++ b/testsuites/psxtests/psxfenv01/init.c<br>
@@ -46,6 +46,9 @@<br>
#include <string.h><br>
#include <rtems/test.h><br>
#include <tmacros.h><br>
+#include <assert.h><br>
+<br>
+#define rtems_test_assert(x) assert(x) <br>
<br>
const char rtems_test_name[] = "PSXFENV 01";<br>
<br>
@@ -71,19 +74,19 @@ rtems_task Init(rtems_task_argument ignored)<br>
r = fesetenv(FE_DFL_ENV);<br>
if (r)<br>
printf("fesetenv ==> %d\n", r);<br>
- rtems_test_assert( r == 0 );<br>
+ 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>
- rtems_test_assert( r == 0 );<br>
+ assert( r == 0 );<br>
<br>
r = fetestexcept( FE_ALL_EXCEPT );<br>
if (r)<br>
printf("fetestexcept ==> 0x%x\n", r);<br>
- rtems_test_assert( r == 0 );<br>
+ assert( r == 0 );<br>
<br>
/* Test 'FE_DIVBYZERO' */<br>
puts( "Divide by zero and confirm fetestexcept()" );<br>
@@ -91,12 +94,22 @@ rtems_task Init(rtems_task_argument ignored)<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>
+ assert(r == 0);<br>
+<br>
+ r=fesetexceptflag(&excepts, FE_ALL_EXCEPT);<br>
+ if(r)<br>
+ printf("fesetexceptflag ==> 0x%x\n", r);<br>
+ assert(r == 0);<br>
+<br>
<br>
- fegetexceptflag(&excepts,FE_ALL_EXCEPT);<br>
<br>
#ifdef FE_DIVBYZERO<br>
r = feraiseexcept(FE_DIVBYZERO);<br>
- rtems_test_assert( fetestexcept( FE_DIVBYZERO ) );<br>
+ assert( fetestexcept( FE_DIVBYZERO ) );<br>
#endif<br>
<br>
/* Test 'FE_INEXACT' */<br>
@@ -125,3 +138,16 @@ rtems_task Init(rtems_task_argument ignored)<br>
#define CONFIGURE_INIT<br>
#include <rtems/confdefs.h><br>
/* end of file */<br>
+<br>
+<br>
+/*<br>
+ fegetenv()<br>
+ <br>
+ fegetround()<br>
+ feholdexcept()<br>
+ <br>
+ fesetexceptflag()<br>
+ fesetround()<br>
+ <br>
+ feupdateenv()<br>
+*/<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div>