A few administrative changes.
There needs to be a proper commit log message.
init.c does not have a copyright/license notices.
There is no .doc file giving a description of the test purposes/cases.
On Wed, Sep 26, 2018 at 11:32 AM Aditya Upadhyay
wrote:
> ---
> testsuites/psxtests/Makefile.am| 10 ++
> testsuites/psxtests/configure.ac | 1 +
> testsuites/psxtests/psxinttypes01/init.c | 122
> +
> .../psxtests/psxinttypes01/psxinttypes01.scn | 28 +
> 4 files changed, 161 insertions(+)
> create mode 100644 testsuites/psxtests/psxinttypes01/init.c
> create mode 100644 testsuites/psxtests/psxinttypes01/psxinttypes01.scn
>
> diff --git a/testsuites/psxtests/Makefile.am
> b/testsuites/psxtests/Makefile.am
> index 2a18d54..c7b4899 100644
> --- a/testsuites/psxtests/Makefile.am
> +++ b/testsuites/psxtests/Makefile.am
> @@ -15,6 +15,16 @@ psx_lib =
> support_includes = -I$(top_srcdir)/../support/include
>
> if HAS_POSIX
> +if TEST_psxinttypes01
> +psx_tests += psxinttypes01
> +psx_screens += psxinttypes01/psxinttypes01.scn
> +psxinttypes01_SOURCES = psxinttypes01/init.c
> +psxinttypes01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxinttypes01) \
> + $(support_includes) -I$(top_srcdir)/include
> +endif
> +endif
> +
> +if HAS_POSIX
> if TEST_psx01
> psx_tests += psx01
> psx01_SOURCES = psx01/init.c psx01/task.c psx01/system.h \
> diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/
> configure.ac
> index cdd6ee7..85559e4 100644
> --- a/testsuites/psxtests/configure.ac
> +++ b/testsuites/psxtests/configure.ac
> @@ -91,6 +91,7 @@ RTEMS_TEST_CHECK([psxid01])
> RTEMS_TEST_CHECK([psximfs01])
> RTEMS_TEST_CHECK([psximfs02])
> RTEMS_TEST_CHECK([psxintrcritical01])
> +RTEMS_TEST_CHECK([psxinttypes01])
> RTEMS_TEST_CHECK([psxitimer])
> RTEMS_TEST_CHECK([psxkey01])
> RTEMS_TEST_CHECK([psxkey02])
> diff --git a/testsuites/psxtests/psxinttypes01/init.c
> b/testsuites/psxtests/psxinttypes01/init.c
> new file mode 100644
> index 000..7f5942a
> --- /dev/null
> +++ b/testsuites/psxtests/psxinttypes01/init.c
> @@ -0,0 +1,122 @@
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
> +
> +const char rtems_test_name[] = "PSXINTTYPE 01";
> +
> +/* forward declarations to avoid warnings */
> +rtems_task Init(rtems_task_argument ignored);
> +
> +rtems_task Init(rtems_task_argument ignored)
> +{
> + int base = 10;
> + char *nptr1= "123abc";
> + char *endptr1 = NULL;
> + wchar_t *nptr2= L"-123junk";
> + wchar_t *endptr2 = NULL;
> + intmax_t status1;
> + uintmax_t status2;
> +
> +
> + TEST_BEGIN();
> +
> + puts( "\nChecking invalid base value" );
> + rtems_test_assert( base >=2 && base <= 36 );
> +
> + /*Test for strtoimax */
> + puts( "Strtoimax Testcases" );
> + puts( "Generating Status" );
> + status1 = strtoimax( nptr1, &endptr1, base );
> +
> + rtems_test_assert( status1 != 0);
> + rtems_test_assert( base != EINVAL);
> +
> + puts( "Checking Garbage end of endptr" );
> + rtems_test_assert( *endptr1 != '\0' );
> +
> + puts( "Checking Underflow Case" );
> + rtems_test_assert( status1 >= INTMAX_MIN );
> +
> + puts( "Checking Overflow Case" );
> + rtems_test_assert( status1 <= INTMAX_MAX ) ;
> +
> + printf( "status = %jd \n" , status1 );
> +
> + /*Test for strtoumax */
> + puts( "Strtoumax Testcases" );
> + puts( "Generating Status" );
> + status2 = strtoumax( nptr1, &endptr1, base );
> +
> + rtems_test_assert( status2 != 0);
> + rtems_test_assert( base != EINVAL);
> +
> + puts( "Checking Garbage end of endptr" );
> + rtems_test_assert( *endptr1 != '\0' );
> +
> + puts( "Checking Overflow Case" );
> + rtems_test_assert( status2 <= UINTMAX_MAX );
> +
> + printf( "status = %ju \n", status2 );
> +
> + /*Test for wcstoimax */
> + puts( "Wcstoimax Testcases" );
> + puts( "Generating Status" );
> + status1 = wcstoimax( nptr2, &endptr2, base );
> +
> + rtems_test_assert( status1 != 0);
> + rtems_test_assert( base != EINVAL);
> +
> + puts( "Checking Garbage end of endptr" );
> + rtems_test_assert( *endptr2 != '\0' );
> +
> + puts( "Checking Underflow Case" );
> + rtems_test_assert( status1 >= INTMAX_MIN );
> +
> + puts( "Checking Overflow Case" );
> + rtems_test_assert( status1 <= INTMAX_MAX ) ;
> +
> + printf( "status = %jd \n", status1 );
> +
> + /*Test for wcstoumax */
> + puts( "wcstoumax Testcases" );
> + puts( "Generating Status" );
> + status2 = wcstoumax( nptr2, &endptr2, base );
> +
> + rtems_test_assert( status2 != 0);
> + rtems_test_assert( base != EINVAL);
> +
> + puts( "Checking Garbage end of endptr" );
> + rtems_test_assert( *endptr2 != '\0' );
> +
> + puts( "Checking Overflow Case" );
> + rtems_test_assert( status2 <= UINTMAX_MAX );
> +
> + printf( "status = %ju \n", status2 );
> +
> +
> + TEST_END();
> +