| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
It's pointless to add the '-test' suffix to files under the tests/ directory.
|
|
|
|
|
| |
Verify that setting an object member multiple times does not lead to
random values.
|
|
|
|
|
| |
We should not warn when asking for a string, array or object if the
contents were 'null'.
|
|
|
|
|
|
|
| |
Both the Object API and the Parser should not choke on members with
empty strings as their value. The Object should just have a member
associated with a JSON_NODE_VALUE node type and an empty string as
the contents.
|
|
|
|
| |
Do not include json-types.h, use the correct global include.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The JSON RFC does not specify the size of the integer type, thus
implicitly falling back to machine-size.
This would all be fine and dandy if some demented Web Developer (and
I use the term "developer" *very much* loosely) did not decide to
use integers to store unique identifiers for objects; obviously, you
can't have more than 2^32-1 status messages in a database with
millions of users who update their status multiple times per day.
Right, Twitter?
Anyway, some languages do a type auto-promotion from Integer to
Long, thus pushing the limit of allowed positive values -- until the
next integer overflow, that is. C, and GLib, do not do that
transparently for us so we need to:
- always use gint64 when parsing a JSON data stream using
JsonScanner
- move all the Node, Object and Array APIs to gint64
- auto-promote G_TYPE_INT to G_TYPE_INT64 when setting
a GValue manually
- auto-promote and auto-demote G_TYPE_INT properties when
(de)serializing GObjects.
The GLib types used internally by JSON-GLib are, thus:
integer -> G_TYPE_INT64
boolean -> G_TYPE_BOOLEAN
float -> G_TYPE_DOUBLE
string -> G_TYPE_STRING
|
|
|
|
|
| |
The json_object_foreach_member() function iterates over a JsonObject
data type.
|
|
|
|
|
|
|
| |
Since json_object_add_member() has been deprecated and it's using
a gcc compiler attribute to loudly complain while compiling the
library, we should restore the sanity and use json_object_set_member()
instead.
|
|
Use a similar test unit as the JsonArray one, testing creation, empty
objects, addition and removal of members.
|