<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr"><br></div>---<br>
testsuites/psxtests/Makefile.am | 7 +<br>
testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer noreferrer noreferrer" target="_blank">configure.ac</a> | 1 +<br>
testsuites/psxtests/psxinttypes01/init.c | 154 ++++++++++++++++++<br>
.../psxtests/psxinttypes01/psxinttypes01.doc | 57 +++++++<br>
.../psxtests/psxinttypes01/psxinttypes01.scn | 28 ++++<br>
5 files changed, 247 insertions(+)<br>
create mode 100644 testsuites/psxtests/psxinttypes01/init.c<br>
create mode 100644 testsuites/psxtests/psxinttypes01/psxinttypes01.doc<br>
create mode 100644 testsuites/psxtests/psxinttypes01/psxinttypes01.scn<br>
<br>
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am<br>
index 749258cc0c..f619dd9ae9 100644<br>
--- a/testsuites/psxtests/Makefile.am<br>
+++ b/testsuites/psxtests/Makefile.am<br>
@@ -22,6 +22,13 @@ psx01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psx01) \<br>
$(support_includes) -I$(top_srcdir)/include<br>
endif<br>
<br>
+if TEST_psxinttypes01<br>
+psx_tests += psxinttypes01<br>
+psxinttypes01_SOURCES = psxinttypes01/init.c<br>
+psxinttypes01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxinttypes01) \<br>
+ $(support_includes)<br>
+endif<br>
+<br>
if HAS_POSIX<br>
if TEST_psx02<br>
psx_tests += psx02<br>
diff --git a/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer noreferrer noreferrer" target="_blank">configure.ac</a> b/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer noreferrer noreferrer" target="_blank">configure.ac</a><br>
index cdd6ee7e4e..e032a6f5ec 100644<br>
--- a/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer noreferrer noreferrer" target="_blank">configure.ac</a><br>
+++ b/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer noreferrer noreferrer" target="_blank">configure.ac</a><br>
@@ -140,6 +140,7 @@ RTEMS_TEST_CHECK([psxtimes01])<br>
RTEMS_TEST_CHECK([psxualarm])<br>
RTEMS_TEST_CHECK([psxusleep])<br>
RTEMS_TEST_CHECK([lib_a])<br>
+RTEMS_TEST_CHECK([psxinttypes01])<br>
<br>
AC_CONFIG_FILES([Makefile])<br>
AC_OUTPUT<br>
diff --git a/testsuites/psxtests/psxinttypes01/init.c b/testsuites/psxtests/psxinttypes01/init.c<br>
new file mode 100644<br>
index 0000000000..1c6340afe2<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxinttypes01/init.c<br>
@@ -0,0 +1,154 @@<br>
+/**<br>
+ * @file<br>
+ * @brief Test suite for inttypes.h methods<br>
+ */<br>
+<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * Copyright (C) 2019, Vaibhav Gupta<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+ * POSSIBILITY OF SUCH DAMAGE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <rtems/test.h><br>
+#include <inttypes.h><br>
+#include <stdio.h><br>
+#include <errno.h><br>
+#include <tmacros.h><br>
+#include <stdint.h><br>
+#include <stddef.h><br>
+<br>
+const char rtems_test_name[] = "PSXINTTYPE 01";<br>
+<br>
+/* forward declarations to avoid warnings */<br>
+rtems_task Init(rtems_task_argument ignored);<br>
+<br>
+rtems_task Init(rtems_task_argument ignored)<br>
+{<br>
+ int base = 10;<br>
+ char *nptr1 = "123abc";<br>
+ char *endptr1 = NULL;<br>
+ wchar_t *nptr2 = L"-123junk";<br>
+ wchar_t *endptr2 = NULL;<br>
+ intmax_t status1;<br>
+ uintmax_t status2;<br>
+ <br>
+<br>
+ TEST_BEGIN();<br>
+<br>
+ puts( "\nChecking invalid base value" );<br>
+ rtems_test_assert( base >=2 && base <= 36 );<br>
+ <br>
+ /*Test for strtoimax */<br>
+ puts( "Strtoimax Testcases...." );<br>
+ puts( "Generating Status" );<br>
+ status1 = strtoimax( nptr1, &endptr1, base );<br>
+<br>
+ rtems_test_assert( status1 != 0);<br>
+ rtems_test_assert( base != EINVAL);<br>
+ <br>
+ puts( "Checking Garbage end of endptr" ); <br>
+ rtems_test_assert( *endptr1 != '\0' );<br>
+ <br>
+ puts( "Checking Underflow Case" );<br>
+ rtems_test_assert( status1 >= INTMAX_MIN );<br>
+ <br>
+ puts( "Checking Overflow Case" );<br>
+ rtems_test_assert( status1 <= INTMAX_MAX ) ;<br>
+ <br>
+ printf( "status = %jd \n" , status1 );<br>
+ <br>
+ /*Test for strtoumax */<br>
+ puts( "Strtoumax Testcases...." );<br>
+ puts( "Generating Status" );<br>
+ status2 = strtoumax( nptr1, &endptr1, base );<br>
+ <br>
+ rtems_test_assert( status2 != 0);<br>
+ rtems_test_assert( base != EINVAL);<br>
+<br>
+ puts( "Checking Garbage end of endptr" ); <br>
+ rtems_test_assert( *endptr1 != '\0' );<br>
+ <br>
+ puts( "Checking Overflow Case" );<br>
+ rtems_test_assert( status2 <= UINTMAX_MAX );<br>
+ <br>
+ printf( "status = %ju \n", status2 );<br>
+ <br>
+ /*Test for wcstoimax */<br>
+ puts( "Wcstoimax Testcases...." );<br>
+ puts( "Generating Status" );<br>
+ status1 = wcstoimax( nptr2, &endptr2, base );<br>
+ <br>
+ rtems_test_assert( status1 != 0);<br>
+ rtems_test_assert( base != EINVAL);<br>
+ <br>
+ puts( "Checking Garbage end of endptr" ); <br>
+ rtems_test_assert( *endptr2 != '\0' );<br>
+ <br>
+ puts( "Checking Underflow Case" );<br>
+ rtems_test_assert( status1 >= INTMAX_MIN );<br>
+ <br>
+ puts( "Checking Overflow Case" );<br>
+ rtems_test_assert( status1 <= INTMAX_MAX ) ;<br>
+ <br>
+ printf( "status = %jd \n", status1 );<br>
+<br>
+ /*Test for wcstoumax */<br>
+ puts( "wcstoumax Testcases...." );<br>
+ puts( "Generating Status" );<br>
+ status2 = wcstoumax( nptr2, &endptr2, base );<br>
+ <br>
+ rtems_test_assert( status2 != 0);<br>
+ rtems_test_assert( base != EINVAL);<br>
+<br>
+ puts( "Checking Garbage end of endptr" ); <br>
+ rtems_test_assert( *endptr2 != '\0' );<br>
+ <br>
+ puts( "Checking Overflow Case" );<br>
+ rtems_test_assert( status2 <= UINTMAX_MAX );<br>
+ <br>
+ printf( "status = %ju \n", status2 );<br>
+ <br>
+<br>
+ TEST_END();<br>
+ rtems_test_exit(0);<br>
+<br>
+}<br>
+<br>
+/* NOTICE: the clock driver is explicitly disabled */<br>
+<br>
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER<br>
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<br>
+<br>
+#define CONFIGURE_MAXIMUM_TASKS 1<br>
+<br>
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE<br>
+<br>
+#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION<br>
+<br>
+#define CONFIGURE_INIT<br>
+#include <rtems/confdefs.h><br>
diff --git a/testsuites/psxtests/psxinttypes01/psxinttypes01.doc b/testsuites/psxtests/psxinttypes01/psxinttypes01.doc<br>
new file mode 100644<br>
index 0000000000..f9e0951786<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxinttypes01/psxinttypes01.doc<br>
@@ -0,0 +1,57 @@<br>
+/**<br>
+ * @file<br>
+ * @brief Doc for Test suite for inttypes.h methods<br>
+ */<br>
+<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * Copyright (C) 2019, Vaibhav Gupta<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+ * POSSIBILITY OF SUCH DAMAGE.<br>
+ */<br>
+<br>
+This File describes the concepts tested by this test suite.<br>
+<br>
+inttypes.h - fixed size integer types<br>
+<br>
+test suite name: PSXINTTYPE 01<br>
+<br>
+- Checks for invalid base value<br>
+<br>
+- Checks for Strtoimax Testcases<br>
+ - checks for Garbage end of endptr<br>
+ - checks for Underflow Case<br>
+ - checks for Overflow Case<br>
+<br>
+- Checks for Strtoumax Test Cases<br>
+ - checks for Garbage end of endptr<br>
+ - checks for Overflow Case<br>
+<br>
+- Checks for Wcstoimax Testcases<br>
+ - checks for Garbage end of endptr<br>
+ - checks for Underflow Case<br>
+ - checks for Overflow Case<br>
+<br>
+- Checks for Wcstoumax Testcases<br>
+ - checks for Garbage end of endptr<br>
+ - checks for Overflow Case<br>
diff --git a/testsuites/psxtests/psxinttypes01/psxinttypes01.scn b/testsuites/psxtests/psxinttypes01/psxinttypes01.scn<br>
new file mode 100644<br>
index 0000000000..cdd56b327d<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxinttypes01/psxinttypes01.scn<br>
@@ -0,0 +1,28 @@<br>
+*** PSXINTTYPE 01 TEST ***<br>
+<br>
+Checking invalid base value<br>
+Strtoimax Testcases....<br>
+Generating Status<br>
+Checking Garbage end of endptr<br>
+Checking Underflow Case<br>
+Checking Overflow Case<br>
+status = 123 <br>
+Strtoumax Testcases....<br>
+Generating Status<br>
+Checking Garbage end of endptr<br>
+Checking Overflow Case<br>
+status = 123 <br>
+Wcstoimax Testcases....<br>
+Generating Status<br>
+Checking Garbage end of endptr<br>
+Checking Underflow Case<br>
+Checking Overflow Case<br>
+status = -123 <br>
+wcstoumax Testcases....<br>
+Generating Status<br>
+Checking Garbage end of endptr<br>
+Checking Overflow Case<br>
+status = 18446744073709551493 <br>
+<br>
+*** END OF PSXINTTYPE 01 TEST ***<br>
+<br>
-- <br>
2.21.0<br>
<br>
</div></div>