summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am3
-rw-r--r--src/color-profile-test.h16
-rw-r--r--src/sp-style-elem-test.h33
3 files changed, 27 insertions, 25 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a0c240252..a0c857aa3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -267,7 +267,8 @@ TESTS = $(check_PROGRAMS) ../share/extensions/test/run-all-extension-tests
XFAIL_TESTS = $(check_PROGRAMS)
# including the the testsuites here ensures that they get distributed
-cxxtests_SOURCES = cxxtests.cpp $(CXXTEST_TESTSUITES)
+cxxtests_SOURCES = cxxtests.cpp $(CXXTEST_TESTSUITES) $(ink_common_sources) $(win32_sources)
+cxxtests_LDFLAGS = -z muldefs
cxxtests_LDADD = $(all_libs)
cxxtests.cpp: $(CXXTEST_TESTSUITES) $(CXXTEST_TEMPLATE)
diff --git a/src/color-profile-test.h b/src/color-profile-test.h
index b3ead5d55..4276eb774 100644
--- a/src/color-profile-test.h
+++ b/src/color-profile-test.h
@@ -31,13 +31,13 @@ public:
static void createSuiteSubclass( ColorProfileTest*& dst )
{
- Inkscape::ColorProfile *prof = static_cast<Inkscape::ColorProfile *>(g_object_new(COLORPROFILE_TYPE, NULL));
+ Inkscape::ColorProfile *prof = new Inkscape::ColorProfile();
if ( prof ) {
if ( prof->rendering_intent == (guint)Inkscape::RENDERING_INTENT_UNKNOWN ) {
TS_ASSERT_EQUALS( prof->rendering_intent, (guint)Inkscape::RENDERING_INTENT_UNKNOWN );
dst = new ColorProfileTest();
}
- g_object_unref(prof);
+ delete prof;
}
}
@@ -74,7 +74,7 @@ public:
{"auto2", (guint)Inkscape::RENDERING_INTENT_UNKNOWN},
};
- Inkscape::ColorProfile *prof = static_cast<Inkscape::ColorProfile *>(g_object_new(COLORPROFILE_TYPE, NULL));
+ Inkscape::ColorProfile *prof = new Inkscape::ColorProfile();
TS_ASSERT( prof );
SP_OBJECT(prof)->document = _doc;
@@ -84,7 +84,7 @@ public:
TSM_ASSERT_EQUALS( descr, prof->rendering_intent, (guint)cases[i].intVal );
}
- g_object_unref(prof);
+ delete prof;
}
void testSetLocal()
@@ -94,7 +94,7 @@ public:
"something",
};
- Inkscape::ColorProfile *prof = static_cast<Inkscape::ColorProfile *>(g_object_new(COLORPROFILE_TYPE, NULL));
+ Inkscape::ColorProfile *prof = new Inkscape::ColorProfile();
TS_ASSERT( prof );
SP_OBJECT(prof)->document = _doc;
@@ -108,7 +108,7 @@ public:
SP_OBJECT(prof)->setKeyValue( SP_ATTR_LOCAL, NULL);
TS_ASSERT_EQUALS( prof->local, (gchar*)0 );
- g_object_unref(prof);
+ delete prof;
}
void testSetName()
@@ -118,7 +118,7 @@ public:
"something",
};
- Inkscape::ColorProfile *prof = static_cast<Inkscape::ColorProfile *>(g_object_new(COLORPROFILE_TYPE, NULL));
+ Inkscape::ColorProfile *prof = new Inkscape::ColorProfile();
TS_ASSERT( prof );
SP_OBJECT(prof)->document = _doc;
@@ -132,7 +132,7 @@ public:
SP_OBJECT(prof)->setKeyValue( SP_ATTR_NAME, NULL);
TS_ASSERT_EQUALS( prof->name, (gchar*)0 );
- g_object_unref(prof);
+ delete prof;
}
};
diff --git a/src/sp-style-elem-test.h b/src/sp-style-elem-test.h
index 7021be13d..6f65a48ea 100644
--- a/src/sp-style-elem-test.h
+++ b/src/sp-style-elem-test.h
@@ -28,12 +28,13 @@ public:
static void createSuiteSubclass( SPStyleElemTest *& dst )
{
- SPStyleElem *style_elem = static_cast<SPStyleElem *>(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
+ SPStyleElem *style_elem = new SPStyleElem();
+
if ( style_elem ) {
TS_ASSERT(!style_elem->is_css);
TS_ASSERT(style_elem->media.print);
TS_ASSERT(style_elem->media.screen);
- g_object_unref(style_elem);
+ delete style_elem;
dst = new SPStyleElemTest();
}
@@ -52,7 +53,7 @@ public:
void testSetType()
{
- SPStyleElem *style_elem = static_cast<SPStyleElem *>(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
+ SPStyleElem *style_elem = new SPStyleElem();
SP_OBJECT(style_elem)->document = _doc;
SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "something unrecognized");
@@ -67,7 +68,7 @@ public:
SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "text/cssx");
TS_ASSERT( !style_elem->is_css );
- g_object_unref(style_elem);
+ delete style_elem;
}
void testWrite()
@@ -78,7 +79,7 @@ public:
return; // evil early return
}
- SPStyleElem *style_elem = SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
+ SPStyleElem *style_elem = new SPStyleElem();
SP_OBJECT(style_elem)->document = _doc;
SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "text/css");
@@ -93,7 +94,7 @@ public:
}
}
- g_object_unref(style_elem);
+ delete style_elem;
}
void testBuild()
@@ -104,13 +105,13 @@ public:
return; // evil early return
}
- SPStyleElem &style_elem = *SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
+ SPStyleElem *style_elem = new SPStyleElem();
Inkscape::XML::Node *const repr = _doc->getReprDoc()->createElement("svg:style");
repr->setAttribute("type", "text/css");
- (&style_elem)->invoke_build( _doc, repr, false);
- TS_ASSERT( style_elem.is_css );
- TS_ASSERT( style_elem.media.print );
- TS_ASSERT( style_elem.media.screen );
+ style_elem->invoke_build( _doc, repr, false);
+ TS_ASSERT( style_elem->is_css );
+ TS_ASSERT( style_elem->media.print );
+ TS_ASSERT( style_elem->media.screen );
/* Some checks relevant to the read_content test below. */
{
@@ -120,7 +121,7 @@ public:
g_assert(stylesheet->statements == NULL);
}
- g_object_unref(&style_elem);
+ delete style_elem;
Inkscape::GC::release(repr);
}
@@ -132,19 +133,19 @@ public:
return; // evil early return
}
- SPStyleElem &style_elem = *SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
+ SPStyleElem *style_elem = new SPStyleElem();
Inkscape::XML::Node *const repr = _doc->getReprDoc()->createElement("svg:style");
repr->setAttribute("type", "text/css");
Inkscape::XML::Node *const content_repr = _doc->getReprDoc()->createTextNode(".myclass { }");
repr->addChild(content_repr, NULL);
- (&style_elem)->invoke_build(_doc, repr, false);
- TS_ASSERT( style_elem.is_css );
+ style_elem->invoke_build(_doc, repr, false);
+ TS_ASSERT( style_elem->is_css );
TS_ASSERT( _doc->style_cascade );
CRStyleSheet const *const stylesheet = cr_cascade_get_sheet(_doc->style_cascade, ORIGIN_AUTHOR);
TS_ASSERT(stylesheet != NULL);
TS_ASSERT(stylesheet->statements != NULL);
- g_object_unref(&style_elem);
+ delete style_elem;
Inkscape::GC::release(repr);
}