<div dir="ltr">This is just a test style thing but since you are going to be <div>doing this all summer, how about Init() calling a "test_XXX" </div><div>method for each method under test. That would roughly</div><div>correspond to each of the comment blocks in your Init().</div><div>This makes it easier to go back and add test cases for</div><div>specific coverage cases. </div><div><br></div><div>test_<span style="font-size:12.8px">imaxdiv()</span></div><div>etc.</div><div><br></div><div>Also the code needs to be merged into newlib first so</div><div>we need to get your email showing up there.</div><div><br></div><div>--joel</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 1:56 PM, Aditya Upadhyay <span dir="ltr"><<a href="mailto:aadit0402@gmail.com" target="_blank">aadit0402@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 testsuites/psxtests/Makefile.<wbr>am                    |   1 +<br>
 testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.<wbr>ac</a>                   |   1 +<br>
 testsuites/psxtests/<wbr>psxinttypes01/Makefile.am      |  22 +++++<br>
 testsuites/psxtests/<wbr>psxinttypes01/init.c           | 107 +++++++++++++++++++++<br>
 .../psxtests/psxinttypes01/<wbr>psxinttypes01.scn       |   9 ++<br>
 5 files changed, 140 insertions(+)<br>
 create mode 100644 testsuites/psxtests/<wbr>psxinttypes01/Makefile.am<br>
 create mode 100644 testsuites/psxtests/<wbr>psxinttypes01/init.c<br>
 create mode 100644 testsuites/psxtests/<wbr>psxinttypes01/psxinttypes01.<wbr>scn<br>
<br>
diff --git a/testsuites/psxtests/<wbr>Makefile.am b/testsuites/psxtests/<wbr>Makefile.am<br>
index 7bcea46..8b246d8 100644<br>
--- a/testsuites/psxtests/<wbr>Makefile.am<br>
+++ b/testsuites/psxtests/<wbr>Makefile.am<br>
@@ -49,6 +49,7 @@ _SUBDIRS += psxfatal01<br>
 _SUBDIRS += psxfatal02<br>
 _SUBDIRS += psxgetattrnp01<br>
 endif<br>
+_SUBDIRS += psxinttypes01<br>
 if HAS_POSIX<br>
 if HAS_CPLUSPLUS<br>
 _SUBDIRS += psxglobalcon01<br>
diff --git a/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configur<wbr>e.ac</a> b/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configur<wbr>e.ac</a><br>
index 1de1312..4db7916 100644<br>
--- a/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configur<wbr>e.ac</a><br>
+++ b/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configur<wbr>e.ac</a><br>
@@ -162,6 +162,7 @@ psxid01/Makefile<br>
 psximfs01/Makefile<br>
 psximfs02/Makefile<br>
 psxintrcritical01/Makefile<br>
+psxinttypes01/Makefile<br>
 psxitimer/Makefile<br>
 psxkey01/Makefile<br>
 psxkey02/Makefile<br>
