Merge lp:~zorba-coders/zorba/bug_900462 into lp:~zorba-coders/zorba/data-converters-module

Proposed by Sorin Marian Nasoi
Status: Merged
Approved by: Matthias Brantner
Approved revision: 78
Merged at revision: 77
Proposed branch: lp:~zorba-coders/zorba/bug_900462
Merge into: lp:~zorba-coders/zorba/data-converters-module
Diff against target: 117 lines (+14/-19)
11 files modified
src/com/zorba-xquery/www/modules/converters/CMakeLists.txt (+0/-2)
src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp (+5/-8)
test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res (+1/-1)
test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug_900462
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Sorin Marian Nasoi Approve
Review via email: mp+84826@code.launchpad.net

Commit message

Fixed bug #900462 (json:serialize returns invalid json)

Description of the change

Fixed bug #900462 (json:serialize returns invalid json)

To post a comment you must log in.
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug_900462-2011-12-07T19-04-45.45Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/com/zorba-xquery/www/modules/converters/CMakeLists.txt'
2--- src/com/zorba-xquery/www/modules/converters/CMakeLists.txt 2011-12-05 22:42:10 +0000
3+++ src/com/zorba-xquery/www/modules/converters/CMakeLists.txt 2011-12-07 18:56:40 +0000
4@@ -62,8 +62,6 @@
5 DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/converters/json" VERSION 1.0 FILE "json.xq" LINK_LIBRARIES "${Jansson_LIBRARIES}")
6 ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test_json")
7
8- EXPECTED_FAILURE(zorba_data-converters_module/converters/jansson/serialize_json_18.xq 900462)
9-
10 IF(ZORBA_NO_UNICODE)
11 SET_TESTS_PROPERTIES(zorba_data-converters_module/converters/jansson/parse_json_03.xq
12 PROPERTIES WILL_FAIL TRUE)
13
14=== modified file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp'
15--- src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp 2011-12-06 14:20:24 +0000
16+++ src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp 2011-12-07 18:56:40 +0000
17@@ -475,14 +475,11 @@
18 aResultSs << "[";
19
20 serialize_child(aElement, aResultSs, aErrorLogSs, "object");
21-
22- if(!aErrorLogSs.str().empty())
23- {
24- if(lType == "object")
25- aResultSs << "}";
26- else
27- aResultSs << "]";
28- }
29+
30+ if(lType == "object")
31+ aResultSs << "}";
32+ else
33+ aResultSs << "]";
34 }
35
36 static void parse_JSON_ML_value(
37
38=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res'
39--- test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res 2011-05-31 15:21:09 +0000
40+++ test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res 2011-12-07 18:56:40 +0000
41@@ -1,1 +1,1 @@
42-{"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}
43\ No newline at end of file
44+{"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}}
45\ No newline at end of file
46
47=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res'
48--- test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res 2011-05-31 15:21:09 +0000
49+++ test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res 2011-12-07 18:56:40 +0000
50@@ -1,1 +1,1 @@
51-[{"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}}, {"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}}
52\ No newline at end of file
53+[{"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}}, {"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}}]
54\ No newline at end of file
55
56=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res'
57--- test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res 2011-05-31 15:21:09 +0000
58+++ test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res 2011-12-07 18:56:40 +0000
59@@ -1,1 +1,1 @@
60-{"firstName": "\""
61\ No newline at end of file
62+{"firstName": "\""}
63\ No newline at end of file
64
65=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res'
66--- test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res 2011-05-31 15:21:09 +0000
67+++ test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res 2011-12-07 18:56:40 +0000
68@@ -1,1 +1,1 @@
69-{"name": "\"\\\/\b\f\n\r\t"
70\ No newline at end of file
71+{"name": "\"\\\/\b\f\n\r\t"}
72\ No newline at end of file
73
74=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res'
75--- test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res 2011-05-31 15:21:09 +0000
76+++ test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res 2011-12-07 18:56:40 +0000
77@@ -1,1 +1,1 @@
78-{"servlet": [["value1"], "value2"]
79\ No newline at end of file
80+{"servlet": [["value1"], "value2"]}
81\ No newline at end of file
82
83=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res'
84--- test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res 2011-05-31 15:21:09 +0000
85+++ test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res 2011-12-07 18:56:40 +0000
86@@ -1,1 +1,1 @@
87-{"servlet": ["value"]
88\ No newline at end of file
89+{"servlet": ["value"]}
90\ No newline at end of file
91
92=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res'
93--- test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res 2011-05-31 15:21:09 +0000
94+++ test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res 2011-12-07 18:56:40 +0000
95@@ -1,1 +1,1 @@
96-{"servlet": {"name": "value"}
97\ No newline at end of file
98+{"servlet": {"name": "value"}}
99\ No newline at end of file
100
101=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res'
102--- test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res 2011-05-31 15:21:09 +0000
103+++ test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res 2011-12-07 18:56:40 +0000
104@@ -1,1 +1,1 @@
105-{"servlet": [{}]
106\ No newline at end of file
107+{"servlet": [{}]}
108\ No newline at end of file
109
110=== modified file 'test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res'
111--- test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res 2011-05-31 15:21:09 +0000
112+++ test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res 2011-12-07 18:56:40 +0000
113@@ -1,1 +1,1 @@
114-{"servlet": [["212 732-1234"]]
115\ No newline at end of file
116+{"servlet": [["212 732-1234"]]}
117\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: