Closed kitterion closed 1 year ago
Hi,
Thank you for your contribution! I have reviewed the patch and I don't see anything wrong. Could you add some basic tests for this m_string_cat_printf function in test-mstring.c? Thanks.
Sure, there are already some tests of string_cat_printf
in there, would you like me to write some more?
Yes. Only a basic test of the function string_cat_vprintf is needed to ensure having a working user API. The coverage should already be ok since the coverage of string_cat_printf was ok (you can check coverage with "make coverage" which should give 100% for strings).
I'm not exactly sure if this is what you meant, but I added some tests by essentially copying corresponding string_cat_printf
tests. These are not new and unique, as I'm not sure that's required or even desired in this particular case.
It seems weird that there are both
m_string_printf
andm_string_vprintf
butm_string_cat_printf
doesn't have avprintf
variant, so here I add the missing function. I think because of this, flipperzero firmware (that uses m-string) has to allocate a new string in its string_cat_vprintf implementation instead of just delegating to an appropriatevprintf
function, like it does in itsstring_vprintf
here.