From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wg91P-0001T3-RO for qemu-devel@nongnu.org; Fri, 02 May 2014 04:40:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wg91K-0003J5-5U for qemu-devel@nongnu.org; Fri, 02 May 2014 04:40:43 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:64668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wg91J-0003Iq-L0 for qemu-devel@nongnu.org; Fri, 02 May 2014 04:40:38 -0400 Received: by mail-wi0-f171.google.com with SMTP id hm4so1982215wib.4 for ; Fri, 02 May 2014 01:40:36 -0700 (PDT) Date: Fri, 2 May 2014 10:40:33 +0200 From: Stefan Hajnoczi Message-ID: <20140502084033.GC8005@stefanha-thinkpad.redhat.com> References: <1395754039-1849-1-git-send-email-l@dorileo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395754039-1849-1-git-send-email-l@dorileo.org> Subject: Re: [Qemu-devel] [PATCH v3] QemuOpt: add unit tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leandro Dorileo Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, Markus Armbruster , Chunyan Liu , Anthony Liguori , Andreas =?iso-8859-1?Q?F=E4rber?= , Wenchao Xia On Tue, Mar 25, 2014 at 10:27:19AM -0300, Leandro Dorileo wrote: > Cover basic aspects and API usage for QemuOpt. The current implementation > covers the API's planned to be changed by Chunyan Liu in his QEMUOptionParameter > replacement/cleanup job. > > Other APIs should be covered in future improvements. > > Signed-off-by: Leandro Dorileo > Reviewed-by: Eric Blake > --- > tests/Makefile | 3 + > tests/test-qemu-opts.c | 455 +++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 458 insertions(+) > create mode 100644 tests/test-qemu-opts.c Looks useful. I skipped this patch original because you and Chunyan were working on different versions of the QemuOpts conversion series and I wanted to wait until the dust settled on that. > +static void register_opts(void) > +{ > + qemu_add_opts(&opts_list_01); > + qemu_add_opts(&opts_list_02); > + qemu_add_opts(&opts_list_03); > +} > + > +static void test_find_unknown_opts(void) > +{ > + QemuOptsList *list; > + > + register_opts(); Should this function be called once in main() instead? I think you keep adding the same opts lists again and again as the test cases execute.