3 ms·
Nice. Comprehensive unit tests are indeed welcome. Even a simple test code that tests all features, flags combinations, etc, and outputs a log. It will make ea
by s_gourichon 1y ago
Nice. Comprehensive unit tests are indeed welcome.
Even a simple test code that tests all features, flags combinations, etc, and outputs a log.
It will make easy for anyone to run it and compare the logs.
I had a bug:
u_printf( my_output_cb, NULL, "%d" NL, -42 );
prints:
--42
I may have found an explanation.
In u_parse_format(),
case 'i':
calls
u_itoa( value, buffer, 10, false );
which outputs minus sign.
Then
if ( number )
does
if ( sign )
{
output_cb( '-', ctx );
chars_written++;
}
which outputs another minus sign.
- s_gourichon 1y agoAlso floats seem to "forget" the integer part, and also have two minus signs when negative.
- s_gourichon 1y agoCreated https://github.com/Ferki-git-creator/Uprintf/issues/1 https://github.com/Ferki-git-creator/Uprintf/issues/1 https://github.com/Ferki-git-creator/Uprintf/issues/2 https://github.com/Ferki-git-creator/Uprintf/issues/2 https://github.com/Ferki-git-creator/Uprintf/pull/3 https://github.com/Ferki-git-creator/Uprintf/pull/3 https://github.com/Ferki-git-creator/Uprintf/pull/4 https://github.com/Ferki-git-creator/Uprintf/pull/4
- Forgret 1y agoThanks, I will review your PR, and I have to thank you very much for saving my time and correcting the error.