Hi guys, Here is the patch file for locale.h file.
Thanks Himanshu
From b289c5dde82341bc6914a42f9095ff7095a1e2a7 Mon Sep 17 00:00:00 2001 From: Himanshu40 <himanshuwindows...@gmail.com> Date: Sun, 2 Dec 2018 16:31:18 +0530 Subject: [PATCH] psxhdrs: add POSIX API Signature Compliance Tests for locale.h File (GCI 2018) --- testsuites/psxtests/Makefile.am | 8 +++- .../psxtests/psxhdrs/locale/duplocale.c | 44 +++++++++++++++++++ .../psxtests/psxhdrs/locale/freelocale.c | 42 ++++++++++++++++++ .../psxtests/psxhdrs/locale/localeconv.c | 42 ++++++++++++++++++ .../psxtests/psxhdrs/locale/newlocale.c | 42 ++++++++++++++++++ .../psxtests/psxhdrs/locale/setlocale.c | 41 +++++++++++++++++ .../psxtests/psxhdrs/locale/uselocale.c | 44 +++++++++++++++++++ 7 files changed, 262 insertions(+), 1 deletion(-) create mode 100644 testsuites/psxtests/psxhdrs/locale/duplocale.c create mode 100644 testsuites/psxtests/psxhdrs/locale/freelocale.c create mode 100644 testsuites/psxtests/psxhdrs/locale/localeconv.c create mode 100644 testsuites/psxtests/psxhdrs/locale/newlocale.c create mode 100644 testsuites/psxtests/psxhdrs/locale/setlocale.c create mode 100644 testsuites/psxtests/psxhdrs/locale/uselocale.c diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am index d028ad4e93..d9ba68a240 100644 --- a/testsuites/psxtests/Makefile.am +++ b/testsuites/psxtests/Makefile.am @@ -1126,7 +1126,13 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \ psxhdrs/dlfcn/dlopen.c \ psxhdrs/dlfcn/dlclose.c \ psxhdrs/dlfcn/dlerror.c \ - psxhdrs/dlfcn/dlsym.c + psxhdrs/dlfcn/dlsym.c \ + psxhdrs/locale/newlocale.c \ + psxhdrs/locale/freelocale.c \ + psxhdrs/locale/uselocale.c \ + psxhdrs/locale/setlocale.c \ + psxhdrs/locale/duplocale.c \ + psxhdrs/locale/localeconv.c endif rtems_tests_PROGRAMS = $(psx_tests) diff --git a/testsuites/psxtests/psxhdrs/locale/duplocale.c b/testsuites/psxtests/psxhdrs/locale/duplocale.c new file mode 100644 index 0000000000..64fb50eca0 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/locale/duplocale.c @@ -0,0 +1,44 @@ +/** + * @file + * @brief duplocale() 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 <locale.h> + + int test( void ); + + int result = 1; + + int test( void ) + { + locale_t newloc; + locale_t locobj; + int category_mask = LC_CTYPE_MASK | LC_TIME_MASK; + char *locale = "loc1"; + + newloc = newlocale( category_mask, locale, (locale_t)0 ); + locobj = duplocale( newloc ); + (void) locobj; + result = 0; + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/locale/freelocale.c b/testsuites/psxtests/psxhdrs/locale/freelocale.c new file mode 100644 index 0000000000..fdecea438e --- /dev/null +++ b/testsuites/psxtests/psxhdrs/locale/freelocale.c @@ -0,0 +1,42 @@ +/** + * @file + * @brief freelocale() 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 <locale.h> + + int test( void ); + + int result = 1; + + int test( void ) + { + locale_t newloc; + int category_mask = LC_CTYPE_MASK | LC_TIME_MASK; + char *locale = "loc1"; + + newloc = newlocale( category_mask, locale, (locale_t)0 ); + freelocale( newloc ); + result = 0; + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/locale/localeconv.c b/testsuites/psxtests/psxhdrs/locale/localeconv.c new file mode 100644 index 0000000000..a3d01227fc --- /dev/null +++ b/testsuites/psxtests/psxhdrs/locale/localeconv.c @@ -0,0 +1,42 @@ +/** + * @file + * @brief localeconv() 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 <locale.h> + + int test( void ); + + int result = 1; + + int test( void ) + { + struct lconv *lc; + int category = LC_MONETARY; + + setlocale( category, "" ); + lc = localeconv(); + (void) lc; + result = 0; + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/locale/newlocale.c b/testsuites/psxtests/psxhdrs/locale/newlocale.c new file mode 100644 index 0000000000..86e8b859a4 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/locale/newlocale.c @@ -0,0 +1,42 @@ +/** + * @file + * @brief newlocale() 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 <locale.h> + + int test( void ); + + int result = 1; + + int test( void ) + { + locale_t newloc; + int category_mask = LC_CTYPE_MASK | LC_TIME_MASK; + char *locale = "loc1"; + + newloc = newlocale( category_mask, locale, (locale_t)0 ); + (void) newloc; + result = 0; + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/locale/setlocale.c b/testsuites/psxtests/psxhdrs/locale/setlocale.c new file mode 100644 index 0000000000..76474cb58a --- /dev/null +++ b/testsuites/psxtests/psxhdrs/locale/setlocale.c @@ -0,0 +1,41 @@ +/** + * @file + * @brief setlocale() 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 <locale.h> + + int test( void ); + + int result = 1; + + int test( void ) + { + int category = LC_ALL; + char *locale = "loc1"; + char *ostring; + + ostring = setlocale( category, locale ); + result = 0; + + return result; + } diff --git a/testsuites/psxtests/psxhdrs/locale/uselocale.c b/testsuites/psxtests/psxhdrs/locale/uselocale.c new file mode 100644 index 0000000000..6720bc26a8 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/locale/uselocale.c @@ -0,0 +1,44 @@ +/** + * @file + * @brief uselocale() 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 <locale.h> + + int test( void ); + + int result = 1; + + int test( void ) + { + locale_t newloc; + locale_t currentloc; + int category_mask = LC_CTYPE_MASK | LC_TIME_MASK; + char *locale = "loc1"; + + newloc = newlocale( category_mask, locale, (locale_t)0 ); + currentloc = uselocale( newloc ); + (void) currentloc; + result = 0; + + return result; + } -- 2.17.2
_______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel