summaryrefslogtreecommitdiff
path: root/tests/test-surface.cc
diff options
context:
space:
mode:
authorJonathon Jongsma <jonathon.jongsma@collabora.co.uk>2008-09-10 23:24:02 -0500
committerJonathon Jongsma <jonathon.jongsma@collabora.co.uk>2008-09-10 23:24:02 -0500
commit9dd1d4f2ca9db9b748ec09f73a9e76d710ddd801 (patch)
tree18eb615559bbdbc0759783f5d05e9bfae5c20bfb /tests/test-surface.cc
parent481ee483b6cae63e3a0d52a9b507637f56f541f8 (diff)
Add Surface::get_content() + test
Diffstat (limited to 'tests/test-surface.cc')
-rw-r--r--tests/test-surface.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test-surface.cc b/tests/test-surface.cc
index 865d212..c60fbcc 100644
--- a/tests/test-surface.cc
+++ b/tests/test-surface.cc
@@ -93,6 +93,15 @@ void test_ps_eps()
BOOST_CHECK_EQUAL(ps->get_eps(), !result);
}
+void test_content()
+{
+ RefPtr<ImageSurface> surface = ImageSurface::create(FORMAT_ARGB32, 1, 1);
+ BOOST_CHECK_EQUAL(surface->get_content(), CONTENT_COLOR_ALPHA);
+ RefPtr<Surface> similar = Surface::create(surface, CONTENT_ALPHA, 1, 1);
+ BOOST_REQUIRE(similar);
+ BOOST_CHECK_EQUAL(similar->get_content(), CONTENT_ALPHA);
+}
+
test_suite*
init_unit_test_suite(int argc, char* argv[])
@@ -108,6 +117,7 @@ init_unit_test_suite(int argc, char* argv[])
test->add (BOOST_TEST_CASE (&test_svg_constructor_slot));
test->add (BOOST_TEST_CASE (&test_create_from_png));
test->add (BOOST_TEST_CASE (&test_ps_eps));
+ test->add (BOOST_TEST_CASE (&test_content));
return test;
}