aboutsummaryrefslogtreecommitdiff
path: root/test/suites/api/test_dump.c
AgeCommit message (Collapse)AuthorFilesLines
2019-10-21Tweak clang-format configuration a bitPetri Lehtinen1-12/+8
Set ColumnLimit to 90, remove AllowShortCaseLabelsOnASingleLine.
2019-10-21Run clang-format on *.c, *.hPetri Lehtinen1-72/+57
2019-10-08fix issue #426AllenX20181-0/+4
2019-07-22correct spelling mistakeallen1-1/+1
2017-02-27Add JSON_EMBED encoding flagNathaniel McCallum1-0/+34
The JSON_EMBED encoding flag causes the opening and closing characters of the top-level array ('[', ']') or object ('{', '}') to be omitted during encoding. This feature makes it possible to concatenate multiple arrays or objects in the stream output. It also makes it possible to perform outputs of partial composes. One such example of a partial compose is when outputting a JWE object. The output is a JSON object. But it has one top-level attribute ("ciphertext") that can grow out of proportion with the rest of the metadata. With the JSON_EMBED flag, the other metadata can be composed ahead of time and dumped during the beginning of output, where the "ciphertext" and "tag" attributes can be streamed out in chunks. Thus, the header material can be composed with Jansson and the ciphertext itself can be composed manually.
2017-01-27Implement json_dumpfd() and json_loadfd()Nathaniel McCallum1-3/+45
The primary use of these functions is easy loading and dumping from stream sockets. Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
2017-01-26Implement json_dumpb()Nathaniel McCallum1-0/+26
This function encodes the json_t object to a pre-allocated buffer. It compliments the already existing json_loadb() function and is useful for parsing JSON-RPC (among other protocols) when sent over datagram sockets. Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
2016-09-18Update copyrights for 2016Petri Lehtinen1-1/+1
2014-12-19Increase test coveragePetri Lehtinen1-0/+19
2014-01-28Update copyrights for 2014Petri Lehtinen1-1/+1
2013-09-30Add JSON_ALLOW_NUL decoding flag for enabling NUL byte supportPetri Lehtinen1-0/+15
2013-07-23Update copyrights for 2013Petri Lehtinen1-1/+1
2013-04-15Fix the signature again, and also rest of the errorsPetri Lehtinen1-1/+4
Next time, remember to check with -Werror first...
2013-04-15Fix the signature of a test functionPetri Lehtinen1-1/+1
2013-04-15json_dump*(): Don't crash if json is NULL and JSON_ENCODE_ANY is setPetri Lehtinen1-0/+21
2012-06-28Created flag to dump escaping slashJuan Basso1-0/+25
2012-03-20Update copyright notices for 2012Petri Lehtinen1-1/+1
2011-10-02Make real number encoding and decoding work under all localesPetri Lehtinen1-2/+1
The decimal point '.' is changed to locale's decimal point before/after JSON conversion to make C standard library's locale-specific string conversion functions work correctly. All the tests now call setlocale(LC_ALL, "") on startup to use the locale set in the environment. Fixes GH-32.
2011-05-14Add JSON_ENCODE_ANY flag to allow encoding any JSON valuePetri Lehtinen1-3/+54
Closes GH-19.
2011-01-22Update copyright notices for 2011Petri Lehtinen1-1/+1
2010-06-10Fix a few memory leaks in tests1.2Petri Lehtinen1-0/+2
No changes to the actual library code.
2010-05-14Zero the visited flag after an encoding errorPetri Lehtinen1-0/+43
When encoding an array or object ends in an error, the visited flag wasn't zeroed, causing subsequent encoding attempts to fail. This patch fixes the problem by always zeroing the visited flag.
2010-05-14Zero the visited flag after encoding an empty array or objectPetri Lehtinen1-0/+46
Encoding an empty array or object worked, but encoding it again (possibly after adding some items) failed, because the visited flag (used for detecting circular references) wasn't zeroed.
2009-12-21Enhance testsPetri Lehtinen1-227/+0
* Now that JSON_SORT_KEYS is implemented, take it into use with the valid and valid-strip suites. This is to ensure that the tests remain valid even if the string hash function is changed in the future. * Remove test_dump API test. Instead, implement the same tests more elegantly in the encoding-flags suite.
2009-12-16Refactor the test systemPetri Lehtinen1-0/+227