From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR0a1-0007k9-Fc for qemu-devel@nongnu.org; Fri, 21 Mar 2014 10:37:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WR0Zx-0005q2-2u for qemu-devel@nongnu.org; Fri, 21 Mar 2014 10:37:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR0Zw-0005pj-QH for qemu-devel@nongnu.org; Fri, 21 Mar 2014 10:37:49 -0400 Message-ID: <532C4EB4.6030506@redhat.com> Date: Fri, 21 Mar 2014 08:37:40 -0600 From: Eric Blake MIME-Version: 1.0 References: <1395097833-3021-1-git-send-email-l@dorileo.org> In-Reply-To: <1395097833-3021-1-git-send-email-l@dorileo.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t4r8Lu1VRNGO8RqO2vJgcEnFQb7stNntb" Subject: Re: [Qemu-devel] [PATCH v2] QemuOpt: add unit tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leandro Dorileo , qemu-devel@nongnu.org Cc: Wenchao Xia , Stefan Hajnoczi , Chunyan Liu , Markus Armbruster , Anthony Liguori , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --t4r8Lu1VRNGO8RqO2vJgcEnFQb7stNntb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/17/2014 05:10 PM, Leandro Dorileo wrote: > Cover basic aspects and API usage for QemuOpt. The current implementati= on > covers the API's planned to be changed by Chunyan Liu in his QEMUOption= Parameter > replacement/cleanup job. >=20 > Other APIs should be covered in future improvements. >=20 > Signed-off-by: Leandro Dorileo Right here is where you should stick a --- marker. >=20 > Changes: > v2: > + fixed comments; > + make use of g_assert_cmpstr(); > + use error_abort instead of a local_err for qemu_opts_absorb_qdic= t(); > + asserts on QemuOptsList (empty and list name); > + added test_qemu_opt_unset(); > + asserts on qemu_opt_*_set() return; > + added test_qemu_opts_reset(); > + added test_qemu_opts_set(); > --- It's okay to have a duplicate one; but the main point is that the v2 changelog is useful to reviewers but not to the git log; and anything after the --- marker gets omitted by 'git am' when a maintainer accepts your patch into their pull request. > tests/Makefile | 3 + > tests/test-qemu-opts.c | 455 +++++++++++++++++++++++++++++++++++++++++= ++++++++ > 2 files changed, 458 insertions(+) > create mode 100644 tests/test-qemu-opts.c >=20 > +static void test_qemu_find_opts(void) > +{ > + QemuOptsList *list; > + > + register_opts(); > + > + /* we have an "opts_list_01" option, should return it */ > + list =3D qemu_find_opts("opts_list_01"); > + g_assert(list !=3D NULL); > + g_assert_cmpstr(list->name, =3D=3D, "opts_list_01"); > +} > + > +static void test_qemu_opts_create(void) > +{ > + QemuOptsList *list; > + QemuOpts *opts; > + > + register_opts(); > + > + list =3D qemu_find_opts("opts_list_01"); > + g_assert(list !=3D NULL); > + g_assert(QTAILQ_EMPTY(&list->head)); > + g_assert_cmpstr(list->name, =3D=3D, "opts_list_01"); This test starts as a duplicate of test_qemu_find_opts; I guess that's okay (having both tests means a bit more insight into what broke if one fails but the other passes). > + > +static void test_qemu_opt_unset(void) > +{ > + QemuOpts *opts; > + const char *value; > + int ret; > + > + /* dinamically initialized (parsed) opts */ s/dinamically/dynamically/ That's trivially fixable, so feel free to add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --t4r8Lu1VRNGO8RqO2vJgcEnFQb7stNntb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTLE60AAoJEKeha0olJ0NqYCkH/i51OkylYoArxQasNZF1AThJ yj8uawdKvjymNFxhXOLAP2E1+YnUmjwLLcXM5tifMQTIiCjuohZxTYOrCdsK6wol IwQLc+x0axGwSsrPqlBsVCfSM+YlIY80cDWsFC3wXY+fccJTRnccGide3bkMhKY+ IhFfCqbLK9OdROv6Xgyp2M85O7LBZtWOWyNSmZufhmGd84vZzFsNqgx6bqtwzwg0 PDuDl5BOgP2NX8Iou/o0zlfm1RKwWkWR147OERzpPpjCHBbH+20jt5RBiJecrW3w KyX4PItiQJNZWLOYdPtRM8TS4pF3dav1n/3aDyFjjY++D1LTkiPqdCSGMTOKd78= =Ar3T -----END PGP SIGNATURE----- --t4r8Lu1VRNGO8RqO2vJgcEnFQb7stNntb--