POSIX Signature Test for nl_type.h (GCI2018)
Joel Sherrill
joel at rtems.org
Wed Dec 12 21:09:47 UTC 2018
Three issues that I see:
+ Update the license.
+ I fixed an unitialized variable warning for a in catclose.c with "= {0}"
+ But the worst is that nl_types.h isn't supported by RTEMS so a new
POSIX-Compliance ticket for this needs to be filed.
Please tidy up and resubmit.
Thanks.
--joel
On Wed, Dec 12, 2018 at 2:25 AM Abhimanyu Raghuvanshi <
abhimanyuraghuvanshi29 at gmail.com> wrote:
> Attaching the patch file
>
> ===================
> From 3fad278aa27a0ebbd584e4ae9eb6ab0a0d498c00 Mon Sep 17 00:00:00 2001
> From: ABR290B <abhimanyuraghuvanshi29 at gmail.com>
> Date: Wed, 12 Dec 2018 13:53:05 +0530
> Subject: [PATCH] POSIX Signature Test for nl_types.h (GCI2018)
>
> ---
> testsuites/psxtests/Makefile.am | 5 ++-
> .../psxtests/psxhdrs/nl_types/catclose.c | 36 +++++++++++++++++++
> .../psxtests/psxhdrs/nl_types/catgets.c | 36 +++++++++++++++++++
> .../psxtests/psxhdrs/nl_types/catopen.c | 35 ++++++++++++++++++
> 4 files changed, 111 insertions(+), 1 deletion(-)
> create mode 100644 testsuites/psxtests/psxhdrs/nl_types/catclose.c
> create mode 100644 testsuites/psxtests/psxhdrs/nl_types/catgets.c
> create mode 100644 testsuites/psxtests/psxhdrs/nl_types/catopen.c
>
> diff --git a/testsuites/psxtests/Makefile.am
> b/testsuites/psxtests/Makefile.am
> index 3dd8fe0139..9cff5084bb 100644
> --- a/testsuites/psxtests/Makefile.am
> +++ b/testsuites/psxtests/Makefile.am
> @@ -1815,7 +1815,10 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
> psxhdrs/setjmp/longjmp.c \
> psxhdrs/setjmp/setjmp.c \
> psxhdrs/setjmp/siglongjmp.c \
> - psxhdrs/setjmp/sigsetjmp.c
> + psxhdrs/setjmp/sigsetjmp.c \
> + psxhdrs/nl_types/catclose.c \
> + psxhdrs/nl_types/catopen.c \
> + psxhdrs/nl_types/catgets.c
>
> ## Not supported by RTEMS, but POSIX API Compliance tests exist.
> ## lib_a_SOURCES += psxhdrs/ulimit/ulimit.c
> diff --git a/testsuites/psxtests/psxhdrs/nl_types/catclose.c
> b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
> new file mode 100644
> index 0000000000..1e09fd46d0
> --- /dev/null
> +++ b/testsuites/psxtests/psxhdrs/nl_types/catclose.c
> @@ -0,0 +1,36 @@
> +/**
> + * @file
> + * @brief catclose() API Conformance Test
> + */
> +
> +/*
> + * COPYRIGHT (c) 2018.
> + * Abhimanyu Raghuvanshi
> + *
> + * 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 <nl_types.h>
> +
> +
> +int test(void);
> +
> +int test(void)
> +{
> + nl_catd a;
> + catclose(a);
> + return 0;
> +}
> \ No newline at end of file
> diff --git a/testsuites/psxtests/psxhdrs/nl_types/catgets.c
> b/testsuites/psxtests/psxhdrs/nl_types/catgets.c
> new file mode 100644
> index 0000000000..e9ff8bef40
> --- /dev/null
> +++ b/testsuites/psxtests/psxhdrs/nl_types/catgets.c
> @@ -0,0 +1,36 @@
> +/**
> + * @file
> + * @brief catgets() API Conformance Test
> + */
> +
> +/*
> + * COPYRIGHT (c) 2018.
> + * Abhimanyu Raghuvanshi
> + *
> + * 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 <nl_types.h>
> +
> +
> +int test(void);
> +
> +int test(void)
> +{
> + nl_catd a = 0;
> + char *b = catgets(a, NL_SETD, 1, "/path/to/file");
> + return b != 0;
> +}
> \ No newline at end of file
> diff --git a/testsuites/psxtests/psxhdrs/nl_types/catopen.c
> b/testsuites/psxtests/psxhdrs/nl_types/catopen.c
> new file mode 100644
> index 0000000000..637f100267
> --- /dev/null
> +++ b/testsuites/psxtests/psxhdrs/nl_types/catopen.c
> @@ -0,0 +1,35 @@
> +/**
> + * @file
> + * @brief catopen() API Conformance Test
> + */
> +
> +/*
> + * COPYRIGHT (c) 2018.
> + * Abhimanyu Raghuvanshi
> + *
> + * 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 <nl_types.h>
> +
> +
> +int test(void);
> +
> +int test(void)
> +{
> + nl_catd msg_file = catopen("/path/to/file", 0);
> + return msg_file != (nl_catd) -1;
> +}
> \ No newline at end of file
> --
> 2.19.1.windows.1
> =====================
>
>
>
> ABR
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20181212/c1d5ec45/attachment-0002.html>
More information about the devel
mailing list