<div dir="ltr">Just pushed this. Thanks.<br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 6, 2018 at 3:27 PM Marçal Comajoan Cara <<a href="mailto:mcomajoancara@gmail.com">mcomajoancara@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This work was part of GCI 2018<br>
---<br>
testsuites/psxtests/Makefile.am | 9 ++++-<br>
.../psxtests/psxhdrs/inttypes/imaxabs.c | 38 ++++++++++++++++++<br>
.../psxtests/psxhdrs/inttypes/imaxdiv.c | 39 ++++++++++++++++++<br>
.../psxtests/psxhdrs/inttypes/strtoimax.c | 39 ++++++++++++++++++<br>
.../psxtests/psxhdrs/inttypes/strtoumax.c | 39 ++++++++++++++++++<br>
.../psxtests/psxhdrs/inttypes/wcstoimax.c | 40 +++++++++++++++++++<br>
.../psxtests/psxhdrs/inttypes/wcstoumax.c | 40 +++++++++++++++++++<br>
7 files changed, 243 insertions(+), 1 deletion(-)<br>
create mode 100644 testsuites/psxtests/psxhdrs/inttypes/imaxabs.c<br>
create mode 100644 testsuites/psxtests/psxhdrs/inttypes/imaxdiv.c<br>
create mode 100644 testsuites/psxtests/psxhdrs/inttypes/strtoimax.c<br>
create mode 100644 testsuites/psxtests/psxhdrs/inttypes/strtoumax.c<br>
create mode 100644 testsuites/psxtests/psxhdrs/inttypes/wcstoimax.c<br>
create mode 100644 testsuites/psxtests/psxhdrs/inttypes/wcstoumax.c<br>
<br>
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am<br>
index 4feaa8d68a..f5359d8b19 100644<br>
--- a/testsuites/psxtests/Makefile.am<br>
+++ b/testsuites/psxtests/Makefile.am<br>
@@ -1573,7 +1573,14 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \<br>
psxhdrs/wctype/wctrans.c \<br>
psxhdrs/wctype/wctrans_l.c \<br>
psxhdrs/wctype/wctype.c \<br>
- psxhdrs/wctype/wctype_l.c<br>
+ psxhdrs/wctype/wctype_l.c \<br>
+ psxhdrs/inttypes/imaxabs.c \<br>
+ psxhdrs/inttypes/imaxdiv.c \<br>
+ psxhdrs/inttypes/strtoimax.c \<br>
+ psxhdrs/inttypes/strtoumax.c \<br>
+ psxhdrs/inttypes/wcstoimax.c \<br>
+ psxhdrs/inttypes/wcstoumax.c<br>
+<br>
<br>
## Not supported by RTEMS, but POSIX API Compliance tests exist.<br>
## lib_a_SOURCES += psxhdrs/ulimit/ulimit.c<br>
diff --git a/testsuites/psxtests/psxhdrs/inttypes/imaxabs.c b/testsuites/psxtests/psxhdrs/inttypes/imaxabs.c<br>
new file mode 100644<br>
index 0000000000..df5c244034<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxhdrs/inttypes/imaxabs.c<br>
@@ -0,0 +1,38 @@<br>
+/**<br>
+ * @file<br>
+ * @brief imaxabs() API Conformance Test<br>
+ */<br>
+<br>
+/*<br>
+ * COPYRIGHT (c) 2018.<br>
+ * Marçal Comajoan Cara<br>
+ *<br>
+ * Permission to use, copy, modify, and/or distribute this software<br>
+ * for any purpose with or without fee is hereby granted.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <inttypes.h><br>
+<br>
+int test( void );<br>
+<br>
+int test( void )<br>
+{<br>
+ intmax_t n = -42;<br>
+ intmax_t result;<br>
+<br>
+ result = imaxabs( n );<br>
+<br>
+ return ( result == 42 );<br>
+}<br>
diff --git a/testsuites/psxtests/psxhdrs/inttypes/imaxdiv.c b/testsuites/psxtests/psxhdrs/inttypes/imaxdiv.c<br>
new file mode 100644<br>
index 0000000000..3538fef12b<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxhdrs/inttypes/imaxdiv.c<br>
@@ -0,0 +1,39 @@<br>
+/**<br>
+ * @file<br>
+ * @brief imaxdiv() API Conformance Test<br>
+ */<br>
+<br>
+/*<br>
+ * COPYRIGHT (c) 2018.<br>
+ * Marçal Comajoan Cara<br>
+ *<br>
+ * Permission to use, copy, modify, and/or distribute this software<br>
+ * for any purpose with or without fee is hereby granted.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <inttypes.h><br>
+<br>
+int test( void );<br>
+<br>
+int test( void )<br>
+{<br>
+ intmax_t n = 42;<br>
+ intmax_t denom = 5;<br>
+ imaxdiv_t result;<br>
+<br>
+ result = imaxdiv( n, denom );<br>
+<br>
+ return ( result.quot == 8 && result.rem == 2 );<br>
+}<br>
diff --git a/testsuites/psxtests/psxhdrs/inttypes/strtoimax.c b/testsuites/psxtests/psxhdrs/inttypes/strtoimax.c<br>
new file mode 100644<br>
index 0000000000..1544bdcb29<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxhdrs/inttypes/strtoimax.c<br>
@@ -0,0 +1,39 @@<br>
+/**<br>
+ * @file<br>
+ * @brief strtoimax() API Conformance Test<br>
+ */<br>
+<br>
+/*<br>
+ * COPYRIGHT (c) 2018.<br>
+ * Marçal Comajoan Cara<br>
+ *<br>
+ * Permission to use, copy, modify, and/or distribute this software<br>
+ * for any purpose with or without fee is hereby granted.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <inttypes.h><br>
+<br>
+int test( void );<br>
+<br>
+int test( void )<br>
+{<br>
+ char *n = "-42";<br>
+ intmax_t result;<br>
+ char *endptr;<br>
+<br>
+ result = strtoimax( n, &endptr, 10 );<br>
+<br>
+ return ( result == -42 );<br>
+}<br>
diff --git a/testsuites/psxtests/psxhdrs/inttypes/strtoumax.c b/testsuites/psxtests/psxhdrs/inttypes/strtoumax.c<br>
new file mode 100644<br>
index 0000000000..a8cd3137c8<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxhdrs/inttypes/strtoumax.c<br>
@@ -0,0 +1,39 @@<br>
+/**<br>
+ * @file<br>
+ * @brief strtoumax() API Conformance Test<br>
+ */<br>
+<br>
+/*<br>
+ * COPYRIGHT (c) 2018.<br>
+ * Marçal Comajoan Cara<br>
+ *<br>
+ * Permission to use, copy, modify, and/or distribute this software<br>
+ * for any purpose with or without fee is hereby granted.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <inttypes.h><br>
+<br>
+int test( void );<br>
+<br>
+int test( void )<br>
+{<br>
+ char *n = "42";<br>
+ uintmax_t result;<br>
+ char *endptr;<br>
+<br>
+ result = strtoumax( n, &endptr, 10 );<br>
+<br>
+ return ( result == 42 );<br>
+}<br>
diff --git a/testsuites/psxtests/psxhdrs/inttypes/wcstoimax.c b/testsuites/psxtests/psxhdrs/inttypes/wcstoimax.c<br>
new file mode 100644<br>
index 0000000000..e7af7ba9a2<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxhdrs/inttypes/wcstoimax.c<br>
@@ -0,0 +1,40 @@<br>
+/**<br>
+ * @file<br>
+ * @brief wcstoimax() API Conformance Test<br>
+ */<br>
+<br>
+/*<br>
+ * COPYRIGHT (c) 2018.<br>
+ * Marçal Comajoan Cara<br>
+ *<br>
+ * Permission to use, copy, modify, and/or distribute this software<br>
+ * for any purpose with or without fee is hereby granted.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <stddef.h><br>
+#include <inttypes.h><br>
+<br>
+int test( void );<br>
+<br>
+int test( void )<br>
+{<br>
+ wchar_t *n = L"-42";<br>
+ intmax_t result;<br>
+ wchar_t *endptr;<br>
+<br>
+ result = wcstoimax( n, &endptr, 10 );<br>
+<br>
+ return ( result == -42 );<br>
+}<br>
diff --git a/testsuites/psxtests/psxhdrs/inttypes/wcstoumax.c b/testsuites/psxtests/psxhdrs/inttypes/wcstoumax.c<br>
new file mode 100644<br>
index 0000000000..763cd9bfc5<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/psxhdrs/inttypes/wcstoumax.c<br>
@@ -0,0 +1,40 @@<br>
+/**<br>
+ * @file<br>
+ * @brief wcstoumax() API Conformance Test<br>
+ */<br>
+<br>
+/*<br>
+ * COPYRIGHT (c) 2018.<br>
+ * Marçal Comajoan Cara<br>
+ *<br>
+ * Permission to use, copy, modify, and/or distribute this software<br>
+ * for any purpose with or without fee is hereby granted.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <stddef.h><br>
+#include <inttypes.h><br>
+<br>
+int test( void );<br>
+<br>
+int test( void )<br>
+{<br>
+ wchar_t *n = L"42";<br>
+ uintmax_t result;<br>
+ wchar_t *endptr;<br>
+<br>
+ result = wcstoumax( n, &endptr, 10 );<br>
+<br>
+ return ( result == 42 );<br>
+}<br>
-- <br>
2.19.2<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div>