Skip to content

Instantly share code, notes, and snippets.

@davenonymous
Created May 6, 2012 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davenonymous/d8ca03d69dce065a8758 to your computer and use it in GitHub Desktop.
Save davenonymous/d8ca03d69dce065a8758 to your computer and use it in GitHub Desktop.
Output of SMJansson test plugin
ok 0 - Library is loaded
ok 1 - Creating JSON Object
ok 2 - Type is Object
ok 3 - Creating JSON String
ok 4 - Type is String
ok 5 - Checking created JSON String value
ok 6 - Modifying string value
ok 7 - Checking modified JSON String value
ok 8 - Attaching modified String to root object
ok 9 - Creating JSON Real
ok 10 - Type is Real
ok 11 - Checking created JSON Real value
ok 12 - Checking result of json_number_value
ok 13 - Modifying real value
ok 14 - Checking modified JSON Real value
ok 15 - Checking result of json_number_value
ok 16 - Attaching modified Real to root object
ok 17 - Creating JSON Integer
ok 18 - Type is Integer
ok 19 - Checking created JSON Integer value
ok 20 - Checking result of json_number_value
ok 21 - Modifying integer value
ok 22 - Checking modified JSON Integer value
ok 23 - Checking result of json_number_value
ok 24 - Attaching modified Integer to root object
ok 25 - Object has the correct size
ok 26 - Created JSON is ok
ok 27 - Attaching new Object to root object
ok 28 - Object has the correct size
ok 29 - Attaching new String to nested object (using reference stealing)
ok 30 - Deleting __Float element from root object
ok 31 - Object has the correct size
ok 32 - Creating JSON Array
ok 33 - Type is Array
ok 34 - Appending String to Array
ok 35 - Array has correct size
ok 36 - Appending Float to Array
ok 37 - Array has correct size
ok 38 - Inserting Integer at position 0
ok 39 - Array has correct size
ok 40 - Setting String at position 1
ok 41 - Array has correct size
ok 42 - Attaching Array to nested object
- Creating the same Array using reference stealing
ok 43 - Appending new String to Array
ok 44 - Appending new Float to Array
ok 45 - Inserting new Integer at position 0
ok 46 - Setting new String at position 1
ok 47 - Arrays are equal.
ok 48 - File written without errors
ok 49 - Testoutput file exists
ok 50 - Loading JSON from file.
ok 51 - Written file and data in memory are equal
ok 52 - Creating an iterator for the reloaded object.
- Found key: __String (Type: String)
ok 53 - Type is correct
ok 54 - Overwriting string value at iterator position (using reference stealing)
- Found key: __Integer (Type: Integer)
ok 55 - Type is correct
ok 56 - Overwriting integer value at iterator position
- Found key: __NestedObject (Type: Object)
ok 57 - Type is correct
ok 58 - Getting JSON Array from reloaded object
ok 59 - Array has correct size
- Found element with type: Integer
- Found element with type: String
- Found element with type: Real
ok 60 - Looped over all array elements
ok 61 - Deleting 3rd element from array
ok 62 - Array has correct size
ok 63 - Extending array
ok 64 - Array has correct size
ok 65 - Clearing array
ok 66 - Array is empty
ok 67 - Iterator looped over all keys
ok 68 - Written file and data in memory are not equal anymore
- Creating the same object using json_pack
ok 69 - Packed JSON is equal to manually created JSON
- Testing all json_pack values
ok 70 - Packed JSON is an array
ok 71 - Element 1 has the correct string value
ok 72 - Element 2 has the correct integer value
ok 73 - Element 3 has the correct float value
ok 74 - Element 4 has the correct float value
ok 75 - Element 5 is boolean true.
ok 76 - Element 6 is null.
ok 77 - Element 7 is boolean false.
- Creating new object with 4 keys via load
ok 78 - Deleting element from object
ok 79 - Object size is correct
- Creating new object to update the previous one
ok 80 - Updating existing keys
ok 81 - Element update successful
ok 82 - Object size is correct
ok 83 - Updating missing keys
ok 84 - Element insertion via update successful
ok 85 - Object size is correct
ok 86 - Clearing new object
ok 87 - Object is empty
- Adding one of the original four keys
ok 88 - Updating all keys
ok 89 - Element update successful
ok 90 - Object size is correct
- Creating and adding an array to the object
ok 91 - Creating copy of JSON Object
ok 92 - Object size is correct
ok 93 - Objects are equal
- Modifying the array of the original Object
ok 94 - Content of copy is still identical (was a shallow copy)
ok 95 - Creating deep copy of JSON Object
ok 96 - Object size is correct
ok 97 - Objects are equal
- Modifying the array of the original Object
ok 98 - Content of copy is not identical anymore (was a deep copy)
ok 99 - Created JSON matches
JSON 1:
-------------
{
"__String": "The answer is 42",
"__Integer": 1337,
"__NestedObject": {
"__Array": [
3,
"4",
2.0
],
"__NestedString": "i am nested"
}
}
-------------
JSON 2:
-------------
{
"__String": "What is the \"Hitchhiker's guide to the galaxy\"?",
"__Integer": 9001,
"__NestedObject": {
"__NestedString": "i am nested",
"__Array": [
3,
"4",
"Extension 1",
"Extension 2"
]
}
}
-------------
JSON 3:
-------------
{"B": 20, "A": 10, "C": 30, "D": 40, "E": 50, "F": 60, "G": 70, "Array": ["no more!", "less n less!", "empty!", "dead!"]}
-------------
JSON 4:
-------------
{"false2": false, "true1": true, "false1": false, "true2": true, "null": null}
-------------
JSON 5:
-------------
[
"String",
42,
13.369999885559082,
20001.33203125,
true,
null,
false
]
-------------
# You ran 100 of 100 tests, 0 failed, 100 passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment