From a5c0886a6d3161ce6a8fd7b4e2cc402336670a4d Mon Sep 17 00:00:00 2001 From: Jacob Shin Date: Sat, 8 Dec 2018 13:49:20 -0500 Subject: psxhdrs: Add POSIX API Signature Compliance Tests for stdlib.h (GCI 2018) --- testsuites/psxtests/psxhdrs/stdlib/_Exit.c | 33 ++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/a64l.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/abort.c | 33 ++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/abs.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/atexit.c | 42 +++++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/atof.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/atoi.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/atol.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/atoll.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/bsearch.c | 44 ++++++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/calloc.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/div.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/drand48.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/erand48.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/exit.c | 33 ++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/free.c | 35 +++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/getenv.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/getsubopt.c | 39 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/grantpt.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/initstate.c | 39 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/jrand48.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/l64a.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/labs.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/lcong48.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/ldiv.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/llabs.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/lldiv.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/lrand48.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/malloc.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/mblen.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/mbstowcs.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/mbtowc.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/mkdtemp.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/mkstemp.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/mrand48.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/nrand48.c | 37 ++++++++++++++++++ .../psxtests/psxhdrs/stdlib/posix_memalign.c | 39 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/posix_openpt.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/ptsname.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/putenv.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/qsort.c | 44 ++++++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/rand.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/rand_r.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/random.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/realloc.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/realpath.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/seed48.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/setenv.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/setkey.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/setstate.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/srand.c | 35 +++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/srand48.c | 34 +++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/srandom.c | 35 +++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/strtod.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/strtof.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/strtol.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/strtold.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/strtoll.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/strtoul.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/strtoull.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/system.c | 37 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/unlockpt.c | 38 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/unsetenv.c | 36 ++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/wcstombs.c | 39 +++++++++++++++++++ testsuites/psxtests/psxhdrs/stdlib/wctomb.c | 38 +++++++++++++++++++ 65 files changed, 2398 insertions(+) create mode 100755 testsuites/psxtests/psxhdrs/stdlib/_Exit.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/a64l.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/abort.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/abs.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/atexit.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/atof.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/atoi.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/atol.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/atoll.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/bsearch.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/calloc.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/div.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/drand48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/erand48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/exit.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/free.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/getenv.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/getsubopt.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/grantpt.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/initstate.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/jrand48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/l64a.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/labs.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/lcong48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/ldiv.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/llabs.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/lldiv.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/lrand48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/malloc.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/mblen.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/mbstowcs.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/mbtowc.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/mkdtemp.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/mkstemp.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/mrand48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/nrand48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/posix_memalign.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/posix_openpt.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/ptsname.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/putenv.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/qsort.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/rand.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/rand_r.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/random.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/realloc.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/realpath.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/seed48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/setenv.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/setkey.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/setstate.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/srand.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/srand48.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/srandom.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/strtod.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/strtof.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/strtol.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/strtold.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/strtoll.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/strtoul.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/strtoull.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/system.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/unlockpt.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/unsetenv.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/wcstombs.c create mode 100755 testsuites/psxtests/psxhdrs/stdlib/wctomb.c (limited to 'testsuites/psxtests/psxhdrs') diff --git a/testsuites/psxtests/psxhdrs/stdlib/_Exit.c b/testsuites/psxtests/psxhdrs/stdlib/_Exit.c new file mode 100755 index 0000000000..ffcc7700b5 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/_Exit.c @@ -0,0 +1,33 @@ +/** + * @file + * @brief _Exit() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + _Exit(1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/a64l.c b/testsuites/psxtests/psxhdrs/stdlib/a64l.c new file mode 100755 index 0000000000..dec332a04d --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/a64l.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief a64l() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + + return_value = a64l("/"); + return (return_value == 1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/abort.c b/testsuites/psxtests/psxhdrs/stdlib/abort.c new file mode 100755 index 0000000000..c74b197d60 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/abort.c @@ -0,0 +1,33 @@ +/** + * @file + * @brief abort() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + abort(); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/abs.c b/testsuites/psxtests/psxhdrs/stdlib/abs.c new file mode 100755 index 0000000000..509c048d01 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/abs.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief abs() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = abs(1); + return (return_value == 1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/atexit.c b/testsuites/psxtests/psxhdrs/stdlib/atexit.c new file mode 100755 index 0000000000..dfe7382b45 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/atexit.c @@ -0,0 +1,42 @@ +/** + * @file + * @brief atexit() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); +void func( void ); + +int test( void ) +{ + int return_value; + + return_value = atexit(func); + return (return_value == 0); +} + +void func( void ) +{ + return; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/atof.c b/testsuites/psxtests/psxhdrs/stdlib/atof.c new file mode 100755 index 0000000000..c943dee564 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/atof.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief atof() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +int test( void ); + +int test( void ) +{ + double return_value; + double pi = 3.14; + + return_value = atof("3.14"); + return (fabs(return_value-pi) < 0.00001); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/atoi.c b/testsuites/psxtests/psxhdrs/stdlib/atoi.c new file mode 100755 index 0000000000..14fa8db74f --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/atoi.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief atoi() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = atoi("1"); + return (return_value == 1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/atol.c b/testsuites/psxtests/psxhdrs/stdlib/atol.c new file mode 100755 index 0000000000..888510abce --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/atol.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief atol() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = atol("1"); + return (return_value == 1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/atoll.c b/testsuites/psxtests/psxhdrs/stdlib/atoll.c new file mode 100755 index 0000000000..6e032a7873 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/atoll.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief atoll() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = atoll("1"); + return (return_value == 1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/bsearch.c b/testsuites/psxtests/psxhdrs/stdlib/bsearch.c new file mode 100755 index 0000000000..d577449ae4 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/bsearch.c @@ -0,0 +1,44 @@ +/** + * @file + * @brief bsearch() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); +int func(void *, void *); + +int test( void ) +{ + int *return_value; + int key = 3; + int arr[3] = {1, 2, 3}; + + return_value = bsearch(&key, &arr, 3, 4, (void *)func); + return (return_value != NULL); +} + +int func(void *int1, void *int2) +{ + return (*(int *)int1 == *(int *)int2); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/calloc.c b/testsuites/psxtests/psxhdrs/stdlib/calloc.c new file mode 100755 index 0000000000..c8d8a0baec --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/calloc.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief calloc() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + void *return_value; + + return_value = calloc(1, sizeof(int)); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/div.c b/testsuites/psxtests/psxhdrs/stdlib/div.c new file mode 100755 index 0000000000..83def97c0d --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/div.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief div() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + div_t return_value; + + return_value = div(2, 1); + return (return_value.quot == 2 && return_value.rem == 0); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/drand48.c b/testsuites/psxtests/psxhdrs/stdlib/drand48.c new file mode 100755 index 0000000000..2b5ac61419 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/drand48.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief drand48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + double return_value; + + return_value = drand48(); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/erand48.c b/testsuites/psxtests/psxhdrs/stdlib/erand48.c new file mode 100755 index 0000000000..e55f8680d8 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/erand48.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief erand48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + unsigned short int x16v[3]; + + return_value = erand48(x16v); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/exit.c b/testsuites/psxtests/psxhdrs/stdlib/exit.c new file mode 100755 index 0000000000..af16b9415b --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/exit.c @@ -0,0 +1,33 @@ +/** + * @file + * @brief exit() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + exit(1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/free.c b/testsuites/psxtests/psxhdrs/stdlib/free.c new file mode 100755 index 0000000000..016b2a5667 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/free.c @@ -0,0 +1,35 @@ +/** + * @file + * @brief free() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int *ptr = malloc(1 * sizeof(int)); + free(ptr); + return 1; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/getenv.c b/testsuites/psxtests/psxhdrs/stdlib/getenv.c new file mode 100755 index 0000000000..1aa8da6077 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/getenv.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief getenv() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + + return_value = getenv("PATH"); + return(return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/getsubopt.c b/testsuites/psxtests/psxhdrs/stdlib/getsubopt.c new file mode 100755 index 0000000000..cce224ecf9 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/getsubopt.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief getsubopt() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _XOPEN_SOURCE 500 +#include + +int test( void ); + +int test( void ) +{ + int return_value; + char *optionp = "test"; + char *const tokens[] = {"token", NULL}; + char *valuep; + return_value = getsubopt(&optionp, tokens, &valuep); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/grantpt.c b/testsuites/psxtests/psxhdrs/stdlib/grantpt.c new file mode 100755 index 0000000000..45dd246934 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/grantpt.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief grantpt() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _XOPEN_SOURCE 500 +#include + +int test( void ); + +int test( void ) +{ + int return_value; + int fildes = 1; + + return_value = grantpt(fildes); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/initstate.c b/testsuites/psxtests/psxhdrs/stdlib/initstate.c new file mode 100755 index 0000000000..5d7202debc --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/initstate.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief initstate() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + unsigned seed = 1; + char state[] = {1, 2, 3, 4, 5, 6, 7, 8}; + size_t size = 8; + + return_value = initstate(seed, state, size); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/jrand48.c b/testsuites/psxtests/psxhdrs/stdlib/jrand48.c new file mode 100755 index 0000000000..c8c5ae9055 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/jrand48.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief jrand48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + unsigned short xsubi[3]; + + return_value = jrand48(xsubi); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/l64a.c b/testsuites/psxtests/psxhdrs/stdlib/l64a.c new file mode 100755 index 0000000000..39e7a24805 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/l64a.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief l64a() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + long value = 1; + + return_value = l64a(value); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/labs.c b/testsuites/psxtests/psxhdrs/stdlib/labs.c new file mode 100755 index 0000000000..938edf70b1 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/labs.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief labs() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + + return_value = labs(1); + return (return_value == 1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/lcong48.c b/testsuites/psxtests/psxhdrs/stdlib/lcong48.c new file mode 100755 index 0000000000..0ab7cea598 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/lcong48.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief lcong48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + unsigned short param[7] = {1, 2, 3, 4, 5, 6, 7}; + + lcong48(param); + return 1; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/ldiv.c b/testsuites/psxtests/psxhdrs/stdlib/ldiv.c new file mode 100755 index 0000000000..9868e7d4ba --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/ldiv.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief ldiv() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + ldiv_t return_value; + + return_value = ldiv(3, 4); + return (return_value.quot == 0 && return_value.rem == 3); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/llabs.c b/testsuites/psxtests/psxhdrs/stdlib/llabs.c new file mode 100755 index 0000000000..0bbaa627e7 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/llabs.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief llabs() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + + return_value = llabs(1); + return (return_value == 1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/lldiv.c b/testsuites/psxtests/psxhdrs/stdlib/lldiv.c new file mode 100755 index 0000000000..0f514f1737 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/lldiv.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief lldiv() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + lldiv_t return_value; + + return_value = lldiv(3, 4); + return (return_value.quot == 0 && return_value.rem == 3); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/lrand48.c b/testsuites/psxtests/psxhdrs/stdlib/lrand48.c new file mode 100755 index 0000000000..c185f744db --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/lrand48.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief lrand48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + + return_value = lrand48(); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/malloc.c b/testsuites/psxtests/psxhdrs/stdlib/malloc.c new file mode 100755 index 0000000000..cfdb1a7d20 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/malloc.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief malloc() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + + return_value = malloc(1*sizeof(char)); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/mblen.c b/testsuites/psxtests/psxhdrs/stdlib/mblen.c new file mode 100755 index 0000000000..b38d1eb3eb --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/mblen.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief mblen() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = mblen("c", 1); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/mbstowcs.c b/testsuites/psxtests/psxhdrs/stdlib/mbstowcs.c new file mode 100755 index 0000000000..2577631874 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/mbstowcs.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief mbstowcs() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + size_t return_value; + wchar_t *pwcs = malloc(7 * sizeof(wchar_t)); + + return_value = mbstowcs(pwcs, "string", 6); + return (return_value != (size_t)-1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/mbtowc.c b/testsuites/psxtests/psxhdrs/stdlib/mbtowc.c new file mode 100755 index 0000000000..5d7def80a3 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/mbtowc.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief mbtowc() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + wchar_t *pwc = malloc(sizeof(wchar_t) * 7); + + return_value = mbtowc(pwc, "string", 6); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/mkdtemp.c b/testsuites/psxtests/psxhdrs/stdlib/mkdtemp.c new file mode 100755 index 0000000000..f5550551b8 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/mkdtemp.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief mkdtemp() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + + return_value = mkdtemp("directoryxxxxxx"); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/mkstemp.c b/testsuites/psxtests/psxhdrs/stdlib/mkstemp.c new file mode 100755 index 0000000000..e35eeef82e --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/mkstemp.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief mkstemp() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = mkstemp("directoryxxxxxx"); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/mrand48.c b/testsuites/psxtests/psxhdrs/stdlib/mrand48.c new file mode 100755 index 0000000000..fe3852604a --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/mrand48.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief mrand48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + + return_value = mrand48(); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/nrand48.c b/testsuites/psxtests/psxhdrs/stdlib/nrand48.c new file mode 100755 index 0000000000..86a1eab345 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/nrand48.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief nrand48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + unsigned short xsubi[3]; + + return_value = nrand48(xsubi); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/posix_memalign.c b/testsuites/psxtests/psxhdrs/stdlib/posix_memalign.c new file mode 100755 index 0000000000..b28fbf0ea7 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/posix_memalign.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief posix_memalign() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + void *memptr = NULL; + size_t alignment = 1; + size_t size = 4; + + return_value = posix_memalign(&memptr, alignment, size); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/posix_openpt.c b/testsuites/psxtests/psxhdrs/stdlib/posix_openpt.c new file mode 100755 index 0000000000..a1b519f38a --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/posix_openpt.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief posix_openpt() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _XOPEN_SOURCE 600 +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = posix_openpt(1); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/ptsname.c b/testsuites/psxtests/psxhdrs/stdlib/ptsname.c new file mode 100755 index 0000000000..3d03272555 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/ptsname.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief ptsname() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _XOPEN_SOURCE 500 +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + + return_value = (char *)ptsname(1); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/putenv.c b/testsuites/psxtests/psxhdrs/stdlib/putenv.c new file mode 100755 index 0000000000..3ffdfa7e93 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/putenv.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief putenv() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = putenv("GCI=2018"); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/qsort.c b/testsuites/psxtests/psxhdrs/stdlib/qsort.c new file mode 100755 index 0000000000..85d8731120 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/qsort.c @@ -0,0 +1,44 @@ +/** + * @file + * @brief qsort() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); +int compar(const void *, const void *); + +int test( void ) +{ + int base[] = {1, 2}; + size_t nel = 2; + size_t width = sizeof(int); + + qsort(base, nel, width, compar); + return 1; +} + +int compar(const void *i, const void *j) +{ + return (*(int *)i > *(int *)j); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/rand.c b/testsuites/psxtests/psxhdrs/stdlib/rand.c new file mode 100755 index 0000000000..2348822d04 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/rand.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief rand() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = rand(); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/rand_r.c b/testsuites/psxtests/psxhdrs/stdlib/rand_r.c new file mode 100755 index 0000000000..0c34b21a55 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/rand_r.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief rand_r() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + unsigned seed[] = {12}; + + return_value = rand_r(seed); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/random.c b/testsuites/psxtests/psxhdrs/stdlib/random.c new file mode 100755 index 0000000000..83cfb83210 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/random.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief random() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + + return_value = random(); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/realloc.c b/testsuites/psxtests/psxhdrs/stdlib/realloc.c new file mode 100755 index 0000000000..2ac3669d68 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/realloc.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief realloc() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + char *ptr = malloc(1 * sizeof(char) * 1); + + return_value = realloc(ptr, sizeof(char) * 2); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/realpath.c b/testsuites/psxtests/psxhdrs/stdlib/realpath.c new file mode 100755 index 0000000000..07c34552c4 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/realpath.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief realpath() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + char *file_name = "/"; + char *resolved_name = NULL; + + return_value = realpath(file_name, resolved_name); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/seed48.c b/testsuites/psxtests/psxhdrs/stdlib/seed48.c new file mode 100755 index 0000000000..ad7ba20c02 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/seed48.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief seed48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + unsigned short *return_value; + unsigned short seed16v[3]; + + return_value = seed48(seed16v); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/setenv.c b/testsuites/psxtests/psxhdrs/stdlib/setenv.c new file mode 100755 index 0000000000..8f448bdf58 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/setenv.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief setenv() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = setenv("PATH", "/usr/bin", 0); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/setkey.c b/testsuites/psxtests/psxhdrs/stdlib/setkey.c new file mode 100755 index 0000000000..f54c3d185b --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/setkey.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief setkey() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _XOPEN_SOURCE +#include + +int test( void ); + +int main( void ) +{ + char array[] = {0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0 , 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}; + + setkey(array); + return 1; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/setstate.c b/testsuites/psxtests/psxhdrs/stdlib/setstate.c new file mode 100755 index 0000000000..f19d601b00 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/setstate.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief setstate() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + char *return_value; + char state[] = {1}; + + return_value = setstate(state); + return (return_value != NULL); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/srand.c b/testsuites/psxtests/psxhdrs/stdlib/srand.c new file mode 100755 index 0000000000..314f65e06c --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/srand.c @@ -0,0 +1,35 @@ +/** + * @file + * @brief srand() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + unsigned seed = 1; + srand(seed); + return 1; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/srand48.c b/testsuites/psxtests/psxhdrs/stdlib/srand48.c new file mode 100755 index 0000000000..07df37bda0 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/srand48.c @@ -0,0 +1,34 @@ +/** + * @file + * @brief srand48() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + srand48(1); + return 1; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/srandom.c b/testsuites/psxtests/psxhdrs/stdlib/srandom.c new file mode 100755 index 0000000000..c632569a60 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/srandom.c @@ -0,0 +1,35 @@ +/** + * @file + * @brief srandom() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + unsigned seed = 1; + srandom(seed); + return 1; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/strtod.c b/testsuites/psxtests/psxhdrs/stdlib/strtod.c new file mode 100755 index 0000000000..ff571cfa38 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/strtod.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strtod() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + double return_value; + char *nptr = "3.14"; + char *endptr; + + return_value = strtod(nptr, &endptr); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/strtof.c b/testsuites/psxtests/psxhdrs/stdlib/strtof.c new file mode 100755 index 0000000000..cfab208798 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/strtof.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strtof() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + float return_value; + char *nptr = "3.14"; + char *endptr; + + return_value = strtof(nptr, &endptr); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/strtol.c b/testsuites/psxtests/psxhdrs/stdlib/strtol.c new file mode 100755 index 0000000000..882dc2ecf9 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/strtol.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strtol() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long return_value; + char *nptr = "3.14"; + char *endptr; + + return_value = strtol(nptr, &endptr, 10); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/strtold.c b/testsuites/psxtests/psxhdrs/stdlib/strtold.c new file mode 100755 index 0000000000..7c271de9d6 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/strtold.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strtold() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long double return_value; + char *nptr = "3.14"; + char *enptr; + + return_value = strtold(nptr, &enptr); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/strtoll.c b/testsuites/psxtests/psxhdrs/stdlib/strtoll.c new file mode 100755 index 0000000000..46d8b09165 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/strtoll.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strtoll() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + long long return_value; + char *nptr = "3.14"; + char *endptr; + + return_value = strtoll(nptr, &endptr, 10); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/strtoul.c b/testsuites/psxtests/psxhdrs/stdlib/strtoul.c new file mode 100755 index 0000000000..2b717a2d0d --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/strtoul.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strtoul() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + unsigned long return_value; + char *nptr = "3.14"; + char *endptr; + + return_value = strtoul(nptr, &endptr, 10); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/strtoull.c b/testsuites/psxtests/psxhdrs/stdlib/strtoull.c new file mode 100755 index 0000000000..101724addd --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/strtoull.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strtoull() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + unsigned long long return_value; + char *nptr = "3.14"; + char *endptr; + + return_value = strtoull(nptr, &endptr, 10); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/system.c b/testsuites/psxtests/psxhdrs/stdlib/system.c new file mode 100755 index 0000000000..7f626a5b6c --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/system.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief system() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + char *cmd = "ls"; + + return_value = system(cmd); + return return_value; +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/unlockpt.c b/testsuites/psxtests/psxhdrs/stdlib/unlockpt.c new file mode 100755 index 0000000000..a16a02894a --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/unlockpt.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief unlockpt() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _XOPEN_SOURCE 500 +#include + +int test( void ); + +int test( void ) +{ + int return_value; + int fd = 1; + + return_value = unlockpt(fd); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/unsetenv.c b/testsuites/psxtests/psxhdrs/stdlib/unsetenv.c new file mode 100755 index 0000000000..db69cfe94f --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/unsetenv.c @@ -0,0 +1,36 @@ +/** + * @file + * @brief unsetenv() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + + return_value = unsetenv("GCI"); + return (return_value != -1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/wcstombs.c b/testsuites/psxtests/psxhdrs/stdlib/wcstombs.c new file mode 100755 index 0000000000..51081ad042 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/wcstombs.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief wcstombs() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + size_t return_value; + char s[5]; + wchar_t *pwcs = L"test"; + size_t n = 5; + + return_value = wcstombs(s, pwcs, n); + return (return_value != (size_t)-1); +} \ No newline at end of file diff --git a/testsuites/psxtests/psxhdrs/stdlib/wctomb.c b/testsuites/psxtests/psxhdrs/stdlib/wctomb.c new file mode 100755 index 0000000000..2029486c25 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/stdlib/wctomb.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief wctomb() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Jacob Shin + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int test( void ); + +int test( void ) +{ + int return_value; + char s[1]; + wchar_t wchar = L'c'; + + return_value = wctomb(s, wchar); + return (return_value != -1); +} \ No newline at end of file -- cgit v1.2.3