Offlist - Introduce Yourself to Community
aditya upadhyay
aadit0402 at gmail.com
Mon May 15 19:38:31 UTC 2017
Hello All,
I have ported the code of inttypes library and i have tested methods
related to inttypes.h in hello world test. It is working. Then i made a
separate test for psxinttypes01 in samples directory and it's also working.
I made this test within the psxtests directory then how would i check
whether test is working or not ? The location of psxinttypes01 is :
/development/rtems4.12-1/testsuits/psxtests/psxinttypes01.
Just for learning purpose, if i put psxtests instead of samples in this
command : ../rtems4.12-1/configure --target=sparc-rtems4.12
--enable-rtemsbsp=erc32 --enable-tests=samples --disable-posix
and after make command, Will it generate .exe files related to psxtests ?
do i have to send the ported code or can i submit the ported code to my
github repository.. ? Any suggestion ?
Please find the attached patch and review the tested methods.
patch1 is for methods tested within the hello world file.
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 1987586..5c4dc15 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -7,6 +7,7 @@ include $(top_srcdir)/automake/multilib.am
SUBDIRS = . score rtems sapi posix
SUBDIRS += dev
SUBDIRS += dtc/libfdt
+SUBDIRS += inttypes
SUBDIRS += libcrypt
SUBDIRS += libcsupport libblock libfs
SUBDIRS += libdrvmgr
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 67237e9..5110c07 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -479,6 +479,7 @@ libstdthreads/Makefile
libdebugger/Makefile
zlib/Makefile
ftpd/Makefile
+inttypes/Makefile
telnetd/Makefile
pppd/Makefile
mghttpd/Makefile
diff --git a/cpukit/include/rtems/inttypes.h
b/cpukit/include/rtems/inttypes.h
index 2e23c8c..d2f9f55 100644
--- a/cpukit/include/rtems/inttypes.h
+++ b/cpukit/include/rtems/inttypes.h
@@ -153,3 +153,4 @@ extern "C" {
#endif
#endif
diff --git a/testsuites/psxtests/Makefile.am
b/testsuites/psxtests/Makefile.am
index 7bcea46..65325da 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -58,6 +58,7 @@ _SUBDIRS += psxhdrs
_SUBDIRS += psxintrcritical01
_SUBDIRS += psxitimer
endif
+_SUBDIRS += psxinttypes01
_SUBDIRS += psxkey01
_SUBDIRS += psxkey02
_SUBDIRS += psxkey03
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/
configure.ac
index 1de1312..227bda9 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -163,6 +163,7 @@ psximfs01/Makefile
psximfs02/Makefile
psxintrcritical01/Makefile
psxitimer/Makefile
+psxinttypes01/Makefile
psxkey01/Makefile
psxkey02/Makefile
psxkey03/Makefile
diff --git a/testsuites/samples/hello/Makefile.am
b/testsuites/samples/hello/Makefile.am
index 234a27e..c7f7e2a 100644
--- a/testsuites/samples/hello/Makefile.am
+++ b/testsuites/samples/hello/Makefile.am
@@ -9,9 +9,10 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
-LINK_OBJS = $(hello_OBJECTS)
-LINK_LIBS = $(hello_LDLIBS)
+LINK_OBJS = $(hello_OBJECTS) $(hello_LDADD)
+LINK_LIBS = $(hello_LDLIBS)
/home/aditya/development/b-sparc/sparc-rtems4.12/c/erc32/cpukit/inttypes/libinttypes.a
hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES)
@rm -f hello$(EXEEXT)
diff --git a/testsuites/samples/hello/init.c
b/testsuites/samples/hello/init.c
index a2d6c30..51f4451 100644
--- a/testsuites/samples/hello/init.c
+++ b/testsuites/samples/hello/init.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <rtems/inttypes.h>
/* forward declarations to avoid warnings */
rtems_task Init(rtems_task_argument argument);
@@ -31,7 +32,34 @@ rtems_task Init(
{
rtems_print_printer_printf(&rtems_test_printer);
rtems_test_begin();
+ char* endptr;
+ uintmax_t j,k;
+ int base = 10;
+ char *nptr;
+ wchar_t *nptr1, *endptr1;
+ intmax_t m;
+ nptr1 = L"10110134932";
+ nptr = "20690239864abc";
+ m = wcstoimax(nptr1, &endptr1,
base);
+ printf("string = %s\n", nptr);
+ j = strtoumax(nptr, &endptr, base);
+ printf("wcstoimax = %jd\n", m);
+ k = wcstoumax(nptr1, &endptr1, base);
+ printf("wcstoumax = %ju\n", k);
+ printf("strtoumax = %ju (base %d)\n", j, base);
+ printf("Stopped scan at %s\n\n", endptr);
+ imaxdiv_t retrival = imaxdiv(27, 4);
printf( "Hello World\n" );
+ printf(" Strtoimax values \n");
+ printf("%jd\n", strtoimax(" -123junk",&endptr,10)); /* base
10 */
+ printf("%jd\n", strtoimax("11111111",&endptr,2)); /* base
2 */
+ printf("%jd\n", strtoimax("XyZ",&endptr,36)); /* base
36 */
+ printf("%jd\n", strtoimax("010",&endptr,0)); /* octal
auto-detection */
+ printf("%jd\n", strtoimax("10",&endptr,0)); /* decimal
auto-detection */
+ printf("%jd\n", strtoimax("0x10",&endptr,0)); /* hexadecimal
auto-detection */
+ printf( "imaxabs_value = %jd\n", imaxabs(-1234));
+ printf("strtoimax value = %jd\n", strtoimax("11111111",&endptr,2));
+ printf( "imax div value = %jd\n", retrival.rem);
rtems_test_end();
exit( 0 );
}
patch2 is for separate test psxinttypes01 within the samples directory.
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 1987586..5c4dc15 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -7,6 +7,7 @@ include $(top_srcdir)/automake/multilib.am
SUBDIRS = . score rtems sapi posix
SUBDIRS += dev
SUBDIRS += dtc/libfdt
+SUBDIRS += inttypes
SUBDIRS += libcrypt
SUBDIRS += libcsupport libblock libfs
SUBDIRS += libdrvmgr
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 67237e9..5110c07 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -479,6 +479,7 @@ libstdthreads/Makefile
libdebugger/Makefile
zlib/Makefile
ftpd/Makefile
+inttypes/Makefile
telnetd/Makefile
pppd/Makefile
mghttpd/Makefile
diff --git a/cpukit/include/rtems/inttypes.h
b/cpukit/include/rtems/inttypes.h
index 2e23c8c..d2f9f55 100644
--- a/cpukit/include/rtems/inttypes.h
+++ b/cpukit/include/rtems/inttypes.h
@@ -153,3 +153,4 @@ extern "C" {
#endif
#endif
+
diff --git a/cpukit/rtems/src/ratemonreportstatistics.c
b/cpukit/rtems/src/ratemonreportstatistics.c
index 0ea7790..76f032e 100644
--- a/cpukit/rtems/src/ratemonreportstatistics.c
+++ b/cpukit/rtems/src/ratemonreportstatistics.c
@@ -156,3 +156,4 @@ void rtems_rate_monotonic_report_statistics( void )
rtems_print_printer_printk( &printer );
rtems_rate_monotonic_report_statistics_with_plugin( &printer );
}
+
diff --git a/testsuites/samples/Makefile.am b/testsuites/samples/Makefile.am
index 85e89a5..f710aab 100644
--- a/testsuites/samples/Makefile.am
+++ b/testsuites/samples/Makefile.am
@@ -9,6 +9,7 @@ _SUBDIRS += minimum
_SUBDIRS += nsecs
_SUBDIRS += paranoia
_SUBDIRS += ticker
+_SUBDIRS += psxinttypes01
_SUBDIRS += unlimited
if MPTESTS
diff --git a/testsuites/samples/configure.ac b/testsuites/samples/
configure.ac
index ffe1bad..95ff87a 100644
--- a/testsuites/samples/configure.ac
+++ b/testsuites/samples/configure.ac
@@ -75,6 +75,7 @@ nsecs/Makefile
paranoia/Makefile
pppd/Makefile
ticker/Makefile
+psxinttypes01/Makefile
unlimited/Makefile
])
AC_OUTPUT
diff --git a/testsuites/samples/hello/Makefile.am
b/testsuites/samples/hello/Makefile.am
index 234a27e..3a05a39 100644
--- a/testsuites/samples/hello/Makefile.am
+++ b/testsuites/samples/hello/Makefile.am
@@ -1,6 +1,6 @@
rtems_tests_PROGRAMS = hello
-hello_SOURCES = init.c
+hello_SOURCES = init.c libinttypes.a
dist_rtems_tests_DATA = hello.scn
dist_rtems_tests_DATA += hello.doc
@@ -9,9 +9,10 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
-LINK_OBJS = $(hello_OBJECTS)
-LINK_LIBS = $(hello_LDLIBS)
+LINK_OBJS = $(hello_OBJECTS) $(hello_LDADD)
+LINK_LIBS = $(hello_LDLIBS)
/home/aditya/development/b-sparc/sparc-rtems4.12/c/erc32/cpukit/inttypes/libinttypes.a
hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES)
@rm -f hello$(EXEEXT)
diff --git a/testsuites/samples/hello/init.c
b/testsuites/samples/hello/init.c
index a2d6c30..d1fd577 100644
--- a/testsuites/samples/hello/init.c
+++ b/testsuites/samples/hello/init.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <rtems/inttypes.h>
/* forward declarations to avoid warnings */
rtems_task Init(rtems_task_argument argument);
Thanks & Regards,
Aditya
On Mon, May 15, 2017 at 9:55 PM, Joel Sherrill <joel at rtems.org> wrote:
> I am not in a good position to review this today but patches should go to
> the community for review. Also this one has a ticket.
>
> --joel
>
> On May 14, 2017 11:33 PM, "aditya upadhyay" <aadit0402 at gmail.com> wrote:
>
>> Hello Joel, Gedare,
>>
>> I have ported the code of inttypes library and i have tested methods
>> related to inttypes.h in hello world test. It is working. I have made a
>> test related to inttypes methods named as psxinttype01. where i have tested
>> these method. The location of psxinttypes01 is :
>> /development/rtems4.12-1/testsuits/psxtests/psxinttypes01.
>>
>> Just for learning purpose, if i put psxtests instead of samples in this
>> command : ../rtems4.12-1/configure --target=sparc-rtems4.12
>> --enable-rtemsbsp=erc32 --enable-tests=samples --disable-posix
>>
>> and after make command, Will it generate .exe files related to psxtests ?
>> do i have to send the ported code or can i submit the ported code to my
>> github repository.. ? Any suggestion ?
>> I am sending you the patch of tested code. please review the tested
>> methods.
>>
>> Thanks & Regards,
>> Aditya
>>
>>
>>
>> On Fri, May 12, 2017 at 9:41 PM, aditya upadhyay <aadit0402 at gmail.com>
>> wrote:
>>
>>> Hello Joe, Gedare,
>>>
>>> I was busy with my end semester project. I will introduce myself there.
>>> Apart from that now i am trying to make a test for inttypes library as You
>>> have told me in previous mail. I will do it by tonight.
>>>
>>> Thanks & Regards,
>>> Aditya
>>>
>>> On Fri, May 12, 2017 at 9:33 PM, Joel Sherrill <joel at rtems.org> wrote:
>>>
>>>> Hi
>>>>
>>>> Gedare sent an email asking all students to introduce themselves and
>>>> their project to the community. You haven't done it yet.
>>>>
>>>> Thanks
>>>>
>>>>
>>>> --joel
>>>>
>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170516/ef5beb21/attachment-0001.html>
More information about the devel
mailing list