<div dir="ltr"><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 4, 2020 at 12:27 AM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</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">On Fri, Apr 3, 2020 at 12:50 PM Eshan dhawan <<a href="mailto:eshandhawan51@gmail.com" target="_blank">eshandhawan51@gmail.com</a>> wrote:<br>
><br>
> ---<br>
> testsuites/psxtests/psxinttypes01/init.c | 27 ++++++++++++++++---<br>
> .../psxtests/psxinttypes01/psxinttypes01.doc | 10 ++++++-<br>
> 2 files changed, 33 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/testsuites/psxtests/psxinttypes01/init.c b/testsuites/psxtests/psxinttypes01/init.c<br>
> index 030aa2aa57..4c45fdf3a2 100644<br>
> --- a/testsuites/psxtests/psxinttypes01/init.c<br>
> +++ b/testsuites/psxtests/psxinttypes01/init.c<br>
> @@ -6,6 +6,7 @@<br>
> /*<br>
> * SPDX-License-Identifier: BSD-2-Clause<br>
> *<br>
> + * Copyright (C) 2020, Eshan Dhawan<br>
> * Copyright (C) 2019, Aditya Upadhyay and Vaibhav Gupta<br>
> *<br>
> * Redistribution and use in source and binary forms, with or without<br>
> @@ -64,11 +65,31 @@ rtems_task Init(rtems_task_argument ignored)<br>
> wchar_t *nptr2_n_errange = L"-9999999999999999999999";<br>
> wchar_t *endptr2 = NULL;<br>
><br>
> - intmax_t result_strtoimax;<br>
> + intmax_t result_strtoimax, result_imaxabs, input_1, input_2;<br>
> + imaxdiv_t result_exp, result_imaxdiv;<br>
> uintmax_t result_strtoumax;<br>
><br>
> TEST_BEGIN();<br>
> -<br>
I hate to do this to you, and it's not a hard and fast rule, but I<br>
think the blank line after TEST_BEGIN() should be kept.<br></blockquote><div>The rest is fine i suppose :) <br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> + /* Test for imaxabs */<br>
> + input_1 = -10;<br>
> + result_imaxabs = 10;<br>
> + rtems_test_assert( imaxabs(input_1) == result_imaxabs );<br>
> +<br>
> + input_1 = 10;<br>
> + result_imaxabs = 10;<br>
> + rtems_test_assert( imaxabs(input_1) == result_imaxabs );<br>
> +<br>
> + /* Test for imaxdiv */<br>
> + input_1 = 10;<br>
> + input_2 = 3;<br>
> + result_exp.quot = input_1 / input_2;<br>
> + result_exp.rem = input_1 % input_2;<br>
> + result_imaxdiv = imaxdiv( input_1, input_2 );<br>
> + rtems_test_assert(<br>
> + result_imaxdiv.quot == result_exp.quot &&<br>
> + result_imaxdiv.rem == result_exp.rem<br>
> + );<br>
> +<br>
> /* Test for strtoimax */<br>
> puts( "\nstrtoimax Testcases...." );<br>
> puts( "Valid Inputs - Positive Number" );<br>
> @@ -83,7 +104,7 @@ rtems_task Init(rtems_task_argument ignored)<br>
> rtems_test_assert( result_strtoimax == -123 );<br>
><br>
> puts( "Final string pointed by endptr" );<br>
> - rtems_test_assert( endptr1 == ( nptr1_n + 4 ) );<br>
> + rtems_test_assert( endptr1 == ( nptr1_n + 4 ) );<br>
><br>
> puts( "Valid Input - Positive Number - Number out of Range" );<br>
> result_strtoimax = strtoimax( nptr1_p_errange, &endptr1, base );<br>
> diff --git a/testsuites/psxtests/psxinttypes01/psxinttypes01.doc b/testsuites/psxtests/psxinttypes01/psxinttypes01.doc<br>
> index 19f63af34b..59b76796e2 100644<br>
> --- a/testsuites/psxtests/psxinttypes01/psxinttypes01.doc<br>
> +++ b/testsuites/psxtests/psxinttypes01/psxinttypes01.doc<br>
> @@ -1,4 +1,4 @@<br>
> -This File describes the concepts tested by this test suite.<br>
> +This File describes the concepts tested by this test suite.<br>
><br>
> inttypes.h - fixed size integer types<br>
><br>
> @@ -37,3 +37,11 @@ test suite name: PSXINTTYPE 01<br>
> - checks for output for string having a negative number - Number Out of Range<br>
> - checks for final string pointed by endptr<br>
> - checks for output for invalid argument - Invalid Base<br>
> +<br>
> +- Checks for imaxabs Testcases<br>
> + - checks for output with an input with any negative number<br>
> + - checks for output with an input with any positive number<br>
> +<br>
> +- Checks for imaxdiv Testcases<br>
> + - checks for the output quotient and remainder with input with positive numbers<br>
> +<br>
> --<br>
> 2.17.1<br>
><br>
</blockquote></div></div>