diff --git a/testsuites/psxtests/<wbr>psxinttypes01/Makefile.am b/testsuites/psxtests/<wbr>psxinttypes01/Makefile.am<br>
new file mode 100644<br>
index 0000000..517648c<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/<wbr>psxinttypes01/Makefile.am<br>
@@ -0,0 +1,22 @@<br>
+<br>
+rtems_tests_PROGRAMS = psxinttypes01<br>
+psxinttypes01_SOURCES = init.c<br>
+<br>
+dist_rtems_tests_DATA = psxinttypes01.scn<br>
+<br>
+include $(RTEMS_ROOT)/make/custom/@<wbr>RTEMS_BSP@.cfg<br>
+include $(top_srcdir)/../automake/<a href="http://compile.am" rel="noreferrer" target="_blank">comp<wbr>ile.am</a><br>
+include $(top_srcdir)/../automake/<a href="http://leaf.am" rel="noreferrer" target="_blank">leaf<wbr>.am</a><br>
+<br>
+<br>
+AM_CPPFLAGS += -I$(top_srcdir)/include<br>
+AM_CPPFLAGS += -I$(top_srcdir)/../support/<wbr>include<br>
+<br>
+LINK_OBJS = $(psxinttypes01_OBJECTS) $(psxinttypes01_LDADD)<br>
+LINK_LIBS = $(psxinttypes01_LDLIBS)  /home/aditya/development/b-<wbr>sparc/sparc-rtems4.12/c/erc32/<wbr>cpukit/inttypes/libinttypes.a<br>
+<br>
+psxinttypes01$(EXEEXT): $(psxinttypes01_OBJECTS) $(psxinttypes01_DEPENDENCIES)<br>
+       @rm -f psxinttypes01$(EXEEXT)<br>
+       $(make-exe)<br>
+<br>
+include $(top_srcdir)/../automake/<a href="http://local.am" rel="noreferrer" target="_blank">loca<wbr>l.am</a><br>
diff --git a/testsuites/psxtests/<wbr>psxinttypes01/init.c b/testsuites/psxtests/<wbr>psxinttypes01/init.c<br>
new file mode 100644<br>
index 0000000..770b04d<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/<wbr>psxinttypes01/init.c<br>
@@ -0,0 +1,107 @@<br>
+/*<br>
+ *  This is the test for inttypes library. It covers these functions :<br>
+ *  imaxabs(), imaxdiv(), strtoimax(), strtoumax(), wcstoimax(), wcstoumax().<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <rtems/inttypes.h><br>
+#include <rtems/printer.h><br>
+#include <rtems/test.h><br>
+#include <stdlib.h><br>
+#include <tmacros.h><br>
+<br>
+/* forward declarations to avoid warnings */<br>
+<br>
+rtems_task Init(rtems_task_argument argument);<br>
+const char rtems_test_name[] = "PSXINTTYPE 01";<br>
+rtems_printer rtems_test_printer;<br>
+<br>
+/*<br>
+ * RTEMS Startup Task<br>
+ */<br>
+<br>
+rtems_task Init(<br>
+  rtems_task_argument ignored<br>
+)<br>
+{<br>
+  rtems_print_printer_printf(&<wbr>rtems_test_printer);<br>
+  rtems_test_begin();<br>
+<br>
+  char* endptr, *nptr;<br>
+<br>
+  uintmax_t j, k;<br>
+<br>
+  int base = 10;<br>
+  rtems_test_assert (base == EINVAL)<br>
+<br>
+  wchar_t *nptr1, *endptr1;<br>
+<br>
+  intmax_t m, n;<br>
+<br>
+  nptr1 = L"10110134932";<br>
+  nptr  = "20690239864abc";<br>
+<br>
+  /* Test for wcstoimax */<br>
+<br>
+  m = wcstoimax(nptr1, &endptr1, base);<br>
+  rtems_test_assert (m == ERANGE)<br>
+  rtems_test_assert (m == EINVAL)<br>
+<br>
+  printf( "wcstoimax = %jd\n", m );<br>
+<br>
+  /* test for strtoumax */<br>
+<br>
+  j = strtoumax (nptr, &endptr, base);<br>
+  rtems_test_assert (j == ERANGE);<br>
+  rtems_test_assert (j == EINVAL)<br>
+<br>
+  printf( "strtoumax = %ju ( base %d )\n", j, base );<br>
+  printf( "Stopped scan at %s\n\n", endptr );<br>
+<br>
+  /*test for wcstoumax */<br>
+<br>
+  k = wcstoumax (nptr1, &endptr1, base);<br>
+  rtems_test_assert (k == ERANGE)<br>
+  rtems_test_assert (k == EINVAL)<br>
+<br>
+  printf( "wcstoumax = %ju\n", k );<br>
+<br>
+  /*Test for imaxdiv */<br>
+<br>
+  imaxdiv_t retrival = imaxdiv ( 27, 4 );<br>
+  printf( "imax div value = %jd\n", retrival.rem );<br>
+<br>
+  /*Test for imaxabs  */<br>
+<br>
+  printf( "imaxabs_value = %jd\n", imaxabs (-1234));<br>
+<br>
+  /*Test for strtoimax */<br>
+<br>
+  n = strtoimax ("11111111", &endptr, 2)<br>
+  rtems_test_assert (n == ERANGE)<br>
+  rtems_test_assert (n == EINVAL)<br>
+<br>
+  printf( "strtoimax value = %jd\n", n);<br>
+<br>
+<br>
+  rtems_test_end();<br>
+  exit( 0 );<br>
+}<br>
+<br>
+/* NOTICE: the clock driver is explicitly disabled */<br>
+<br>
+#define CONFIGURE_APPLICATION_DOES_<wbr>NOT_NEED_CLOCK_DRIVER<br>
+#define CONFIGURE_APPLICATION_NEEDS_<wbr>CONSOLE_DRIVER<br>
+<br>
+#define CONFIGURE_MAXIMUM_TASKS            1<br>
+<br>
+#define CONFIGURE_RTEMS_INIT_TASKS_<wbr>TABLE<br>
+<br>
+#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION<br>
+<br>
+#define CONFIGURE_INIT<br>
+#include <rtems/confdefs.h><br>
+<br>
diff --git a/testsuites/psxtests/<wbr>psxinttypes01/psxinttypes01.<wbr>scn b/testsuites/psxtests/<wbr>psxinttypes01/psxinttypes01.<wbr>scn<br>
new file mode 100644<br>
index 0000000..1625fa7<br>
--- /dev/null<br>
+++ b/testsuites/psxtests/<wbr>psxinttypes01/psxinttypes01.<wbr>scn<br>
@@ -0,0 +1,9 @@<br>
+*** BEGIN OF TEST PSXINTTYPE 01 ***<br>
+wcstoimax = 10110134932<br>
+strtoumax = 20690239864 (base 10)<br>
+Stopped scan at abc<br>
+wcstoumax = 10110134932<br>
+imax div value = 3<br>
+imaxabs_value = 1234<br>
+strtoimax value = 255<br>
+*** END OF TEST PSXINTTYPE 01 ***<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</font></span></blockquote></div><br></div>