Commit Graph

15 Commits

Author SHA1 Message Date
Petri Lehtinen
453e4c0aa2 Zero the visited flag after an encoding error
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-14 09:23:35 +03:00
Petri Lehtinen
2630980f49 Zero the visited flag after encoding an empty array or object
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.
2010-05-14 09:05:56 +03:00
Petri Lehtinen
f284e3c069 Fix reference counting on true, false and null
Initialize their reference counts to (unsigned int)-1 to disable
reference counting on them. It already was meant to work like this,
but the reference counts were just initialized to 1 instead of -1.

Thanks to Andrew Thompson for reporting this issue.
2010-03-23 08:12:32 +02:00
Petri Lehtinen
08dc8d9baf Add year 2010 to copyright notices 2010-02-02 21:26:11 +02:00
Petri Lehtinen
f5662a82cd test/suites/api/test_object.c: Enhance tests for iterators 2010-01-28 21:04:21 +02:00
Petri Lehtinen
ab2e567685 test/suites/api: Fail when a test fails
The valgrind fix a while back apparently made the test system not
notice normal failures in suites/api.
2010-01-28 20:58:26 +02:00
Petri Lehtinen
4c6cb6afd1 Distribute some missing files 2010-01-21 21:48:31 +02:00
Petri Lehtinen
7f8684828d Fix memory leaks in json_equal() tests 2010-01-10 21:02:08 +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
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
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
3add1cf361 Refactor the test system 2009-12-16 22:45:29 +02:00