You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_deep_copy.expected 3.1 kB

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