From patchwork Fri Aug 26 17:58:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 111811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DF781B6F7D for ; Sat, 27 Aug 2011 03:58:49 +1000 (EST) Received: from localhost ([::1]:38505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx0fz-0005d8-9c for incoming@patchwork.ozlabs.org; Fri, 26 Aug 2011 13:58:43 -0400 Received: from eggs.gnu.org ([140.186.70.92]:36991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx0ft-0005cp-H5 for qemu-devel@nongnu.org; Fri, 26 Aug 2011 13:58:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qx0fs-0007qh-79 for qemu-devel@nongnu.org; Fri, 26 Aug 2011 13:58:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx0fr-0007qd-Oo for qemu-devel@nongnu.org; Fri, 26 Aug 2011 13:58:36 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7QHwH9n004010 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Aug 2011 13:58:18 -0400 Received: from doriath (ovpn-113-108.phx2.redhat.com [10.3.113.108]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7QHwFC7024709; Fri, 26 Aug 2011 13:58:16 -0400 Date: Fri, 26 Aug 2011 14:58:15 -0300 From: Luiz Capitulino To: Jan Kiszka Message-ID: <20110826145815.3b4242ef@doriath> In-Reply-To: <4E57DD4B.4090302@siemens.com> References: <4E57CE74.5070708@siemens.com> <20110826144325.0a41947a@doriath> <4E57DD4B.4090302@siemens.com> Organization: Red Hat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Anthony Liguori , qemu-devel , "mdroth@linux.vnet.ibm.com" Subject: Re: [Qemu-devel] [PATCH] Fix qjson test of solidus encoding X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Fri, 26 Aug 2011 19:52:11 +0200 Jan Kiszka wrote: > On 2011-08-26 19:43, Luiz Capitulino wrote: > > On Fri, 26 Aug 2011 18:48:52 +0200 > > Jan Kiszka wrote: > > > >> Hi all, > >> > >> current master has some qregressions: > >> > >> # ./check-qdict > >> Running suite(s): QDict test-suite > >> 93%: Checks: 16, Failures: 1, Errors: 0 > >> check-qdict.c:289:F:Stress Test:qdict_stress_test:0: Assertion 'test_file != NULL' failed > > > > I guess you build qemu from a different directory, right? This test only > > works from the source dir. I'll fix it (actually I thought I had already fixed it!). > > Yes, found that reason already. Works fine when fed with the test data > as expected. Fix below. > >> # ./check-qjson > >> Running suite(s): QJSON test-suite > >> 95%: Checks: 21, Failures: 1, Errors: 0 > >> check-qjson.c:59:F:String Literals:escaped_string:0: / != \/ > > > > I found this problem while reading the parser code and added the test > > so that we don't forget fixing it. However, at the time I looked at the > > issue, I didn't know how to fix it. > > > > Michael, would you mind to take a look at it? > > After reading the spec I tend to think it's a test bug: Seems good to me. What do you think Anthony/Michael? > > -------8<------- > > "\/" is supposed to be decoded as "/", but there is no need to encode > "/" via escape. Fix the existing test and add a second one expressing > this. > > Signed-off-by: Jan Kiszka > --- > check-qjson.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/check-qjson.c b/check-qjson.c > index 64fcdcb..36d4ac2 100644 > --- a/check-qjson.c > +++ b/check-qjson.c > @@ -33,7 +33,8 @@ START_TEST(escaped_string) > { "\"\\n\"", "\n" }, > { "\"\\r\"", "\r" }, > { "\"\\t\"", "\t" }, > - { "\"\\/\"", "\\/" }, > + { "\"/\"", "/" }, > + { "\"\\/\"", "/", .skip = 1 }, > { "\"\\\\\"", "\\" }, > { "\"\\\"\"", "\"" }, > { "\"hello world \\\"embedded string\\\"\"", diff --git a/configure b/configure index 1340c33..7fab4de 100755 --- a/configure +++ b/configure @@ -3601,7 +3601,7 @@ DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS fsdev ui" DIRS="$DIRS qapi" DIRS="$DIRS qga" -FILES="Makefile tests/Makefile" +FILES="Makefile tests/Makefile qdict-test-data.txt" FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile"