[gobject-introspection] Update tests to show off some new features



commit 5d338847ffdce68f28ffefa3925bab8394e780d0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Aug 29 06:02:59 2012 -0300

    Update tests to show off some new features
    
    These includes more proper links and fundamentals.

 .../DocExamples.Obj.method.page                    |   40 ++++++++++++++++---
 .../DocExamples.Obj.method.page                    |   41 +++++++++++++++++---
 tests/doctool/doc-examples-obj.c                   |   19 +++++++--
 tests/doctool/doc-examples-obj.h                   |    3 +-
 4 files changed, 86 insertions(+), 17 deletions(-)
---
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
index f6c2eba..5f27f96 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
@@ -10,7 +10,7 @@
     <link type="guide" xref="DocExamples.Obj" group="method"/>
     <api:function>
       <api:returns>
-        <api:type>void</api:type>
+        <api:type>gboolean</api:type>
       </api:returns>
       <api:name>doc_examples_obj_method</api:name>
       <api:arg>
@@ -25,28 +25,56 @@
         <api:type>gfloat</api:type>
         <api:name>second_arg</api:name>
       </api:arg>
+      <api:arg>
+        <api:type>gboolean</api:type>
+        <api:name>boolean_arg</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>gpointer</api:type>
+        <api:name>pointer_arg</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>gchar*</api:type>
+        <api:name>string</api:name>
+      </api:arg>
     </api:function>
   </info>
   <title>doc_examples_obj_method</title>
 <synopsis><code mime="text/x-csrc">
-void doc_examples_obj_method (DocExamplesObj *self,
+gboolean doc_examples_obj_method (DocExamplesObj *self,
 gint first_arg,
-                              gfloat second_arg);
+                                  gfloat second_arg,
+                                  gboolean boolean_arg,
+                                  gpointer pointer_arg,
+                                  gchar* string);
 </code></synopsis>
-<p>This is an example of how to document a method.</p>
+<p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was
+created with <link xref="DocExamples.Obj.new">doc_examples_obj_new</link>.</p><p>This should be a %FALSEALARM.</p>
 
 <table>
 <tr>
 <td><p>first_arg :</p></td>
-<td><p>first argument</p></td>
+<td><p>A <link xref="DocExamples.Obj">DocExamples.Obj</link>.</p></td>
 </tr>
 <tr>
 <td><p>second_arg :</p></td>
 <td><p>second argument</p></td>
 </tr>
 <tr>
+<td><p>boolean_arg :</p></td>
+<td><p>You should always pass TRUE.</p></td>
+</tr>
+<tr>
+<td><p>pointer_arg :</p></td>
+<td><p>If not NULL, do a thing.</p></td>
+</tr>
+<tr>
+<td><p>string :</p></td>
+<td><p>A NULL-terminated string.</p></td>
+</tr>
+<tr>
 <td><p>Returns :</p></td>
-<td></td>
+<td><p>Either FALSE or something FALSE-y.</p></td>
 </tr>
 </table>
 <p>Since 0.99</p>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
index 9f7e496..02f3a00 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
@@ -10,7 +10,7 @@
     <link type="guide" xref="DocExamples.Obj" group="method"/>
     <api:function>
       <api:returns>
-        <api:type>none</api:type>
+        <api:type>gboolean</api:type>
       </api:returns>
       <api:name>doc_examples_obj_method</api:name>
       <api:arg>
@@ -25,25 +25,54 @@
         <api:type>gfloat</api:type>
         <api:name>second_arg</api:name>
       </api:arg>
+      <api:arg>
+        <api:type>gboolean</api:type>
+        <api:name>boolean_arg</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>gpointer</api:type>
+        <api:name>pointer_arg</api:name>
+      </api:arg>
+      <api:arg>
+        <api:type>utf8</api:type>
+        <api:name>string</api:name>
+      </api:arg>
     </api:function>
   </info>
   <title>method</title>
 <synopsis><code mime="text/x-python">
- accepts(gint, gfloat)
- returns(none)
-def method(first_arg, second_arg)
+ accepts(gint, gfloat, gboolean, gpointer, utf8)
+ returns(gboolean)
+def method(first_arg, second_arg, boolean_arg, pointer_arg, string)
 </code></synopsis>
-<p>This is an example of how to document a method.</p>
+<p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was
+created with <link xref="DocExamples.Obj.new">Obj.new</link>.</p><p>This should be a %FALSEALARM.</p>
 
 <table>
 <tr>
 <td><p>first_arg :</p></td>
-<td><p>first argument</p></td>
+<td><p>A <link xref="DocExamples.Obj">DocExamples.Obj</link>.</p></td>
 </tr>
 <tr>
 <td><p>second_arg :</p></td>
 <td><p>second argument</p></td>
 </tr>
+<tr>
+<td><p>boolean_arg :</p></td>
+<td><p>You should always pass True.</p></td>
+</tr>
+<tr>
+<td><p>pointer_arg :</p></td>
+<td><p>If not None, do a thing.</p></td>
+</tr>
+<tr>
+<td><p>string :</p></td>
+<td><p>A None-terminated string.</p></td>
+</tr>
+<tr>
+<td><p>Returns :</p></td>
+<td><p>Either False or something False-y.</p></td>
+</tr>
 </table>
 <p>Since 0.99</p>
 </page>
diff --git a/tests/doctool/doc-examples-obj.c b/tests/doctool/doc-examples-obj.c
index 0839f1c..44360d9 100644
--- a/tests/doctool/doc-examples-obj.c
+++ b/tests/doctool/doc-examples-obj.c
@@ -102,15 +102,26 @@ doc_examples_obj_new (void)
 
 /**
  * doc_examples_obj_method:
- * @first_arg: first argument
+ * @first_arg: A #DocExamplesObj.
  * @second_arg: second argument
+ * @boolean_arg: You should always pass %TRUE.
+ * @pointer_arg: (allow-none): If not %NULL, do a thing.
+ * @string: A %NULL-terminated string.
  *
  * This is an example of how to document a method.
  *
+ * You should call this on a #DocExamplesObj that was
+ * created with doc_examples_obj_new().
+ *
+ * This should be a %FALSEALARM.
+ *
  * Since: 0.99
+ *
+ * Returns: Either %FALSE or something %FALSE-y.
  */
-void
-doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg)
+gboolean
+doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg,
+                         gboolean boolean_arg, gpointer pointer_arg, gchar *string)
 {
-
+  return FALSE;
 }
diff --git a/tests/doctool/doc-examples-obj.h b/tests/doctool/doc-examples-obj.h
index 7bc9e1d..c8840d7 100644
--- a/tests/doctool/doc-examples-obj.h
+++ b/tests/doctool/doc-examples-obj.h
@@ -56,7 +56,8 @@ struct _DocExamplesObjClass
 GType doc_examples_obj_get_type (void) G_GNUC_CONST;
 
 DocExamplesObj *doc_examples_obj_new (void);
-void doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg);
+gboolean doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg,
+                                  gboolean boolean_arg, gpointer pointer_arg, gchar *string);
 
 G_END_DECLS
 



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