[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Fix qjson test of solidus encoding
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH] Fix qjson test of solidus encoding |
Date: |
Fri, 26 Aug 2011 19:52:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2011-08-26 19:43, Luiz Capitulino wrote:
> On Fri, 26 Aug 2011 18:48:52 +0200
> Jan Kiszka <address@hidden> 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 <address@hidden>
---
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\\\"\"",
--
1.7.3.4