<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 Jun, 2019, 2:02 AM Gedare Bloom, <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Jun 3, 2019 at 8:37 AM Aditya Upadhyay <<a href="mailto:aadit0402@gmail.com" target="_blank" rel="noreferrer">aadit0402@gmail.com</a>> wrote:<br>
><br>
> On Sat, Jun 1, 2019 at 10:22 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
> ><br>
> ><br>
> ><br>
> > On Sat, Jun 1, 2019, 8:29 AM Aditya Upadhyay <<a href="mailto:aadit0402@gmail.com" target="_blank" rel="noreferrer">aadit0402@gmail.com</a>> wrote:<br>
> >><br>
> >> On Sat, Jun 1, 2019 at 5:03 AM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
> >> ><br>
> >> > On Fri, May 31, 2019 at 10:17 AM Aditya Upadhyay <<a href="mailto:aadit0402@gmail.com" target="_blank" rel="noreferrer">aadit0402@gmail.com</a>> wrote:<br>
> >> > ><br>
> >> > > Hi VARoDeK,<br>
> >> > ><br>
> >> > > This looks fine to me. I would love to see other's responses.<br>
> >> > ><br>
> >> ><br>
> >> > This test is not right, it needs to be rethought. Let me know if you<br>
> >> > need further guidance.<br>
> >> ><br>
> >> Yeah, Gedare !! I need some further guidance. I had written this test<br>
> >> 1 year ago, but could not send it on devel.<br>
> >> I was writing this testsuite for the very first time.<br>
> ><br>
> ><br>
> > If you wrote the test, your name should belong in the copyright info.<br>
> ><br>
> I had handed over this code to Vaibhav for sake of learning purposes.<br>
> If Community<br>
> does not allow this, Then I would take it back. I would appreciate<br>
> your thought on that.<br>
><br>
<br>
It is perfectly acceptable (and normal) for a student to carry-on with<br>
someone else's code, but the original author's contribution (and<br>
copyright) need to be maintained. Usually, what we prefer is to have<br>
a commit with the original author's code, and then additional commits<br>
to change it as needed.<br></blockquote></div></div><div dir="auto">Yes, actually we discussed about same, and then he asked me to add my name as i was going to send it to devel. Things were new for me too. I will put his name only now on copyright info.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> >> Could you please point me an example?<br>
> ><br>
> ><br>
> > Which psxtest was this derived from? Is there a psxtest that considers string conversions? That would be a good start. Do some digging.<br>
> ><br>
> Thanks for pointing it out. Though I am working on a needed<br>
> correction. Would It be a wise choice to test cases<br>
> for each inttypes methods?<br>
><br>
> > The logic of the test needs to be thought out. What is the expected behavior being tested? How do you isolate correct/incorrect behavior?<br>
> ><br>
> I had used hardcoded input only for the success of the operation. I<br>
> will also consider the expected behavior for Invalid inputs.<br>
><br>
> > Gedare<br>
> ><br>
> >> Although I have gone through<br>
> >> open group POSIX<br>
> >> Page and looked into some previously made testsuites in the psxtests directory.<br>
> >><br>
> >> While configuring, I had used --enable-tests=yes option, but I do not<br>
> >> see any generated .exe file.<br>
> >> or Can we generate the .exe file manually?<br>
> >><br>
> >><br>
> >> > > On Thu, May 30, 2019 at 8:47 PM VARoDeK <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank" rel="noreferrer">vaibhavgupta40@gmail.com</a>> wrote:<br>
> >> > > ><br>
> >> > > > ---<br>
> >> > > > testsuites/psxtests/Makefile.am | 7 +<br>
> >> > > > testsuites/psxtests/<a href="http://configure.ac" rel="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" target="_blank">configure.ac</a> b/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer noreferrer" target="_blank">configure.ac</a><br>
> >> > > > index cdd6ee7e4e..e032a6f5ec 100644<br>
> >> > > > --- a/testsuites/psxtests/<a href="http://configure.ac" rel="noreferrer noreferrer" target="_blank">configure.ac</a><br>
> >> > > > +++ b/testsuites/psxtests/<a href="http://configure.ac" rel="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>
</blockquote></div></div></div>