avr-libc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-commit] [2521] patch #8964: Update tests isinf-01.c, signbit-0


From: Pitchumani
Subject: [avr-libc-commit] [2521] patch #8964: Update tests isinf-01.c, signbit-01.c and modf-np.c
Date: Mon, 04 Apr 2016 08:49:35 +0000

Revision: 2521
          http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2521
Author:   pitchumani
Date:     2016-04-04 08:49:35 +0000 (Mon, 04 Apr 2016)
Log Message:
-----------
patch #8964: Update tests isinf-01.c, signbit-01.c and modf-np.c

Ticket Links:
------------
    http://savannah.gnu.org/patch/?8964

Modified Paths:
--------------
    trunk/avr-libc/ChangeLog
    trunk/avr-libc/NEWS
    trunk/avr-libc/tests/simulate/math/isinf-01.c
    trunk/avr-libc/tests/simulate/math/modf-np.c
    trunk/avr-libc/tests/simulate/math/signbit-01.c

Modified: trunk/avr-libc/ChangeLog
===================================================================
--- trunk/avr-libc/ChangeLog    2016-04-04 08:38:44 UTC (rev 2520)
+++ trunk/avr-libc/ChangeLog    2016-04-04 08:49:35 UTC (rev 2521)
@@ -1,5 +1,14 @@
 2016-04-04  Pitchumani Sivanupandi <address@hidden>
 
+       patch #8964: Update tests
+       * tests/simulate/math/isinf-01.c: Update test condition as the expected
+       value of isinf is non-zero in case of argument is infinite.
+       * tests/simulate/math/signbit-01.c: Likewise for signbit function.
+       * tests/simulate/math/modf-np.c: Update test to use avr-libc's modf
+       function.
+
+2016-04-04  Pitchumani Sivanupandi <address@hidden>
+
        patch #8961: Update test script
        * tests/simulate/runtest.sh (Simulate): Do not generate bin file.
        Change exit address from byte to word address. Update options and add

Modified: trunk/avr-libc/NEWS
===================================================================
--- trunk/avr-libc/NEWS 2016-04-04 08:38:44 UTC (rev 2520)
+++ trunk/avr-libc/NEWS 2016-04-04 08:49:35 UTC (rev 2521)
@@ -9,6 +9,7 @@
   [no-id] Define weak symbols for known memory region sizes based on device 
   header definitions, starting with fuse region.
   [#8961] Update test script for new simulavr and library layout
+  [#8964] Update tests isinf-01.c, signbit-01.c and modf-np.c
 
 * Other changes:
 

Modified: trunk/avr-libc/tests/simulate/math/isinf-01.c
===================================================================
--- trunk/avr-libc/tests/simulate/math/isinf-01.c       2016-04-04 08:38:44 UTC 
(rev 2520)
+++ trunk/avr-libc/tests/simulate/math/isinf-01.c       2016-04-04 08:49:35 UTC 
(rev 2521)
@@ -115,7 +115,8 @@
        x.lo = pgm_read_dword (& t[i].x);
        z = pgm_read_word (& t[i].z);
        v = isinf (x.fl);
-       if (v != z) {
+    /* expect non-zero in case of infinite value.  */
+       if (!(z ? v : v == 0)) {
            PRINTFLN ("i= %d  v= %d", i, v);
            EXIT (i + 1);
        }

Modified: trunk/avr-libc/tests/simulate/math/modf-np.c
===================================================================
--- trunk/avr-libc/tests/simulate/math/modf-np.c        2016-04-04 08:38:44 UTC 
(rev 2520)
+++ trunk/avr-libc/tests/simulate/math/modf-np.c        2016-04-04 08:49:35 UTC 
(rev 2521)
@@ -36,12 +36,14 @@
 int main ()
 {
     double z;
+    double (* volatile vp)(double, double*);
 
     {
 #ifdef __AVR__
        /* Address of R1 is 0x0001      */
        unsigned char r1;
-       z = modf (257.5, 0);            /* 257 == 0x0101        */
+       vp = &modf;
+       z = vp (257.5, 0);              /* 257 == 0x0101        */
        asm ("mov %0,r1 \n\t clr r1" : "=r"(r1));
        if (r1)
            exit (__LINE__);

Modified: trunk/avr-libc/tests/simulate/math/signbit-01.c
===================================================================
--- trunk/avr-libc/tests/simulate/math/signbit-01.c     2016-04-04 08:38:44 UTC 
(rev 2520)
+++ trunk/avr-libc/tests/simulate/math/signbit-01.c     2016-04-04 08:49:35 UTC 
(rev 2521)
@@ -116,7 +116,9 @@
        x.lo = pgm_read_dword (& t[i].x);
        z = pgm_read_word (& t[i].z);
        v = signbit (x.fl);
-       if (v != z) {
+       /* expect non-zero if sign bit is not set.
+          avr-libc implementation returns 1 if signed. */
+       if (!(z ? v : v == 0)) {
            PRINTFLN ("i= %d  v= %d", i, v);
            EXIT (i + 1);
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]