|
0
|
1 //=========================================================================== |
|
|
2 // |
|
|
3 // modf.c |
|
|
4 // |
|
|
5 // Test of modf() math library function |
|
|
6 // |
|
|
7 //=========================================================================== |
|
|
8 //####COPYRIGHTBEGIN#### |
|
|
9 // |
|
|
10 // ------------------------------------------- |
|
|
11 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
12 // Version 1.0 (the "License"); you may not use this file except in |
|
|
13 // compliance with the License. You may obtain a copy of the License at |
|
|
14 // http://sourceware.cygnus.com/ecos |
|
|
15 // |
|
|
16 // Software distributed under the License is distributed on an "AS IS" |
|
|
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
18 // License for the specific language governing rights and limitations under |
|
|
19 // the License. |
|
|
20 // |
|
|
21 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
22 // September 30, 1998. |
|
|
23 // |
|
|
24 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
26 // ------------------------------------------- |
|
|
27 // |
|
|
28 //####COPYRIGHTEND#### |
|
|
29 //=========================================================================== |
|
|
30 //#####DESCRIPTIONBEGIN#### |
|
|
31 // |
|
2
|
32 // Author(s): jlarmour |
|
|
33 // Contributors: jlarmour |
|
0
|
34 // Date: 1998-02-13 |
|
|
35 // Purpose: |
|
|
36 // Description: |
|
|
37 // Usage: |
|
|
38 // |
|
|
39 //####DESCRIPTIONEND#### |
|
|
40 // |
|
|
41 //=========================================================================== |
|
|
42 |
|
|
43 // Declarations for test system: |
|
|
44 // |
|
|
45 // TESTCASE_TYPE=CYG_TEST_MODULE |
|
|
46 |
|
|
47 |
|
|
48 // CONFIGURATION |
|
|
49 |
|
|
50 #include <pkgconf/libm.h> // Configuration header |
|
|
51 |
|
|
52 |
|
|
53 // INCLUDES |
|
|
54 |
|
|
55 #include <cyg/infra/cyg_type.h> // Common type definitions and support |
|
|
56 #include <cyg/infra/testcase.h> // Test infrastructure |
|
|
57 #include <math.h> // Header for this package |
|
|
58 #include <sys/ieeefp.h> // Cyg_libm_ieee_double_shape_type |
|
|
59 #include "vectors/vector_support.h"// extra support for math tests |
|
|
60 |
|
|
61 #include "vectors/modf.h" |
|
|
62 |
|
|
63 // FUNCTIONS |
|
|
64 |
|
|
65 static void |
|
|
66 test( CYG_ADDRWORD data ) |
|
|
67 { |
|
|
68 cyg_ucount32 vec_size; |
|
|
69 cyg_bool ret; |
|
|
70 |
|
|
71 vec_size = sizeof(modf_vec) / sizeof(Cyg_libm_test_double_vec_t); |
|
|
72 ret = doTestVec( (CYG_ADDRWORD) &modf, CYG_LIBM_TEST_VEC_DOUBLE, |
|
|
73 CYG_LIBM_TEST_VEC_DOUBLE_P, CYG_LIBM_TEST_VEC_DOUBLE, |
|
|
74 &modf_vec[0], vec_size ); |
|
|
75 |
|
|
76 if (ret==true) |
|
|
77 { |
|
|
78 CYG_TEST_PASS("modf() is stable"); |
|
|
79 } // if |
|
|
80 else |
|
|
81 { |
|
|
82 CYG_TEST_FAIL("modf() failed tests"); |
|
|
83 } // else |
|
|
84 |
|
|
85 CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " |
|
|
86 "library modf() function"); |
|
|
87 } // test() |
|
|
88 |
|
|
89 |
|
|
90 int |
|
|
91 main(int argc, char *argv[]) |
|
|
92 { |
|
|
93 CYG_TEST_INIT(); |
|
|
94 |
|
|
95 CYG_TEST_INFO("Starting tests from testcase " __FILE__ " for Math library " |
|
|
96 "modf() function"); |
|
|
97 |
|
|
98 START_TEST( test ); |
|
|
99 |
|
|
100 CYG_TEST_PASS_FINISH("Testing is not applicable to this configuration"); |
|
|
101 |
|
|
102 } // main() |
|
|
103 |
|
|
104 |
|
|
105 // EOF modf.c |