Commit Graph

523 Commits

Author SHA1 Message Date
Sean Middleditch
7ba18d3f0a use different temporaries in tests instead of reusing e3 2010-01-12 16:03:27 -08:00
Sean Middleditch
7d09af38c1 remove auto type conversion on array/object assignment 2010-01-12 15:38:47 -08:00
Sean Middleditch
8d3a9e347c rename as_json_t to as_json 2010-01-12 15:33:36 -08:00
Sean Middleditch
f79a81dad9 add (ugly) stream support 2010-01-12 15:29:45 -08:00
Sean Middleditch
b98e9d180c rename the set() methods 2010-01-12 15:14:57 -08:00
Petri Lehtinen
b077d7988e Update documentation
* Python is no longer required to run the tests
* Mention pkg-config support
* Fix some errors
2010-01-12 21:29:16 +02:00
Sean Middleditch
8d5d2a93d5 remove some unnecessary checks 2010-01-12 04:30:02 -08:00
Sean Middleditch
d77c2e3fb0 cleanup the take_ownership function a bit 2010-01-12 04:26:30 -08:00
Sean Middleditch
7ef3202f83 added save_file and save_string methods 2010-01-12 04:20:17 -08:00
Sean Middleditch
36085ab49a include jansson.h inside the jansson namespace 2010-01-12 04:13:26 -08:00
Sean Middleditch
f743c4ee7f test object property assignment and clear 2010-01-12 01:41:17 -08:00
Sean Middleditch
c994eddec4 expand array assignment tests 2010-01-12 01:34:58 -08:00
Sean Middleditch
5a20e2695b add link to Jansson web to README 2010-01-12 01:31:08 -08:00
Sean Middleditch
cd18aa97f0 added README 2010-01-12 01:29:44 -08:00
Sean Middleditch
bd09127859 cleaner assignment behavior 2010-01-12 01:26:47 -08:00
Sean Middleditch
6818c117ee ignore test-bin output file 2010-01-12 01:10:38 -08:00
Sean Middleditch
39601c183a add tests 2010-01-12 01:10:20 -08:00
Sean Middleditch
1e3b41e8ea initial commit of janssonxx.h 2010-01-12 01:10:09 -08:00
Petri Lehtinen
7f8684828d Fix memory leaks in json_equal() tests 2010-01-10 21:02:08 +02:00
Petri Lehtinen
93ac06c902 Fix memory leaks in json_*_deep_copy() 2010-01-10 21:01:07 +02:00
Petri Lehtinen
b21f07b35c Enable Valgrind support in the API suite
It was accidentally left out when the test system was refactored.
2010-01-10 16:18:46 +02:00
Petri Lehtinen
508873de9b Use _nocheck functions internally for speed
There are some places where we copy a string from an existing JSON
value. In these cases the string has already been checked for valid
UTF-8.
2010-01-10 14:39:11 +02:00
Petri Lehtinen
aeb5b481c9 Add pkg-config support
Thanks to Sean Middleditch for contributing.
2010-01-07 19:30:20 +02:00
Petri Lehtinen
9db34dc31a Add functions for shallow and deep copying JSON values 2009-12-31 18:50:39 +02:00
Petri Lehtinen
95a468cebb Add equality test for JSON values 2009-12-31 18:50:36 +02:00
Petri Lehtinen
22173c1d8b Add check-exports test 2009-12-23 22:29:59 +02:00
Petri Lehtinen
dd2fe1ebe8 Add _nocheck functions
Added functions are:

* json_string_nocheck()
* json_string_set_nocheck()
* json_object_set_nocheck()
* json_object_set_new_nocheck()

These functions don't check that their string argument is valid UTF-8,
but assume that the user has already performed the check.
2009-12-23 22:28:24 +02:00
Petri Lehtinen
6637b976ed Merge branch '1.1' 2009-12-21 14:13:05 +02:00
Petri Lehtinen
f5202bedef Remove const qualifier from the json_t parameter in json_*_set() functions.
It's incorrect as these functions modify the value.
2009-12-21 14:12:06 +02:00
Petri Lehtinen
2db2f2cfb6 Fix tests for real
The tests were broken by the "%.17g" fix that was merged from the 1.1
branch.
2009-12-21 12:52:29 +02:00
Petri Lehtinen
e7a5dc58e6 Merge branch '1.1'
Conflicts:
	configure.ac
	doc/conf.py
