From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy2gs-0003W0-PW for qemu-devel@nongnu.org; Mon, 29 Aug 2011 10:19:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qy2gr-0002zI-PM for qemu-devel@nongnu.org; Mon, 29 Aug 2011 10:19:54 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:38703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy2gr-0002yK-GY for qemu-devel@nongnu.org; Mon, 29 Aug 2011 10:19:53 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p7TDtF6K020569 for ; Mon, 29 Aug 2011 09:55:15 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7TEJh7r214982 for ; Mon, 29 Aug 2011 10:19:45 -0400 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7T8JVUT030798 for ; Mon, 29 Aug 2011 02:19:31 -0600 Message-ID: <4E5B9FF2.4060908@linux.vnet.ibm.com> Date: Mon, 29 Aug 2011 09:19:30 -0500 From: Michael Roth MIME-Version: 1.0 References: <4E57CE74.5070708@siemens.com> <20110826144325.0a41947a@doriath> <4E57DD4B.4090302@siemens.com> In-Reply-To: <4E57DD4B.4090302@siemens.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix qjson test of solidus encoding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , qemu-devel , Luiz Capitulino On 08/26/2011 12:52 PM, 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. > >> >>> # ./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: > > -------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\\\"\"", Acked-by: Michael Roth