[PATCH] Merge/shared string_printf and string_vprintf unit tests
Pedro Alves
palves@redhat.com
Mon Oct 30 11:47:00 GMT 2017
On 10/18/2017 06:40 PM, John Baldwin wrote:
> On Monday, October 16, 2017 11:57:57 PM Pedro Alves wrote:
>> Merge the string_printf and string_vprintf tests, running them all
>> against both functions.
>>
>> gdb/ChangeLog:
>> 2017-10-16 Pedro Alves <palves@redhat.com>
>>
>> * unittests/common-utils-selftests.c (format_func): New typedef.
>> (string_printf_tests, string_vprintf_tests): Tests factored out
>> and merged to ...
>> (test_format_func): ... this new function.
>> (string_printf_tests, string_vprintf_tests): Reimplement on top of
>> test_format_func.
>
> Looks good to me.
>
Thanks much for the review John. I've pushed this in now, with a
tweak to add ATTRIBUTE_PRINTF where appropriate:
typedef std::string (format_func) (const char *fmt, ...)
ATTRIBUTE_PRINTF (1, 2);
static void ATTRIBUTE_PRINTF (2, 3)
string_vappendf_wrapper (std::string &str, const char *fmt, ...)
... after noticing Simon's recent similar change to this file
that meanwhile went in.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list