<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 12, 2019 at 3:26 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 Mon, Jun 10, 2019 at 10:38 PM Vaibhav Gupta <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank">vaibhavgupta40@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Mon, Jun 10, 2019 at 10:01 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br>
>><br>
>> Hi Vaibhav,<br>
>><br>
>> This is getting better, see below for review comments.<br>
>><br>
>> On Mon, Jun 10, 2019 at 4:48 AM Vaibhav Gupta <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank">vaibhavgupta40@gmail.com</a>> wrote:<br>
>> > + puts( "2 - Valid Inputs - Negative Number" );<br>
>> > + result_strtoumax = strtoumax( nptr1_n, &endptr1, base );<br>
>> > + puts( "Checking Results" );<br>
>> > + rtems_test_assert( result_strtoumax == ( UINTMAX_MAX - 123 + 1 ) );<br>
>> > + puts( "PASS" );<br>
>> Is it expected to convert the negative number correctly like this?<br>
><br>
> In previous code, the test was rtems_test_assert( result_strtoumax != 0 );<br>
> On suggestion, I converted it to assert it with the output instead of zero.<br>
> .<br>
> I matched it with output, ( UINTMAX_MAX - 123 + 1 ) is giving correct result.<br>
> Can you brief, how else I should convert this negative number?<br>
<br>
I just meant is it guaranteed that the conversion will treat a<br>
negative string as a 2s complement integer. I guess it is fine to<br>
leave it.<br></blockquote><div>Okay then, for the sake of test, for negative numbers, I will assert it using zero: rtems_test_assert( result_strtoumax != 0 );</div><div>It will make sure that conversion took place. <br></div><div>-Vaibhav Gupta<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>
-Gedare<br>
</blockquote></div></div>