Mercurial > ecos
comparison packages/language/c/libm/current/tests/vectors/log.c @ 0:3111d98ba7b3 ecos-v1_1-release
Initial commit of eCos version 1.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 11:16:07 +0000 |
| parents | |
| children | 443894e2e912 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:3111d98ba7b3 |
|---|---|
| 1 //=========================================================================== | |
| 2 // | |
| 3 // log.c | |
| 4 // | |
| 5 // Test of log() 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 | |
| 25 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. | |
| 26 // ------------------------------------------- | |
| 27 // | |
| 28 //####COPYRIGHTEND#### | |
| 29 //=========================================================================== | |
| 30 //#####DESCRIPTIONBEGIN#### | |
| 31 // | |
| 32 // Author(s): jlarmour@cygnus.co.uk | |
| 33 // Contributors: jlarmour@cygnus.co.uk | |
| 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/log.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(log_vec) / sizeof(Cyg_libm_test_double_vec_t); | |
| 72 ret = doTestVec( (CYG_ADDRWORD) &log, CYG_LIBM_TEST_VEC_DOUBLE, | |
| 73 CYG_LIBM_TEST_VEC_NONE, CYG_LIBM_TEST_VEC_DOUBLE, | |
| 74 &log_vec[0], vec_size ); | |
| 75 | |
| 76 if (ret==true) | |
| 77 { | |
| 78 CYG_TEST_PASS("log() is stable"); | |
| 79 } // if | |
| 80 else | |
| 81 { | |
| 82 CYG_TEST_FAIL("log() failed tests"); | |
| 83 } // else | |
| 84 | |
| 85 CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for Math " | |
| 86 "library log() 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 "log() 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 log.c |
