This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Merge/shared string_printf and string_vprintf unit tests
- From: Pedro Alves <palves at redhat dot com>
- To: John Baldwin <jhb at freebsd dot org>, gdb-patches at sourceware dot org
- Date: Mon, 30 Oct 2017 11:46:56 +0000
- Subject: Re: [PATCH] Merge/shared string_printf and string_vprintf unit tests
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AA61481DF3
- References: <1508194677-19549-1-git-send-email-palves@redhat.com> <2358777.gznjGWP7tP@ralph.baldwin.cx>
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