From b07c5597b54104b95177aff2542679844bc16b37 Mon Sep 17 00:00:00 2001 From: keescook Date: Sat, 13 Jan 2007 07:28:41 +0000 Subject: [PATCH] fixes for style-test prefs crashes --- src/Makefile.am | 6 ++++++ src/inkscape.cpp | 1 + src/style-test.cpp | 1 + src/xml/repr.h | 2 ++ 4 files changed, 10 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index c5d9138b9..cda0a04fd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -194,6 +194,12 @@ TESTS = \ xml/quote-test$(EXEEXT) \ xml/repr-action-test$(EXEEXT) +# Amd64 failures?? +#XFAIL_TESTS = \ +# test-all$(EXEEXT) \ +# style-test$(EXEEXT) \ +# svg/test-svg$(EXEEXT) + # streamtest is unfinished and can't handle the relocations done during # "make distcheck". Not needed for the 0.41 release. # io/streamtest$(EXEEXT) diff --git a/src/inkscape.cpp b/src/inkscape.cpp index d3cc1aa00..b7af482b2 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -713,6 +713,7 @@ inkscape_get_repr (Inkscape::Application *inkscape, const gchar *key) } Inkscape::XML::Node *repr = sp_repr_document_root (Inkscape::Preferences::get()); + if (!repr) return NULL; g_assert (!(strcmp (repr->name(), "inkscape"))); gchar const *s = key; diff --git a/src/style-test.cpp b/src/style-test.cpp index 54be0040e..5c123704b 100644 --- a/src/style-test.cpp +++ b/src/style-test.cpp @@ -619,6 +619,7 @@ test_style() utest_start("style"); UTEST_TEST("sp_style_new, sp_style_write_string") { SPStyle *style = sp_style_new(); + g_assert(style); gchar *str0_all = sp_style_write_string(style, SP_STYLE_FLAG_ALWAYS); gchar *str0_set = sp_style_write_string(style, SP_STYLE_FLAG_IFSET); UTEST_ASSERT(*str0_set == '\0'); diff --git a/src/xml/repr.h b/src/xml/repr.h index dc96cb3e6..f930ed0c5 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -143,11 +143,13 @@ Inkscape::XML::Document *sp_repr_document_new(gchar const *rootname); /// Returns root node of document. inline Inkscape::XML::Node *sp_repr_document_root(Inkscape::XML::Document const *doc) { + if (!doc) return NULL; return const_cast(doc->root()); } /// Returns the node's document. inline Inkscape::XML::Document *sp_repr_document(Inkscape::XML::Node const *repr) { + if (!repr) return NULL; return const_cast(repr->document()); } -- 2.30.2