Skip to contentSkip to conversation

check-qdict and check-qjson fail

Qemu-devel Applied Jan Kiszka 3 participants 7 messages Aug 26, 2011 – Aug 29, 2011

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

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
# ./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: / != \/

Already known?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 8 lines · On Fri, 26 Aug 2011 18:48:52 +0200 Jan Kiszka <[email protected]> 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!).

Quoted 4 lines
# ./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?

Quoted 5 lines

Already known?

Jan

author
#2 lore raw

PATCH 1/1 Fix qjson test of solidus encoding

Quoted 7 lines · Luiz Capitulino
Quoted 4 lines · On Fri, 26 Aug 2011 18:48:52 +0200 Jan Kiszka <[email protected]> wrote:

Hi all,

current master has some qregressions:

Quoted 7 lines
Quoted 4 lines
# ./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.

Quoted 11 lines
Quoted 5 lines
# ./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.

---
 check-qjson.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
check-qjson.c +2 -1
index 64fcdcb..36d4ac2 100644
@@ -33,7 +33,8 @@ START_TEST(escaped_string)
         { "\"\\n\"", "\n" },
         { "\"\\r\"", "\r" },
         { "\"\\t\"", "\t" },
-        { "\"\\/\"", "\\/" },
+        { "\"/\"", "/" },
+        { "\"\\/\"", "/", .skip = 1 },
         { "\"\\\\\"", "\\" },
         { "\"\\\"\"", "\"" },
         { "\"hello world \\\"embedded string\\\"\"",
Signature · 1 line
1.7.3.4
#3 lore raw

Re: [Qemu-devel] [PATCH] Fix qjson test of solidus encoding

Quoted 13 lines · On Fri, 26 Aug 2011 19:52:11 +0200 Jan Kiszka <[email protected]> wrote:
Quoted 12 lines · Luiz Capitulino
Quoted 8 lines · On Fri, 26 Aug 2011 18:48:52 +0200 Jan Kiszka <[email protected]> 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
Quoted 5 lines
Quoted 2 lines

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.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
# ./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: / != \/
Quoted 7 lines
Quoted 5 lines

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?

Quoted 17 lines

-------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.

---
 check-qjson.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
check-qjson.c +0 -0
index 64fcdcb..36d4ac2 100644

check-qjson.c START_TEST(escaped_string) · line 40

Quoted 9 lines
check-qjson.c +2 -1
@@ -33,7 +33,8 @@ START_TEST(escaped_string)
         { "\"\\n\"", "\n" },
         { "\"\\r\"", "\r" },
         { "\"\\t\"", "\t" },
-        { "\"\\/\"", "\\/" },
+        { "\"/\"", "/" },
+        { "\"\\/\"", "/", .skip = 1 },
         { "\"\\\\\"", "\\" },
         { "\"\\\"\"", "\"" },
         { "\"hello world \\\"embedded string\\\"\"",
configure +1 -1
index 1340c33..7fab4de 100755
@@ -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"
#4 lore raw

Re: [Qemu-devel] [PATCH] Fix qjson test of solidus encoding

Quoted 33 lines · On Fri, 26 Aug 2011 14:58:15 -0300 Luiz Capitulino <[email protected]>…
Quoted 13 lines · On Fri, 26 Aug 2011 19:52:11 +0200 Jan Kiszka <[email protected]> wrote:
Quoted 12 lines · Luiz Capitulino
Quoted 8 lines · On Fri, 26 Aug 2011 18:48:52 +0200 Jan Kiszka <[email protected]> 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
Quoted 5 lines
Quoted 2 lines

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.

Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
# ./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.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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?

Read: please ack :)

Quoted 41 lines
Quoted 27 lines

-------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.

---
 check-qjson.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
check-qjson.c +2 -1
index 64fcdcb..36d4ac2 100644
@@ -33,7 +33,8 @@ START_TEST(escaped_string)
         { "\"\\n\"", "\n" },
         { "\"\\r\"", "\r" },
         { "\"\\t\"", "\t" },
-        { "\"\\/\"", "\\/" },
+        { "\"/\"", "/" },
+        { "\"\\/\"", "/", .skip = 1 },
         { "\"\\\\\"", "\\" },
         { "\"\\\"\"", "\"" },
         { "\"hello world \\\"embedded string\\\"\"",
configure +1 -1
index 1340c33..7fab4de 100755
@@ -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"
Acked-by on v1 1/1
#5 lore raw

Re: [Qemu-devel] [PATCH] Fix qjson test of solidus encoding

In reply to Jan Kiszka
Quoted 49 lines · Jan Kiszka
Quoted 7 lines · Luiz Capitulino
Quoted 4 lines · On Fri, 26 Aug 2011 18:48:52 +0200 Jan Kiszka<[email protected]> wrote:

Hi all,

current master has some qregressions:

Quoted 7 lines
Quoted 4 lines
# ./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.

Quoted 11 lines
Quoted 5 lines
# ./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.

---
  check-qjson.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
check-qjson.c +0 -0
index 64fcdcb..36d4ac2 100644

check-qjson.c START_TEST(escaped_string) · line 40

Quoted 9 lines
check-qjson.c +2 -1
@@ -33,7 +33,8 @@ START_TEST(escaped_string)
          { "\"\\n\"", "\n" },
          { "\"\\r\"", "\r" },
          { "\"\\t\"", "\t" },
-        { "\"\\/\"", "\\/" },
+        { "\"/\"", "/" },
+        { "\"\\/\"", "/", .skip = 1 },
          { "\"\\\\\"", "\\" },
          { "\"\\\"\"", "\"" },
          { "\"hello world \\\"embedded string\\\"\"",
#6 lore raw

Re: [Qemu-devel] [PATCH] Fix qjson test of solidus encoding

Quoted 45 lines · On Mon, 29 Aug 2011 09:19:30 -0500 Michael Roth <[email protected]>…
Quoted 44 lines · Jan Kiszka
Quoted 7 lines · Luiz Capitulino
Quoted 4 lines · On Fri, 26 Aug 2011 18:48:52 +0200 Jan Kiszka<[email protected]> wrote:

Hi all,

current master has some qregressions:

Quoted 7 lines
Quoted 4 lines
# ./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.

Quoted 11 lines
Quoted 5 lines
# ./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.

---
  check-qjson.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
Quoted 16 lines
Quoted 5 lines
check-qjson.c +0 -0
index 64fcdcb..36d4ac2 100644

check-qjson.c START_TEST(escaped_string) · line 40

Quoted 9 lines
check-qjson.c +2 -1
@@ -33,7 +33,8 @@ START_TEST(escaped_string)
          { "\"\\n\"", "\n" },
          { "\"\\r\"", "\r" },
          { "\"\\t\"", "\t" },
-        { "\"\\/\"", "\\/" },
+        { "\"/\"", "/" },
+        { "\"\\/\"", "/", .skip = 1 },
          { "\"\\\\\"", "\\" },
          { "\"\\\"\"", "\"" },
          { "\"hello world \\\"embedded string\\\"\"",

Applied to the qmp branch, thanks.