summaryrefslogtreecommitdiff
path: root/test/lib/testobject.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-09-29 01:41:23 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-09-29 01:41:23 +0000
commit01f9dc3a2fb3f6bfbb4dab27304371dd3c6345f4 (patch)
treeff2739087c040f4872adef4a3d0b3731f04ebea3 /test/lib/testobject.c
parentf83f65025b74f585f75db1a056f7a2fe4e215b69 (diff)
downloadlibdom-01f9dc3a2fb3f6bfbb4dab27304371dd3c6345f4.tar.gz
libdom-01f9dc3a2fb3f6bfbb4dab27304371dd3c6345f4.tar.bz2
dom_initialise() and dom_finalise() are now completely public, rather than hidden away in a header only meant for inclusion by bindings. Client applications are responsible for initialisation and finalisation of the dom library. This must happen before/after (respectively) any call to a dom library or dom binding library function.
The reason for this change is that, if multiple bindings are required, then the dom library should still only be initialised/finalised once. Only the client can enforce this sensibly. svn path=/trunk/dom/; revision=3606
Diffstat (limited to 'test/lib/testobject.c')
-rw-r--r--test/lib/testobject.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/testobject.c b/test/lib/testobject.c
index 17e5233..6873475 100644
--- a/test/lib/testobject.c
+++ b/test/lib/testobject.c
@@ -8,6 +8,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <dom/bootstrap/init_fini.h>
+
#include "bindings/xml/xmlbinding.h"
#include "bindings/xml/xmlparser.h"
@@ -42,6 +44,8 @@ TestObject *test_object_create(int argc, char **argv,
}
if (xml_parser_initialised == false) {
+ assert(dom_initialise(myrealloc, NULL) == DOM_NO_ERR);
+
assert(xml_dom_binding_initialise(myrealloc, NULL) == XML_OK);
atexit(test_object_cleanup);
@@ -119,7 +123,9 @@ const char *test_object_get_mimetype(TestObject *obj)
void test_object_cleanup(void)
{
- if (xml_parser_initialised)
+ if (xml_parser_initialised) {
xml_dom_binding_finalise();
+ dom_finalise();
+ }
}