[perl-Gtk2] Improve the Gtk2::TextMark docs



commit 595c046e656b16e3ef297c21a3764ba1e1434f74
Author: Kevin Ryde <user42 zip com au>
Date:   Wed Apr 14 11:29:35 2010 +1000

    Improve the Gtk2::TextMark docs
    
    Add the _ornull flag to the return values of gtk_text_mark_get_name and
    gtk_text_mark_get_buffer to show undef in generated POD.
    
    (The added tests passed already before this change.)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=615796

 t/GtkTextMark.t   |   12 ++++++++----
 xs/GtkTextMark.xs |    6 +++---
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/t/GtkTextMark.t b/t/GtkTextMark.t
index 2a32827..7fffef2 100644
--- a/t/GtkTextMark.t
+++ b/t/GtkTextMark.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 use strict;
-use Gtk2::TestHelper tests => 7, noinit => 1;
+use Gtk2::TestHelper tests => 11, noinit => 1;
 
 # $Id$
 
@@ -18,20 +18,24 @@ $mark -> set_visible(1);
 is($mark -> get_visible(), 1);
 
 $buffer -> delete_mark($mark);
-is($mark -> get_deleted(), 1);
+is($mark -> get_deleted(), 1,    'deleted mark - get_deleted()');
+is($mark -> get_buffer(), undef, 'deleted mark - get_buffer()');
 
 SKIP: {
-  skip 'new 2.12 stuff', 2
+  skip 'new 2.12 stuff', 5
     unless Gtk2 -> CHECK_VERSION(2, 12, 0);
 
   my $mark = Gtk2::TextMark -> new(undef, TRUE);
   isa_ok($mark, 'Gtk2::TextMark');
+  is ($mark->get_name,   undef, 'new() anonymous mark - get_name()');
+  is ($mark->get_buffer, undef, 'new() anonymous mark - get_buffer()');
 
   $mark = Gtk2::TextMark -> new('bla', TRUE);
   isa_ok($mark, 'Gtk2::TextMark');
+  is ($mark->get_name, 'bla', 'new() named mark - get_name()');
 }
 
 __END__
 
-Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003, 2010 by the gtk2-perl team (see the file AUTHORS for the
 full list).  See LICENSE for more information.
diff --git a/xs/GtkTextMark.xs b/xs/GtkTextMark.xs
index f8ae77f..0269ea6 100644
--- a/xs/GtkTextMark.xs
+++ b/xs/GtkTextMark.xs
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003, 2010 by the gtk2-perl team (see the file AUTHORS)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -50,12 +50,12 @@ gtk_text_mark_get_deleted (mark)
 	GtkTextMark *mark
 
 ## gchar* gtk_text_mark_get_name (GtkTextMark *mark);
-const gchar *
+const gchar_ornull *
 gtk_text_mark_get_name (mark)
 	GtkTextMark * mark
 
 ## GtkTextBuffer* gtk_text_mark_get_buffer (GtkTextMark *mark)
-GtkTextBuffer*
+GtkTextBuffer_ornull*
 gtk_text_mark_get_buffer (mark)
 	GtkTextMark *mark
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]