test_deep_copy.expected 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. "GlossList":{
  17. "GlossEntry":{
  18. "ID":"SGML",
  19. "SortAs":"SGML",
  20. "GlossTerm":"Standard Generalized Markup Language",
  21. "Acronym":"SGML",
  22. "Abbrev":"ISO 8879:1986",
  23. "GlossDef":{
  24. "para":"A meta-markup language, used to create markup languages such as DocBook.",
  25. "GlossSeeAlso":[
  26. "GML",
  27. "XML"
  28. ]
  29. },
  30. "GlossSee":"markup"
  31. }
  32. }
  33. }
  34. }
  35. }
  36. ------------------------------------------------
  37. ------------------------------------------------
  38. JSON2
  39. {
  40. "menu":{
  41. "header":"SVG Viewer",
  42. "items":[
  43. {
  44. "id":"Open"
  45. },
  46. {
  47. "id":"OpenNew",
  48. "label":"Open New"
  49. },
  50. null,
  51. {
  52. "id":"ZoomIn",
  53. "label":"Zoom In"
  54. },
  55. {
  56. "id":"ZoomOut",
  57. "label":"Zoom Out"
  58. },
  59. {
  60. "id":"OriginalView",
  61. "label":"Original View"
  62. },
  63. null,
  64. {
  65. "id":"Quality",
  66. "another_null":null
  67. },
  68. {
  69. "id":"Pause"
  70. },
  71. {
  72. "id":"Mute"
  73. },
  74. null,
  75. {
  76. "id":"Find",
  77. "label":"Find..."
  78. },
  79. {
  80. "id":"FindAgain",
  81. "label":"Find Again"
  82. },
  83. {
  84. "id":"Copy"
  85. },
  86. {
  87. "id":"CopyAgain",
  88. "label":"Copy Again"
  89. },
  90. {
  91. "id":"CopySVG",
  92. "label":"Copy SVG"
  93. },
  94. {
  95. "id":"ViewSVG",
  96. "label":"View SVG"
  97. },
  98. {
  99. "id":"ViewSource",
  100. "label":"View Source"
  101. },
  102. {
  103. "id":"SaveAs",
  104. "label":"Save As"
  105. },
  106. null,
  107. {
  108. "id":"Help"
  109. },
  110. {
  111. "id":"About",
  112. "label":"About Adobe CVG Viewer..."
  113. }
  114. ]
  115. }
  116. }
  117. ------------------------------------------------
  118. ------------------------------------------------
  119. JSON3
  120. ------------------------------------------------
  121. {
  122. "menu":{
  123. "id":"file",
  124. "value":"File",
  125. "popup":{
  126. "menuitem":[
  127. {
  128. "value":"New",
  129. "onclick":"CreateNewDoc()"
  130. },
  131. {
  132. "value":"Open",
  133. "onclick":"OpenDoc()"
  134. },
  135. {
  136. "value":"Close",
  137. "onclick":"CloseDoc()"
  138. }
  139. ]
  140. }
  141. }
  142. }
  143. ------------------------------------------------
  144. Testing deep_copy with a custom serializer set
  145. CALLED: my_shallow_copy on with_serializer object
  146. deep_copy with custom serializer worked OK.