From b24c098cc835b232cb7ffe7e248564614d4f6773 Mon Sep 17 00:00:00 2001 From: Himanshu40 Date: Thu, 6 Dec 2018 13:06:29 -0600 Subject: psxhdrs: Add POSIX API Signature Compliance Tests for string.h (GCI 2018) --- testsuites/psxtests/psxhdrs/string/memccpy.c | 41 +++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/memchr.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/memcmp.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/memcpy.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/memmove.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/memset.c | 41 +++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/stpcpy.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/stpncpy.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strcat.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strchr.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strcmp.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strcoll.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strcoll_l.c | 41 +++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strcpy.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strcspn.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strdup.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strerror.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strerror_l.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strerror_r.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strlen.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strncat.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strncmp.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strncpy.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strndup.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strnlen.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strpbrk.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strrchr.c | 38 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strsignal.c | 37 ++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strspn.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strstr.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strtok.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strtok_r.c | 40 ++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strxfrm.c | 39 +++++++++++++++++++++++ testsuites/psxtests/psxhdrs/string/strxfrm_l.c | 41 +++++++++++++++++++++++++ 34 files changed, 1332 insertions(+) create mode 100644 testsuites/psxtests/psxhdrs/string/memccpy.c create mode 100644 testsuites/psxtests/psxhdrs/string/memchr.c create mode 100644 testsuites/psxtests/psxhdrs/string/memcmp.c create mode 100644 testsuites/psxtests/psxhdrs/string/memcpy.c create mode 100644 testsuites/psxtests/psxhdrs/string/memmove.c create mode 100644 testsuites/psxtests/psxhdrs/string/memset.c create mode 100644 testsuites/psxtests/psxhdrs/string/stpcpy.c create mode 100644 testsuites/psxtests/psxhdrs/string/stpncpy.c create mode 100644 testsuites/psxtests/psxhdrs/string/strcat.c create mode 100644 testsuites/psxtests/psxhdrs/string/strchr.c create mode 100644 testsuites/psxtests/psxhdrs/string/strcmp.c create mode 100644 testsuites/psxtests/psxhdrs/string/strcoll.c create mode 100644 testsuites/psxtests/psxhdrs/string/strcoll_l.c create mode 100644 testsuites/psxtests/psxhdrs/string/strcpy.c create mode 100644 testsuites/psxtests/psxhdrs/string/strcspn.c create mode 100644 testsuites/psxtests/psxhdrs/string/strdup.c create mode 100644 testsuites/psxtests/psxhdrs/string/strerror.c create mode 100644 testsuites/psxtests/psxhdrs/string/strerror_l.c create mode 100644 testsuites/psxtests/psxhdrs/string/strerror_r.c create mode 100644 testsuites/psxtests/psxhdrs/string/strlen.c create mode 100644 testsuites/psxtests/psxhdrs/string/strncat.c create mode 100644 testsuites/psxtests/psxhdrs/string/strncmp.c create mode 100644 testsuites/psxtests/psxhdrs/string/strncpy.c create mode 100644 testsuites/psxtests/psxhdrs/string/strndup.c create mode 100644 testsuites/psxtests/psxhdrs/string/strnlen.c create mode 100644 testsuites/psxtests/psxhdrs/string/strpbrk.c create mode 100644 testsuites/psxtests/psxhdrs/string/strrchr.c create mode 100644 testsuites/psxtests/psxhdrs/string/strsignal.c create mode 100644 testsuites/psxtests/psxhdrs/string/strspn.c create mode 100644 testsuites/psxtests/psxhdrs/string/strstr.c create mode 100644 testsuites/psxtests/psxhdrs/string/strtok.c create mode 100644 testsuites/psxtests/psxhdrs/string/strtok_r.c create mode 100644 testsuites/psxtests/psxhdrs/string/strxfrm.c create mode 100644 testsuites/psxtests/psxhdrs/string/strxfrm_l.c (limited to 'testsuites/psxtests/psxhdrs') diff --git a/testsuites/psxtests/psxhdrs/string/memccpy.c b/testsuites/psxtests/psxhdrs/string/memccpy.c new file mode 100644 index 0000000000..1f93c52240 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/memccpy.c @@ -0,0 +1,41 @@ +/** + * @file + * @brief memccpy() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *s1 = NULL; + void *s2 = NULL; + int c = 2; + size_t n = 2; + void *result; + + result = memccpy( s1, s2, c, n ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/memchr.c b/testsuites/psxtests/psxhdrs/string/memchr.c new file mode 100644 index 0000000000..8a67161f07 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/memchr.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief memchr() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *s = "Example string"; + int c = 2; + size_t n = 2; + void *result; + + result = memchr( s, c, n ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/memcmp.c b/testsuites/psxtests/psxhdrs/string/memcmp.c new file mode 100644 index 0000000000..1895d3568d --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/memcmp.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief memcmp() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *ptr1 = NULL; + void *ptr2 = NULL; + size_t num = 2; + int result; + + result = memcmp( ptr1, ptr2, num ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/memcpy.c b/testsuites/psxtests/psxhdrs/string/memcpy.c new file mode 100644 index 0000000000..a0afb6e0f4 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/memcpy.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief memcpy() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *destination = NULL; + void *source = NULL; + size_t num = 2; + void *result; + + result = memcpy( destination, source, num ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/memmove.c b/testsuites/psxtests/psxhdrs/string/memmove.c new file mode 100644 index 0000000000..b52de24938 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/memmove.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief memmove() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *destination = NULL; + void *source = NULL; + size_t num = 2; + void *result; + + result = memmove( destination, source, num ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/memset.c b/testsuites/psxtests/psxhdrs/string/memset.c new file mode 100644 index 0000000000..adc93eb31d --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/memset.c @@ -0,0 +1,41 @@ +/** + * @file + * @brief memset() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 buffer[32]; + void *ptr = buffer; + int value = 3; + size_t num = 2; + void *result; + + result = memset( ptr, value, num ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/stpcpy.c b/testsuites/psxtests/psxhdrs/string/stpcpy.c new file mode 100644 index 0000000000..574f4f6787 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/stpcpy.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief stpcpy() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 buffer[20]; + void *result = buffer; + + result = stpcpy( result, "foo" ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/stpncpy.c b/testsuites/psxtests/psxhdrs/string/stpncpy.c new file mode 100644 index 0000000000..a846b93a99 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/stpncpy.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief stpncpy() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello world"; + char *src = "Dude"; + size_t num = 2; + char *result; + + result = stpncpy( dest, src, num ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strcat.c b/testsuites/psxtests/psxhdrs/string/strcat.c new file mode 100644 index 0000000000..b65d11dc69 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strcat.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strcat() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 dest[12] = "H"; + char *src = "W"; + char *result; + + result = strcat( dest, src ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strchr.c b/testsuites/psxtests/psxhdrs/string/strchr.c new file mode 100644 index 0000000000..70ef3ed6c6 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strchr.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strchr() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *result; + + result = strchr( dest, 2 ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strcmp.c b/testsuites/psxtests/psxhdrs/string/strcmp.c new file mode 100644 index 0000000000..2d04a76bc5 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strcmp.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strcmp() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + int result; + + result = strcmp( dest, src ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strcoll.c b/testsuites/psxtests/psxhdrs/string/strcoll.c new file mode 100644 index 0000000000..d597bc0ee7 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strcoll.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strcoll() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + int result; + + result = strcoll( dest, src ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strcoll_l.c b/testsuites/psxtests/psxhdrs/string/strcoll_l.c new file mode 100644 index 0000000000..cdda99b66f --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strcoll_l.c @@ -0,0 +1,41 @@ +/** + * @file + * @brief strcoll_l() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 ) + { + char *dest = "Hello"; + char *src = "World"; + locale_t loc = NULL; + int result; + + result = strcoll_l( dest, src, loc ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strcpy.c b/testsuites/psxtests/psxhdrs/string/strcpy.c new file mode 100644 index 0000000000..792d010d50 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strcpy.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strcpy() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + char *result; + + result = strcpy( dest, src ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strcspn.c b/testsuites/psxtests/psxhdrs/string/strcspn.c new file mode 100644 index 0000000000..f59b307177 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strcspn.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strcspn() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + int result; + + result = strcspn( dest, src ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strdup.c b/testsuites/psxtests/psxhdrs/string/strdup.c new file mode 100644 index 0000000000..527312fbc3 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strdup.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strdup() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *result; + + result = strdup( dest ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strerror.c b/testsuites/psxtests/psxhdrs/string/strerror.c new file mode 100644 index 0000000000..24612d5346 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strerror.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strerror() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 ) + { + char *result; + + result = strerror( errno ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strerror_l.c b/testsuites/psxtests/psxhdrs/string/strerror_l.c new file mode 100644 index 0000000000..3cbef3ea5a --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strerror_l.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief strerror_l() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 + #include + + int test( void ); + + int test( void ) + { + locale_t locale = NULL; + char *result; + + result = strerror_l( errno, locale ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strerror_r.c b/testsuites/psxtests/psxhdrs/string/strerror_r.c new file mode 100644 index 0000000000..c6c4a756eb --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strerror_r.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strerror_r() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 ) + { + char *dest = "Hello"; + int result; + + result = strerror_r( errno, dest, 2 ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strlen.c b/testsuites/psxtests/psxhdrs/string/strlen.c new file mode 100644 index 0000000000..3abbe96e39 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strlen.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strlen() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + size_t result; + + result = strlen( dest ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strncat.c b/testsuites/psxtests/psxhdrs/string/strncat.c new file mode 100644 index 0000000000..fadd97ff52 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strncat.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief strncat() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 + + #define SIZE 40 + + int test( void ); + + int test( void ) + { + char buffer[SIZE] = "computer"; + char *result; + + result = strncat( buffer, " program", 3 ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strncmp.c b/testsuites/psxtests/psxhdrs/string/strncmp.c new file mode 100644 index 0000000000..7f9f8f035c --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strncmp.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strncmp() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + int result; + + result = strncmp( dest, src, 2 ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strncpy.c b/testsuites/psxtests/psxhdrs/string/strncpy.c new file mode 100644 index 0000000000..da46cd875f --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strncpy.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strncpy() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + char *result; + + result = strncpy( dest, src, 3 ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strndup.c b/testsuites/psxtests/psxhdrs/string/strndup.c new file mode 100644 index 0000000000..a8741c87e6 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strndup.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strndup() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *result; + + result = strndup( dest, 3 ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strnlen.c b/testsuites/psxtests/psxhdrs/string/strnlen.c new file mode 100644 index 0000000000..c3adda1ff4 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strnlen.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strnlen() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + int result; + + result = strnlen( dest, 3 ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strpbrk.c b/testsuites/psxtests/psxhdrs/string/strpbrk.c new file mode 100644 index 0000000000..37a3760890 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strpbrk.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strpbrk() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + char *result; + + result = strpbrk( dest, src ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strrchr.c b/testsuites/psxtests/psxhdrs/string/strrchr.c new file mode 100644 index 0000000000..4df0f47677 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strrchr.c @@ -0,0 +1,38 @@ +/** + * @file + * @brief strrchr() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *result; + + result = strrchr( dest, 3 ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strsignal.c b/testsuites/psxtests/psxhdrs/string/strsignal.c new file mode 100644 index 0000000000..c29a5d914a --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strsignal.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief strsignal() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *result; + + result = strsignal( 2 ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strspn.c b/testsuites/psxtests/psxhdrs/string/strspn.c new file mode 100644 index 0000000000..b45819207e --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strspn.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strspn() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + int result; + + result = strspn( dest, src ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strstr.c b/testsuites/psxtests/psxhdrs/string/strstr.c new file mode 100644 index 0000000000..a4f7fe8e83 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strstr.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strstr() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + char *result; + + result = strstr( dest, src ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strtok.c b/testsuites/psxtests/psxhdrs/string/strtok.c new file mode 100644 index 0000000000..25f137c806 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strtok.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strtok() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + char *result; + + result = strtok( dest, src ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strtok_r.c b/testsuites/psxtests/psxhdrs/string/strtok_r.c new file mode 100644 index 0000000000..5fcab9982e --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strtok_r.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief strtok_r() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + char *saveptr = "Door"; + char *result; + + result = strtok_r( dest, src, &saveptr ); + + return ( result != NULL ); + } diff --git a/testsuites/psxtests/psxhdrs/string/strxfrm.c b/testsuites/psxtests/psxhdrs/string/strxfrm.c new file mode 100644 index 0000000000..6f5ea03a34 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strxfrm.c @@ -0,0 +1,39 @@ +/** + * @file + * @brief strxfrm() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 *dest = "Hello"; + char *src = "World"; + int result; + + result = strxfrm( dest, src, 2 ); + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/string/strxfrm_l.c b/testsuites/psxtests/psxhdrs/string/strxfrm_l.c new file mode 100644 index 0000000000..c143d7b323 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/string/strxfrm_l.c @@ -0,0 +1,41 @@ +/** + * @file + * @brief strxfrm_l() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Himanshu Sekhar Nayak + * + * 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 ) + { + char *dest = "Hello"; + char *src = "World"; + locale_t locale = NULL; + int result; + + result = strxfrm_l( dest, src, 2, locale ); + + return result; + } -- cgit v1.2.3