test_cstdlib.cpp revision b381ead492251a797d2df4b260cb01eb1f64cfad
1/* 2 * Copyright (C) 2009 The Android Open Source Project 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in 12 * the documentation and/or other materials provided with the 13 * distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <cstdlib> 30#if defined BIONIC && !defined BIONIC_LIBSTDCPP_INCLUDE_CSTDLIB__ 31#error "Wrong header file included!!" 32#endif 33 34 35namespace { 36const int kPassed = 0; 37const int kFailed = 1; 38#define FAIL_UNLESS(f) if (!android::f()) return kFailed; 39} // anonymous namespace 40 41namespace android 42{ 43using ::exit; 44using ::abort; 45using ::atexit; 46using ::on_exit; 47 48using ::getenv; 49using ::putenv; 50using ::setenv; 51using ::unsetenv; 52using ::clearenv; 53 54using ::mktemp; 55using ::mkstemp; 56 57using ::strtol; 58using ::strtoll; 59using ::strtoul; 60using ::strtoull; 61using ::strtod; 62using ::strtof; 63 64using ::atoi; 65using ::atol; 66using ::atoll; 67using ::atof; 68 69using ::abs; 70using ::labs; 71using ::llabs; 72 73using ::realpath; 74using ::system; 75 76using ::bsearch; 77using ::qsort; 78 79using ::jrand48; 80using ::mrand48; 81using ::nrand48; 82using ::lrand48; 83using ::seed48; 84using ::srand48; 85 86using ::rand; 87using ::srand; 88using ::random; 89using ::srandom; 90 91using ::malloc; 92using ::free; 93using ::calloc; 94using ::realloc; 95 96using ::unlockpt; 97using ::ptsname; 98using ::ptsname_r; 99using ::getpt; 100using ::grantpt; 101 102using ::div_t; 103using ::div; 104using ::ldiv_t; 105using ::ldiv; 106using ::lldiv_t; 107using ::lldiv; 108 109using ::mblen; 110using ::mbstowcs; 111using ::mbtowc; 112using ::wctomb; 113using ::wcstombs; 114} // namespace android 115 116int main(int argc, char **argv) 117{ 118 // FAIL_UNLESS(testTypesStd); 119 return kPassed; 120} 121