libtool
[Top][All Lists]
Advanced

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

Re: test failures


From: Ralf Wildenhues
Subject: Re: test failures
Date: Tue, 7 Nov 2006 18:53:43 +0100
User-agent: Mutt/1.5.13 (2006-11-01)

Hi Gary,

* Gary V. Vaughan wrote on Fri, Nov 03, 2006 at 11:50:11PM CET:
> On 27 Oct 2006, at 17:57, Ralf Wildenhues wrote:
[...]
> >+  /* The ! is to invert C true to shell true
[...]
> >+  return !( fabs (b (3.1415 / 2.)) < 0.01 && fabs (sqrt (four) -  
> >2.) < 0.01 );
> > }
> 
> Rather than `!', may I humbly suggest the self documenting alternative:

Definitely.  I'm installing this.

Cheers, and thanks, and have fun riding!
Ralf

        * tests/link-order2.at: Simplify logic to be a bit more self
        documenting.  Suggested by Gary V. Vaughan.

Index: tests/link-order2.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/link-order2.at,v
retrieving revision 1.2
diff -u -r1.2 link-order2.at
--- tests/link-order2.at        27 Oct 2006 22:57:00 -0000      1.2
+++ tests/link-order2.at        7 Nov 2006 17:52:39 -0000
@@ -41,18 +41,21 @@
 
 cat >main.c <<\EOF
 #include <math.h>
+#include <stdlib.h>
 extern double b (double);
 extern double four;
 double four = 4.0;
 int main (void)
 {
-  /* The ! is to invert C true to shell true
-   * The function b should call our sin (that returns 0) and not libm's
+  /* The function b should call our sin (that returns 0) and not libm's
    * (in the latter case, b returns approximately 1)
    * the sqrt is to force linking against libm
    * the variable four is to prevent most compiler optimizations
    */
-  return !( fabs (b (3.1415 / 2.)) < 0.01 && fabs (sqrt (four) - 2.) < 0.01 );
+  int status = EXIT_FAILURE;
+  if (fabs (b (3.1415 / 2.)) < 0.01 && fabs (sqrt (four) - 2.) < 0.01)
+    status = EXIT_SUCCESS;
+  return status;
 }
 EOF
 





reply via email to

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