diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2007-04-06 20:12:18 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2007-04-06 20:12:18 +0000 |
| commit | e5738bba197fec55b5cecd83c56be0a46fd006b6 (patch) | |
| tree | 563778ef93d06e2fea2003a73ca63409a25fef06 /src/sp-style-elem-test.h | |
| parent | Prevent null pointer dereferencing (diff) | |
| download | inkscape-e5738bba197fec55b5cecd83c56be0a46fd006b6.tar.gz inkscape-e5738bba197fec55b5cecd83c56be0a46fd006b6.zip | |
Additional null pointer checking
(bzr r2827)
Diffstat (limited to 'src/sp-style-elem-test.h')
| -rw-r--r-- | src/sp-style-elem-test.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/sp-style-elem-test.h b/src/sp-style-elem-test.h index 8f52e8afd..755fe4418 100644 --- a/src/sp-style-elem-test.h +++ b/src/sp-style-elem-test.h @@ -73,6 +73,12 @@ public: 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; @@ -93,6 +99,12 @@ public: 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"); @@ -115,6 +127,12 @@ public: 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"); |
