annotate tests/test-hypotf.c @ 17593:d1e383af69e2

manywarnings: remove -Wmudflap * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Remove -Wmudflap, since it is no longer supported in gcc-4.9-to-be.
author Jim Meyering <meyering@fb.com>
date Thu, 02 Jan 2014 16:55:04 -0800
parents 344018b6e5d7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16515
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of hypotf() function.
17587
344018b6e5d7 maint: update copyright
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
2 Copyright (C) 2010-2014 Free Software Foundation, Inc.
16515
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2010. */
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <math.h>
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include "signature.h"
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 SIGNATURE_CHECK (hypotf, float, (float, float));
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <float.h>
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include "macros.h"
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
16574
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
30 #undef MIN
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
31 #undef MAX
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
32
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
33 #define DOUBLE float
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
34 #define HUGEVAL HUGE_VALF
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
35 #define L_(literal) literal##f
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
36 #define MANT_DIG FLT_MANT_DIG
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
37 #define MIN FLT_MIN
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
38 #define MAX FLT_MAX
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
39 #define HYPOT hypotf
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
40 #define RANDOM randomf
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
41 #include "test-hypot.h"
16515
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 int
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 main ()
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 {
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 /* A particular value. */
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 x = 0.4f;
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 y = 0.6f;
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 z = hypot (x, y);
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 ASSERT (z >= 0.7211102f && z <= 0.7211103f);
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51
16574
4acf461e0a81 hypot* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16515
diff changeset
52 test_function ();
16515
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 return 0;
026ce065f317 Tests for module 'hypotf'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 }