2009-12-21 12:52:25 +02:00
Petri Lehtinen
3889af476b Enhance tests
* 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-21 12:50:49 +02:00
Petri Lehtinen
34fb97998c jansson 1.1.3 2009-12-18 21:43:12 +02:00
Petri Lehtinen
ec96cbf016 Encode reals correctly
This patch changes the sprintf format from "%0.17f" to "%.17g", as the
f format specifier doesn't print the exponent at all. This caused
losing precision in all but the most simple cases.

Because the g specifier doesn't print the decimal fraction or exponent
if they're not needed, a ".0" has to be appended by hand in these
cases. Otherwise the value's type changes from real to integer when
decoding again.

Thanks to Philip Grandinetti for reporting this issue.
2009-12-18 00:05:06 +02:00
Petri Lehtinen
19a606d736 Implement JSON_SORT_KEYS encoding flag
With this flag, the objects are sorted by key when encoding.
2009-12-16 23:12:39 +02:00
Petri Lehtinen
3add1cf361 Refactor the test system 2009-12-16 22:45:29 +02:00
Petri Lehtinen
50031440a3 Implement JSON_ENSURE_ASCII encoding flag
With this flag, all Unicode characters outside the ASCII range are
escaped.
2009-12-05 22:55:30 +02:00
Petri Lehtinen
d67aeb9739 Use int32_t instead of plain int with Unicode code points
On some architectures, int just isn't big enough to hold all Unicode
code points.
2009-12-02 23:53:54 +02:00
Petri Lehtinen
7c707a73a2 Only export symbols starting with "json_" in libjansson.la
This way we don't pollute the symbol namespace with internal symbols.
2009-11-29 13:04:12 +02:00
Petri Lehtinen
330e892ff6 Make parse_json static 2009-11-29 13:00:47 +02:00
Petri Lehtinen
d857fd08a5 doc/github_commits.c Add copyright notice 2009-11-28 13:39:06 +02:00
Petri Lehtinen
e0a88d19d1 Merge branch '1.1'
Conflicts:
	configure.ac
	doc/conf.py
2009-11-08 22:01:02 +02:00
Petri Lehtinen
842bc2128b jansson 1.1.2 2009-11-08 14:13:32 +02:00
Petri Lehtinen
ca6d26a1c2 Don't include stdint.h in jansson.h
It's not needed
2009-11-07 14:45:46 +02:00
Petri Lehtinen
17d913307e Merge branch '1.1'
Conflicts:
	test/.gitignore
	test/testprogs/Makefile.am
2009-11-04 22:10:46 +02:00
Petri Lehtinen
f236c14dc5 dump: Revise whitespace usage
- Never append newline to output
- By default, add spaces between array and object items for more
  readable output
- Introduce the flag JSON_COMPACT to not add the aforementioned spaces
2009-11-04 22:09:40 +02:00
Petri Lehtinen
bf01067a8a Build documentation in make html target
To keep the distchecks for the documentation, the documentation has to
be built in the check target instead of distcheck-hook.

While at it, rename doc/.build to doc/_build. This naming is the
default with sphinx 0.6.2.
2009-11-03 23:09:04 +02:00
Petri Lehtinen
d3959a8ce7 load: Parse a badly put - sign correctly
Thanks to Manolis Delakis for reporting.
2009-10-29 15:45:16 +02:00
Petri Lehtinen
f243930b68 json_load_file: Initialize the error struct properly
Failing to do this has the effect that the error message is not
returned when the input file cannot be opened (e.g. if it doesn't
exist).

Thanks to Martin Vopatek for reporting.
2009-10-27 17:56:02 +02:00
Petri Lehtinen
d1b07171cc Merge branch '1.1'
Conflicts:
	CHANGES
	configure.ac
	doc/conf.py
2009-10-26 21:33:03 +02:00