[cairo-commit] rcairo/test test_context.rb,1.2,1.3

Kouhei Sutou commit at pdx.freedesktop.org
Sat Aug 16 00:23:18 PDT 2008


Committed by: kou

Update of /cvs/cairo/rcairo/test
In directory kemper:/tmp/cvs-serv29012/test

Modified Files:
	test_context.rb 
Log Message:
        * src/rb_cairo_context.c: support Cairo::Context#have_show_text_glyphs?.

        * test/test_context.rb (ContextTest#test_have_show_text_glyphs):
        add a test for Cairo::Context#have_show_text_glyphs?.


Index: test_context.rb
===================================================================
RCS file: /cvs/cairo/rcairo/test/test_context.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test_context.rb	14 Aug 2008 08:11:15 -0000	1.2
+++ test_context.rb	16 Aug 2008 07:23:16 -0000	1.3
@@ -2,6 +2,8 @@
 require 'stringio'
 
 class ContextTest < Test::Unit::TestCase
+  include CairoTestUtils
+
   def setup
     @output = StringIO.new
     @surface = Cairo::PDFSurface.new(@output, 10, 10)
@@ -44,4 +46,16 @@
     context.font_face = face
     assert_equal("sans", context.font_face.family)
   end
+
+  def test_have_show_text_glyphs?
+    only_cairo_version(1, 7, 2)
+
+    pdf_surface = Cairo::PDFSurface.new(@output, 10, 10)
+    context = Cairo::Context.new(pdf_surface)
+    assert_true(context.have_show_text_glyphs?)
+
+    image_surface = Cairo::ImageSurface.new(10, 10)
+    context = Cairo::Context.new(image_surface)
+    assert_false(context.have_show_text_glyphs?)
+  end
 end



More information about the cairo-commit mailing list