summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Wrap the test report information section inside an info elementtest-frameworkEmmanuele Bassi2008-04-031-2/+4
|
* Add value testing to the JsonNode unitEmmanuele Bassi2008-03-091-0/+29
| | | | Test the GValue API for storing fundamental types into a JsonNode.
* Add package and version information to the test-report XMLEmmanuele Bassi2008-03-051-0/+2
|
* Add JsonObject test unitEmmanuele Bassi2008-03-053-6/+75
| | | | | Use a similar test unit as the JsonArray one, testing creation, empty objects, addition and removal of members.
* Add element removal unit to the Array testEmmanuele Bassi2008-03-051-0/+12
| | | | | | Remove the json_array_remove_element() call from the add-element test unit and set up a separate test case for the element removal. This keeps the test cases clean.
* Clean the test-report XML output, if foundEmmanuele Bassi2008-03-041-1/+1
|
* Update gitignore fileEmmanuele Bassi2008-03-041-10/+8
|
* Build test-serialize-fullEmmanuele Bassi2008-03-042-23/+41
| | | | | | | | | | Complete the porting of the old test suite into the new, GTest based one. The new test suite is automatically run with make test; make test-report will generate an XML report of the test. The API coverage for the data types is part of the json-glib/tests directory and will be expanded later.
* Rename test-08 into test-serialize-fullEmmanuele Bassi2008-03-041-0/+0
| | | | The test-08 case was the last numbered test unit.
* Rename test-07 into test-serialize-complexEmmanuele Bassi2008-03-042-10/+23
| | | | | | The new test-serialize-complex adds a test unit for the JsonSerializable interface; the TestObject implements the serialization interface to create a JSON data type from a boxed GType.
* Fix compilation of test-serialize-simple and add it to the test suiteEmmanuele Bassi2008-03-042-2/+7
| | | | | The new test-serialize-simple tests the GObject integration for serializing simple GObjects into JSON.
* Rename test-06 to test-serialize-simpleEmmanuele Bassi2008-03-041-0/+0
|
* Move test-06 to GTest APIEmmanuele Bassi2008-03-041-10/+18
| | | | | First pass into replacing the last three numbered tests into named tests.
* Coalesce JsonGenerator test cases into a single test unitEmmanuele Bassi2008-03-044-465/+403
| | | | | | | | | | Like we did for JsonParser, JsonGenerator has now a test unit checking the output of a DOM built and dumped into a buffer. For the arrays is quite easy to verify that the output is correct; unfortunately, JsonObject does not guarantee any ordering on the members, with it being an associative array. Hence, for the object test case we just compare the length of the output.
* Append to EXTRA_DIST, since it was defined elsewhereEmmanuele Bassi2008-03-041-1/+1
|
* Update the READMEEmmanuele Bassi2008-03-041-0/+36
|
* Update gitignore fileEmmanuele Bassi2008-03-041-6/+5
|
* Add validation to the simple object test valuesEmmanuele Bassi2008-03-041-7/+24
| | | | | Like for the simple arrays test case, add validation of the values types for the members of the simple objects test case.
* Add validation of the simple array test valuesEmmanuele Bassi2008-03-041-9/+31
| | | | | | | | | | | | | | | Instead of just checking that the array contains something, the simple-array test case should validate the contents of the array. The test now uses a struct defining: - the test array - the size of the array - an element to check - the type of the node for the element - the type of the value for the node All the fields are checked for a match. This makes the simple arrays test case more reliable.
* Add array-test to the JSON-GLib types unit testsEmmanuele Bassi2008-03-022-3/+57
| | | | | This simple unit will test the JsonArray API, as part of the coverage test for the JSON-GLib types.
* Coalesce test-03 into test-parserEmmanuele Bassi2008-03-023-445/+161
| | | | | | | The third test under the tests/ directory was the last JsonParser test, dealing with object parsing. Now, test-parser is complete and contains all the JsonParser test cases. It still needs further testing to verify the DOM created by the parser object.
* Update the tests build to be a testing unitEmmanuele Bassi2008-03-021-34/+5
| | | | | | | | | Instead of having stand alone tests, use the GTest framework and start coalescing multiple test cases into one. The tests directory will be used for JsonParser, JsonGenerator and the JSON-GObject integration API, by reusing the previous test cases and remolding them into a more interesting test framework.
* Remove old, empty string testEmmanuele Bassi2008-03-021-57/+0
|
* Rename JsonParser test, and coaelesce basic parser and array testsEmmanuele Bassi2008-03-021-0/+262
| | | | | | | Instead of using a single test for empty strings and another test for arrays, merge the two into a single test unit, using the GTest API. The JsonObject parsing test will also be merged later.
* Port the empty string test to the GLib testing frameworkEmmanuele Bassi2008-03-021-9/+35
| | | | | | | | | The old test-01 program tested the JsonParser with an empty string; instead of relying on the exit code and error messages on screen, it shoul use the new GTest API. This is the first test of the old test suite to be ported to the new test framework API.
* Add a JsonNode copy test unitEmmanuele Bassi2008-03-021-0/+15
| | | | | The test unit copies a NULL JsonNode and checks that the copy and the original nodes are equivalent.
* Update Makefile templates to include the testing frameworkEmmanuele Bassi2008-03-024-6/+37
|
* Update gitignore fileEmmanuele Bassi2008-03-011-0/+4
|
* Add initial test suite support using GLib's new testing frameworkEmmanuele Bassi2008-03-016-3/+112
| | | | | | | | | | | | | | GLib 2.15 added a new test unit framework to the GLib API. It allows integrating unit testing into GLib and GObject based libraries and applications. It requires a specially crafter Makefile holding a set of declarations, which must be included into the project own Makefile templates; then it is possible to drop tests inside a subdirectory, which will be built after the library or application, and executed upon "make check". At the moment, there is a simple test for the JsonNode API, with a single unit for the "null" node type.
* Update the JSON-GLib Vala bindingsworkEmmanuele Bassi2008-01-293-39/+38
| | | | | | | | | | | | | Add a dependencies file, so that valac can simply use the json-glib-1.0 package and correcly chain up all the dependencies needed (at the moment, only glib-2.0). Update the vapi file to match with the GLib bindings with regards to the out length parameters and some weak pointers. The only way to properly solve the weak assignments issue would be to make JsonNode, JsonObject and JsonArray proper GObjects, or at least add reference counting to JsonNode. Not going to happend in 0.6, but it's worth adding it to the 1.0 roadmap.
* Remove % from the pkg-config file ruleEmmanuele Bassi2008-01-291-1/+1
| | | | | Rules starting with '%' are a make-isms, and automake 1.10 complains a lot about them.
* Remove json_parser_peek_root from the gtk-doc sectionsEmmanuele Bassi2008-01-291-1/+0
| | | | | The json_parser_peek_root() function has been removed, and so we do not its symbol in the json-glib-sections.txt file anymore.
* Update after the JsonParser::get_root changeEmmanuele Bassi2008-01-294-8/+2
| | | | | Do not free the root node returned by the get_root() method in the JSON-GObject API and in the JsonParser tests.
* Revert JsonParser::get_root semanticsEmmanuele Bassi2008-01-292-25/+2
| | | | | | | | | The get_root() method should not return a copy of the parsed node: it is up to the developer copying it, if it needs to be kept around across multiple parsing runs. This commit reverts the 0b6b09c0 commit, by removing the peek_root() method and restoring the previous get_root() method behaviour.
* Use the normalized member name in has_memberEmmanuele Bassi2008-01-281-1/+1
| | | | | The json_object_has_member() used the passed in member name, instead of the correctly normalized one.
* Extract the parser state clearing into its own functionEmmanuele Bassi2008-01-271-21/+30
| | | | | | | | The JsonParser object clears its state upon starting the parsing sequence or during the instance destruction process. It's worth moving the free and unref calls into their own function to be called by the load_from_data() and dispose methods. As further optimisation, inlining them should be worth as well.
* Wrap config.h include with conditionalsEmmanuele Bassi2007-12-255-0/+11
| | | | | Including the autotools generated config.h should always be conditional on the HAVE_CONFIG_H definitions.
* Kill off a few indirectionsEmmanuele Bassi2007-12-251-11/+14
| | | | Use an intermediary pointer to avoid a lot of pointer dereferences
* Some miscellaneous fixes to the Vala bindingsEmmanuele Bassi2007-12-253-27/+85
| | | | | | | | Expose the properties as members and remove the accessor methods in case it's obvious that they are just function proxies. Also, start binding the basic GObject API, even though no serializable support is ready, yet.
* Provide a default implementation of JsonSerializableEmmanuele Bassi2007-12-251-88/+120
| | | | | | | | The JsonSerializable interface can provide a default implementation, using the powers of GTypeInterface. This means that classes implementing the interface can opt to implement both, either or none of the JsonSerializable methods, and still be able to retain some basic functionality for the methods they decide not to implement.
* Plug a leak when loading a new buffer with the same parserEmmanuele Bassi2007-12-251-0/+2
| | | | | | When the same JsonParser loads a different buffer it needs to clear out the current state; this means clearing the variable_name string it saves when the passed JSON stream is a JavaScript assignment.
* Use gssize for the buffer length parameterEmmanuele Bassi2007-12-252-6/+6
| | | | | | | Since we allow a negative value, meaning "take the whole string", for the length parameter, when need a signed size_t. This also fixes the bug where we implicitly always computed the buffer length and discarded the passed length parameter.
* Initialise to zero when creating/copying a JsonNodeEmmanuele Bassi2007-12-251-4/+5
| | | | Avoid feeding garbage to the callers by using g_slice_new0().
* Do not leak the intermediate strings when generating JSONEmmanuele Bassi2007-12-251-0/+6
| | | | Found this very dumb leak while using Valgrind.
* Do not free the pointer to the boxed type we get when serialisingEmmanuele Bassi2007-12-251-2/+0
| | | | | | The pointer returned by g_value_get_boxed() is just a pointer to the internal copy inside GValue, and it's not ours to free, as Valgrind gently pointed out.
* Add a simple Vala serialization exampleEmmanuele Bassi2007-11-221-0/+40
| | | | | | We don't provide the Serializable interface at the moment, because it is too much C-oriented. This example shows how to serialize a class in Vala to a JSON string.
* Omit the lenght argument now that we provide a defaultEmmanuele Bassi2007-11-221-1/+1
|
* Fix the Vala bindingsEmmanuele Bassi2007-11-221-9/+11
| | | | | | | | | Miscellaneous fixes for the Vala bindings of JSON-GLib: * add missing return values for a couple of methods * decorate the Object and Array constructors with their C names * correctly transfer the ownership when adding members/elements * add the non-null value marker for strings * provide default values for the length argument in from_data()/to_data()
* Recurse into the contrib directory only if Vala is availableEmmanuele Bassi2007-11-222-1/+10
| | | | | | If Vala is not available then there's no point in getting into the contrib directory. This might change in the future, so we already have the HAVE_VALA conditional for the Makefiles.
* Update the test case for the Vala bindingsEmmanuele Bassi2007-11-211-2/+2
|