gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / tests / test-fabsf.c
index b78b801..e9b7ccd 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fabsf() function.
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 2010-2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -28,9 +28,12 @@ SIGNATURE_CHECK (fabsf, float, (float));
 #include "macros.h"
 #include "minus-zero.h"
 
-volatile float x;
-float y;
-float zero = 0.0f;
+#define DOUBLE float
+#define L_(literal) literal##f
+#define MINUS_ZERO minus_zerof
+#define FABS fabsf
+#define RANDOM randomf
+#include "test-fabs.h"
 
 int
 main ()
@@ -45,16 +48,7 @@ main ()
   y = fabsf (x);
   ASSERT (y == 0.6f);
 
-  /* Signed zero.  */
-  x = 0.0f;
-  y = fabsf (x);
-  ASSERT (y == 0.0f);
-  ASSERT (memcmp (&y, &zero, sizeof y) == 0);
-
-  x = minus_zerof;
-  y = fabsf (x);
-  ASSERT (y == 0.0f);
-  ASSERT (memcmp (&y, &zero, sizeof y) == 0);
+  test_function ();
 
   return 0;
 }