summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a1276e3)
raw | patch | inline | side by side (parent: a1276e3)
author | joncruz <joncruz@users.sourceforge.net> | |
Fri, 6 Apr 2007 20:12:18 +0000 (20:12 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Fri, 6 Apr 2007 20:12:18 +0000 (20:12 +0000) |
src/inkscape.cpp | patch | blob | history | |
src/sp-style-elem-test.h | patch | blob | history |
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 829aacdc989166f99afac3b7f6beaef68b88351e..c167be493c0900a05a12b9560472da180c80b6a8 100644 (file)
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
return NULL;
}
- Inkscape::XML::Node *repr = Inkscape::Preferences::get()->root();
+ Inkscape::XML::Node *prefs = Inkscape::Preferences::get();
+ if ( !prefs ) {
+ return NULL;
+ }
+
+ Inkscape::XML::Node *repr = prefs->root();
if (!repr) return NULL;
g_assert (!(strcmp (repr->name(), "inkscape")));
index 8f52e8afda9fded5892eced58320e4bbe01002a4..755fe4418af9295cf9b89f59bf1300fa56ae8f34 100644 (file)
--- a/src/sp-style-elem-test.h
+++ b/src/sp-style-elem-test.h
void testWrite()
{
+ TS_ASSERT( _doc );
+ TS_ASSERT( sp_document_repr_doc(_doc) );
+ if ( !sp_document_repr_doc(_doc) ) {
+ return; // evil early return
+ }
+
SPStyleElem *style_elem = SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
SP_OBJECT(style_elem)->document = _doc;
void testBuild()
{
+ TS_ASSERT( _doc );
+ TS_ASSERT( sp_document_repr_doc(_doc) );
+ if ( !sp_document_repr_doc(_doc) ) {
+ return; // evil early return
+ }
+
SPStyleElem &style_elem = *SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
Inkscape::XML::Node *const repr = sp_document_repr_doc(_doc)->createElement("svg:style");
repr->setAttribute("type", "text/css");
void testReadContent()
{
+ TS_ASSERT( _doc );
+ TS_ASSERT( sp_document_repr_doc(_doc) );
+ if ( !sp_document_repr_doc(_doc) ) {
+ return; // evil early return
+ }
+
SPStyleElem &style_elem = *SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
Inkscape::XML::Node *const repr = sp_document_repr_doc(_doc)->createElement("svg:style");
repr->setAttribute("type", "text/css");