| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The test suite for JSON-GLib was written back when we only had
gtester-report and freeform verbose test output. These days, we expect
everything to conform to the Test Anything Protocol (TAP), which has
specific constraints on the output format.
|
|
|
|
|
| |
When running with `-Wsign-compare` we're raising a lot of
signed/unsigned comparison warnings.
|
|
|
|
|
|
|
|
| |
This will give more informative message in case of fail assertions.
Moreover GLib (when compiling with G_DISABLE_ASSERT) disable g_assert
totally, that would make these tests no-op
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new `json_parser_load_from_mapped_file()` to load JSON from
files via memory mapping. It’s otherwise similar to
`json_parser_load_from_file()`. It’s in the right position to be able
to memory map the file it’s reading from: it reads the input once
before building a `JsonNode` structure to represent it, doesn’t write
to the file, and often deals with large input files.
This should speed things up slightly due to reducing time spent
allocating a large chunk of heap memory to load the file into, if a
caller can support that.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
|
|
|
|
|
| |
This introduces no functional changes, but will allow that code to be
reused in the following commit.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If parsing an empty document, it’s allowed to return NULL from
json_parser_get_root(). This was broken for immutable parsers when
immutability support was added (an assertion fails). Fix that, and also
document that json_parser_get_root() may return NULL.
Do the same for json_parser_steal_root() too, which is another way that
the root node may be NULL.
Add a unit test.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
|
|
|
|
| |
Direct comparison should never be used for floating point values.
Fixes #27 and #28.
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 028e540 disallowed empty member names in objects, however
they are unfortunately valid JSON. This patch reenables an empty
string as a member name.
Tests are updated to allow the empty string case, and to test
the use of an empty string in generation, iteration etc.
https://bugzilla.gnome.org/show_bug.cgi?id=747279
|
| |
|
|
|
|
| |
All the platforms and build system we support have a config.h header.
|
|
|
|
| |
And use g_test_build_filename().
|
|
|
|
|
|
|
| |
Instead of our homegrown solution. This should fix the regression in the
installed tests case.
Original patch by: Colin Walters <walters@verbum.org>
|
|
|
|
|
| |
We depend on a new version of GLib, so we can remove a bunch of old
version checks.
|
|
|
|
|
|
|
| |
See https://live.gnome.org/GnomeGoals/InstalledTests for more
information.
It's still possible to run `make check` with locally uninstalled tests.
|
|
|
|
|
|
|
|
| |
Starting from GLib 2.36, g_type_init() is going to be deprecated (the
type system will be initialized as soon as libgobject is paged in, using
constructors). As I don't want to bump dependencies just for that, the
call to g_type_init() should be placed under a compile-time version
check, to keep the noise from compiler warnings down.
|
|
|
|
|
| |
This is the positive equivalent of the test case inside the invalid test
unit.
|
|
|
|
| |
Instead of putting it inside the parser unit test.
|
|
It's pointless to add the '-test' suffix to files under the tests/ directory.
|