| 1 |
PASSED - loaded input data |
| 2 |
PASSED - all json_object_deep_copy() returned succesful |
| 3 |
PASSED - all json_object_deep_copy() returned EINVAL for non-null pointer |
| 4 |
PASSED - all json_object_equal() tests returned succesful |
| 5 |
PASSED - comparison of string output |
| 6 |
PASSED - trying to overrwrite an object that has refcount > 1 |
| 7 |
Printing JSON objects for visual inspection |
| 8 |
------------------------------------------------ |
| 9 |
JSON1 |
| 10 |
{ |
| 11 |
"glossary":{ |
| 12 |
"title":"example glossary", |
| 13 |
"GlossDiv":{ |
| 14 |
"title":"S", |
| 15 |
"null_obj":null, |
| 16 |
"exixt":false, |
| 17 |
"quantity":20, |
| 18 |
"univalent":19.8, |
| 19 |
"GlossList":{ |
| 20 |
"GlossEntry":{ |
| 21 |
"ID":"SGML", |
| 22 |
"SortAs":"SGML", |
| 23 |
"GlossTerm":"Standard Generalized Markup Language", |
| 24 |
"Acronym":"SGML", |
| 25 |
"Abbrev":"ISO 8879:1986", |
| 26 |
"GlossDef":{ |
| 27 |
"para":"A meta-markup language, used to create markup languages such as DocBook.", |
| 28 |
"GlossSeeAlso":[ |
| 29 |
"GML", |
| 30 |
"XML" |
| 31 |
] |
| 32 |
}, |
| 33 |
"GlossSee":"markup" |
| 34 |
} |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
------------------------------------------------ |
| 40 |
------------------------------------------------ |
| 41 |
JSON2 |
| 42 |
{ |
| 43 |
"menu":{ |
| 44 |
"header":"SVG Viewer", |
| 45 |
"items":[ |
| 46 |
{ |
| 47 |
"id":"Open" |
| 48 |
}, |
| 49 |
{ |
| 50 |
"id":"OpenNew", |
| 51 |
"label":"Open New" |
| 52 |
}, |
| 53 |
null, |
| 54 |
{ |
| 55 |
"id":"ZoomIn", |
| 56 |
"label":"Zoom In" |
| 57 |
}, |
| 58 |
{ |
| 59 |
"id":"ZoomOut", |
| 60 |
"label":"Zoom Out" |
| 61 |
}, |
| 62 |
{ |
| 63 |
"id":"OriginalView", |
| 64 |
"label":"Original View" |
| 65 |
}, |
| 66 |
null, |
| 67 |
{ |
| 68 |
"id":"Quality", |
| 69 |
"another_null":null |
| 70 |
}, |
| 71 |
{ |
| 72 |
"id":"Pause" |
| 73 |
}, |
| 74 |
{ |
| 75 |
"id":"Mute" |
| 76 |
}, |
| 77 |
null, |
| 78 |
{ |
| 79 |
"id":"Find", |
| 80 |
"label":"Find..." |
| 81 |
}, |
| 82 |
{ |
| 83 |
"id":"FindAgain", |
| 84 |
"label":"Find Again" |
| 85 |
}, |
| 86 |
{ |
| 87 |
"id":"Copy" |
| 88 |
}, |
| 89 |
{ |
| 90 |
"id":"CopyAgain", |
| 91 |
"label":"Copy Again" |
| 92 |
}, |
| 93 |
{ |
| 94 |
"id":"CopySVG", |
| 95 |
"label":"Copy SVG" |
| 96 |
}, |
| 97 |
{ |
| 98 |
"id":"ViewSVG", |
| 99 |
"label":"View SVG" |
| 100 |
}, |
| 101 |
{ |
| 102 |
"id":"ViewSource", |
| 103 |
"label":"View Source" |
| 104 |
}, |
| 105 |
{ |
| 106 |
"id":"SaveAs", |
| 107 |
"label":"Save As" |
| 108 |
}, |
| 109 |
null, |
| 110 |
{ |
| 111 |
"id":"Help" |
| 112 |
}, |
| 113 |
{ |
| 114 |
"id":"About", |
| 115 |
"label":"About Adobe CVG Viewer..." |
| 116 |
} |
| 117 |
] |
| 118 |
} |
| 119 |
} |
| 120 |
------------------------------------------------ |
| 121 |
------------------------------------------------ |
| 122 |
JSON3 |
| 123 |
------------------------------------------------ |
| 124 |
{ |
| 125 |
"menu":{ |
| 126 |
"id":"file", |
| 127 |
"value":"File", |
| 128 |
"popup":{ |
| 129 |
"menuitem":[ |
| 130 |
{ |
| 131 |
"value":"New", |
| 132 |
"onclick":"CreateNewDoc()" |
| 133 |
}, |
| 134 |
{ |
| 135 |
"value":"Open", |
| 136 |
"onclick":"OpenDoc()" |
| 137 |
}, |
| 138 |
{ |
| 139 |
"value":"Close", |
| 140 |
"onclick":"CloseDoc()" |
| 141 |
} |
| 142 |
] |
| 143 |
} |
| 144 |
} |
| 145 |
} |
| 146 |
------------------------------------------------ |
| 147 |
|
| 148 |
Testing deep_copy with a custom serializer set |
| 149 |
CALLED: my_shallow_copy on with_serializer object |
| 150 |
|
| 151 |
deep_copy with custom serializer worked OK. |