Re: CVS commit: src/tests/lib/libm

2011-09-13 Thread Marc Balmer
Am 12.09.11 18:28, schrieb Jukka Ruohonen:
 Module Name:  src
 Committed By: jruoho
 Date: Mon Sep 12 16:28:37 UTC 2011
 
 Modified Files:
   src/tests/lib/libm: t_ldexp.c t_scalbn.c t_tanh.c
 
 Log Message:
 Happiness of VAX implies ugliness of the code.

But does it make the VAX really happy, if all the code is just ifdef'ed
out?  Or did I get that wrong that the tests are now simply disabled on
the vax?

 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libm/t_ldexp.c \
 src/tests/lib/libm/t_scalbn.c
 cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libm/t_tanh.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 
 
 
 
 Modified files:
 
 Index: src/tests/lib/libm/t_ldexp.c
 diff -u src/tests/lib/libm/t_ldexp.c:1.2 src/tests/lib/libm/t_ldexp.c:1.3
 --- src/tests/lib/libm/t_ldexp.c:1.2  Mon Sep 12 15:47:14 2011
 +++ src/tests/lib/libm/t_ldexp.c  Mon Sep 12 16:28:37 2011
 @@ -1,4 +1,4 @@
 -/* $NetBSD: t_ldexp.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $ */
 +/* $NetBSD: t_ldexp.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $ */
  
  /*-
   * Copyright (c) 2011 The NetBSD Foundation, Inc.
 @@ -29,7 +29,7 @@
   * POSSIBILITY OF SUCH DAMAGE.
   */
  #include sys/cdefs.h
 -__RCSID($NetBSD: t_ldexp.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $);
 +__RCSID($NetBSD: t_ldexp.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $);
  
  #include math.h
  #include limits.h
 @@ -49,6 +49,7 @@
  
  ATF_TC_BODY(ldexp_nan, tc)
  {
 +#ifndef __vax__
   const double x = 0.0L / 0.0L;
   double y;
   size_t i;
 @@ -59,6 +60,7 @@
   y = ldexp(x, exps[i]);
   ATF_CHECK(isnan(y) != 0);
   }
 +#endif
  }
  
  ATF_TC(ldexp_inf_neg);
 @@ -69,11 +71,13 @@
  
  ATF_TC_BODY(ldexp_inf_neg, tc)
  {
 +#ifndef __vax__
   const double x = -1.0L / 0.0L;
   size_t i;
  
   for (i = 0; i  __arraycount(exps); i++)
   ATF_CHECK(ldexp(x, exps[i]) == x);
 +#endif
  }
  
  ATF_TC(ldexp_inf_pos);
 @@ -84,11 +88,13 @@
  
  ATF_TC_BODY(ldexp_inf_pos, tc)
  {
 +#ifndef __vax__
   const double x = 1.0L / 0.0L;
   size_t i;
  
   for (i = 0; i  __arraycount(exps); i++)
   ATF_CHECK(ldexp(x, exps[i]) == x);
 +#endif
  }
  
  ATF_TC(ldexp_zero_neg);
 @@ -99,6 +105,7 @@
  
  ATF_TC_BODY(ldexp_zero_neg, tc)
  {
 +#ifndef __vax__
   const double x = -0.0L;
   double y;
   size_t i;
 @@ -110,6 +117,7 @@
   ATF_CHECK(x == y);
   ATF_CHECK(signbit(y) != 0);
   }
 +#endif
  }
  
  ATF_TC(ldexp_zero_pos);
 @@ -120,6 +128,7 @@
  
  ATF_TC_BODY(ldexp_zero_pos, tc)
  {
 +#ifndef __vax__
   const double x = 0.0L;
   double y;
   size_t i;
 @@ -131,6 +140,7 @@
   ATF_CHECK(x == y);
   ATF_CHECK(signbit(y) == 0);
   }
 +#endif
  }
  
  ATF_TC(ldexpf_nan);
 @@ -141,6 +151,7 @@
  
  ATF_TC_BODY(ldexpf_nan, tc)
  {
 +#ifndef __vax__
   const float x = 0.0L / 0.0L;
   float y;
   size_t i;
 @@ -151,6 +162,7 @@
   y = ldexpf(x, exps[i]);
   ATF_CHECK(isnan(y) != 0);
   }
 +#endif
  }
  
  /*
 @@ -165,11 +177,13 @@
  
  ATF_TC_BODY(ldexpf_inf_neg, tc)
  {
 +#ifndef __vax__
   const float x = -1.0L / 0.0L;
   size_t i;
  
   for (i = 0; i  __arraycount(exps); i++)
   ATF_CHECK(ldexpf(x, exps[i]) == x);
 +#endif
  }
  
  ATF_TC(ldexpf_inf_pos);
 @@ -180,11 +194,13 @@
  
  ATF_TC_BODY(ldexpf_inf_pos, tc)
  {
 +#ifndef __vax__
   const float x = 1.0L / 0.0L;
   size_t i;
  
   for (i = 0; i  __arraycount(exps); i++)
   ATF_CHECK(ldexpf(x, exps[i]) == x);
 +#endif
  }
  
  ATF_TC(ldexpf_zero_neg);
 @@ -195,6 +211,7 @@
  
  ATF_TC_BODY(ldexpf_zero_neg, tc)
  {
 +#ifndef __vax__
   const float x = -0.0L;
   float y;
   size_t i;
 @@ -206,6 +223,7 @@
   ATF_CHECK(x == y);
   ATF_CHECK(signbit(y) != 0);
   }
 +#endif
  }
  
  ATF_TC(ldexpf_zero_pos);
 @@ -216,6 +234,7 @@
  
  ATF_TC_BODY(ldexpf_zero_pos, tc)
  {
 +#ifndef __vax__
   const float x = 0.0L;
   float y;
   size_t i;
 @@ -227,6 +246,7 @@
   ATF_CHECK(x == y);
   ATF_CHECK(signbit(y) == 0);
   }
 +#endif
  }
  
  ATF_TP_ADD_TCS(tp)
 Index: src/tests/lib/libm/t_scalbn.c
 diff -u src/tests/lib/libm/t_scalbn.c:1.2 src/tests/lib/libm/t_scalbn.c:1.3
 --- src/tests/lib/libm/t_scalbn.c:1.2 Mon Sep 12 15:47:14 2011
 +++ src/tests/lib/libm/t_scalbn.c Mon Sep 12 16:28:37 2011
 @@ -1,4 +1,4 @@
 -/* $NetBSD: t_scalbn.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $ */
 +/* $NetBSD: t_scalbn.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $ */
  
  /*-
   * Copyright (c) 2011 The NetBSD Foundation, Inc.
 @@ -29,7 +29,7 @@
   * POSSIBILITY OF SUCH DAMAGE.
   */
  #include sys/cdefs.h
 -__RCSID($NetBSD: t_scalbn.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $);
 +__RCSID($NetBSD: t_scalbn.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $);
  
  #include 

Re: CVS commit: src/tests/lib/libm

2011-09-13 Thread Jukka Ruohonen
On Tue, Sep 13, 2011 at 08:38:07AM +0200, Marc Balmer wrote:
 Am 12.09.11 18:28, schrieb Jukka Ruohonen:
  Module Name:src
  Committed By:   jruoho
  Date:   Mon Sep 12 16:28:37 UTC 2011
  
  Modified Files:
  src/tests/lib/libm: t_ldexp.c t_scalbn.c t_tanh.c
  
  Log Message:
  Happiness of VAX implies ugliness of the code.
 
 But does it make the VAX really happy, if all the code is just ifdef'ed
 out?  Or did I get that wrong that the tests are now simply disabled on
 the vax?

You are right. I didn't bother to do atf_tc_skip() for the special case of
VAX. If any of the VAX people want to run the tests, please feel free to fix.

- Jukka.

 
  
  
  To generate a diff of this commit:
  cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libm/t_ldexp.c \
  src/tests/lib/libm/t_scalbn.c
  cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libm/t_tanh.c
  
  Please note that diffs are not public domain; they are subject to the
  copyright notices on the relevant files.
  
  
  
  
  Modified files:
  
  Index: src/tests/lib/libm/t_ldexp.c
  diff -u src/tests/lib/libm/t_ldexp.c:1.2 src/tests/lib/libm/t_ldexp.c:1.3
  --- src/tests/lib/libm/t_ldexp.c:1.2Mon Sep 12 15:47:14 2011
  +++ src/tests/lib/libm/t_ldexp.cMon Sep 12 16:28:37 2011
  @@ -1,4 +1,4 @@
  -/* $NetBSD: t_ldexp.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $ */
  +/* $NetBSD: t_ldexp.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $ */
   
   /*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
  @@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
   #include sys/cdefs.h
  -__RCSID($NetBSD: t_ldexp.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $);
  +__RCSID($NetBSD: t_ldexp.c,v 1.3 2011/09/12 16:28:37 jruoho Exp $);
   
   #include math.h
   #include limits.h
  @@ -49,6 +49,7 @@
   
   ATF_TC_BODY(ldexp_nan, tc)
   {
  +#ifndef __vax__
  const double x = 0.0L / 0.0L;
  double y;
  size_t i;
  @@ -59,6 +60,7 @@
  y = ldexp(x, exps[i]);
  ATF_CHECK(isnan(y) != 0);
  }
  +#endif
   }
   
   ATF_TC(ldexp_inf_neg);
  @@ -69,11 +71,13 @@
   
   ATF_TC_BODY(ldexp_inf_neg, tc)
   {
  +#ifndef __vax__
  const double x = -1.0L / 0.0L;
  size_t i;
   
  for (i = 0; i  __arraycount(exps); i++)
  ATF_CHECK(ldexp(x, exps[i]) == x);
  +#endif
   }
   
   ATF_TC(ldexp_inf_pos);
  @@ -84,11 +88,13 @@
   
   ATF_TC_BODY(ldexp_inf_pos, tc)
   {
  +#ifndef __vax__
  const double x = 1.0L / 0.0L;
  size_t i;
   
  for (i = 0; i  __arraycount(exps); i++)
  ATF_CHECK(ldexp(x, exps[i]) == x);
  +#endif
   }
   
   ATF_TC(ldexp_zero_neg);
  @@ -99,6 +105,7 @@
   
   ATF_TC_BODY(ldexp_zero_neg, tc)
   {
  +#ifndef __vax__
  const double x = -0.0L;
  double y;
  size_t i;
  @@ -110,6 +117,7 @@
  ATF_CHECK(x == y);
  ATF_CHECK(signbit(y) != 0);
  }
  +#endif
   }
   
   ATF_TC(ldexp_zero_pos);
  @@ -120,6 +128,7 @@
   
   ATF_TC_BODY(ldexp_zero_pos, tc)
   {
  +#ifndef __vax__
  const double x = 0.0L;
  double y;
  size_t i;
  @@ -131,6 +140,7 @@
  ATF_CHECK(x == y);
  ATF_CHECK(signbit(y) == 0);
  }
  +#endif
   }
   
   ATF_TC(ldexpf_nan);
  @@ -141,6 +151,7 @@
   
   ATF_TC_BODY(ldexpf_nan, tc)
   {
  +#ifndef __vax__
  const float x = 0.0L / 0.0L;
  float y;
  size_t i;
  @@ -151,6 +162,7 @@
  y = ldexpf(x, exps[i]);
  ATF_CHECK(isnan(y) != 0);
  }
  +#endif
   }
   
   /*
  @@ -165,11 +177,13 @@
   
   ATF_TC_BODY(ldexpf_inf_neg, tc)
   {
  +#ifndef __vax__
  const float x = -1.0L / 0.0L;
  size_t i;
   
  for (i = 0; i  __arraycount(exps); i++)
  ATF_CHECK(ldexpf(x, exps[i]) == x);
  +#endif
   }
   
   ATF_TC(ldexpf_inf_pos);
  @@ -180,11 +194,13 @@
   
   ATF_TC_BODY(ldexpf_inf_pos, tc)
   {
  +#ifndef __vax__
  const float x = 1.0L / 0.0L;
  size_t i;
   
  for (i = 0; i  __arraycount(exps); i++)
  ATF_CHECK(ldexpf(x, exps[i]) == x);
  +#endif
   }
   
   ATF_TC(ldexpf_zero_neg);
  @@ -195,6 +211,7 @@
   
   ATF_TC_BODY(ldexpf_zero_neg, tc)
   {
  +#ifndef __vax__
  const float x = -0.0L;
  float y;
  size_t i;
  @@ -206,6 +223,7 @@
  ATF_CHECK(x == y);
  ATF_CHECK(signbit(y) != 0);
  }
  +#endif
   }
   
   ATF_TC(ldexpf_zero_pos);
  @@ -216,6 +234,7 @@
   
   ATF_TC_BODY(ldexpf_zero_pos, tc)
   {
  +#ifndef __vax__
  const float x = 0.0L;
  float y;
  size_t i;
  @@ -227,6 +246,7 @@
  ATF_CHECK(x == y);
  ATF_CHECK(signbit(y) == 0);
  }
  +#endif
   }
   
   ATF_TP_ADD_TCS(tp)
  Index: src/tests/lib/libm/t_scalbn.c
  diff -u src/tests/lib/libm/t_scalbn.c:1.2 src/tests/lib/libm/t_scalbn.c:1.3
  --- src/tests/lib/libm/t_scalbn.c:1.2   Mon Sep 12 15:47:14 2011
  +++ src/tests/lib/libm/t_scalbn.c   Mon Sep 12 16:28:37 2011
  @@ -1,4 +1,4 @@
  -/* $NetBSD: t_scalbn.c,v 1.2 2011/09/12 15:47:14 jruoho Exp $ */
  +/* $NetBSD: 

Re: CVS commit: src/tests/lib/libm

2011-09-13 Thread Jukka Ruohonen
On Tue, Sep 13, 2011 at 06:50:41AM +, Jukka Ruohonen wrote:
 Module Name:  src
 Committed By: jruoho
 Date: Tue Sep 13 06:50:41 UTC 2011
 
 Modified Files:
   src/tests/lib/libm: t_scalbn.c
 
 Log Message:
 Test that scalbn(x) == ldexp(2) whenever FLT_RADIX == 2 (like it should be
 on all systems except exotic relics such as IBM 360).

Ehm. scalbn(x) == ldexp(x) obviously.

- Jukka.


Re: CVS commit: src/tests/lib/libm

2011-09-13 Thread Martin Husemann
On Tue, Sep 13, 2011 at 09:48:37AM +0300, Jukka Ruohonen wrote:
 You are right. I didn't bother to do atf_tc_skip() for the special case of
 VAX. If any of the VAX people want to run the tests, please feel free to fix.

Unfortunately this would require (definitively non trivial) gcc fixes first.

Martin