[gobject-introspection/wip/transformer: 6/13] [tests/scanner] Fix namespacing for Foo, Drawable, Utility, TestInherit



commit 79c1ec9176640047a46f5f1a4b7c34e425d20f69
Author: Colin Walters <walters verbum org>
Date:   Thu Jul 29 08:00:23 2010 -0400

    [tests/scanner] Fix namespacing for Foo, Drawable, Utility, TestInherit
    
    Various tests had incorrect namespacing; the scanner will be
    more strict about this in the future.

 ....0-expected.gir => Annotation-1.0-expected.gir} |    6 +-
 tests/scanner/BarApp-1.0-expected.gir              |    4 +-
 .../{foo-1.0-expected.gir => Foo-1.0-expected.gir} |   20 ++++----
 tests/scanner/Makefile.am                          |   54 ++++++++++----------
 ...0-expected.gir => TestInherit-1.0-expected.gir} |   37 +++++++-------
 ...y-1.0-expected.gir => Utility-1.0-expected.gir} |    4 +-
 tests/scanner/barapp.c                             |    4 +-
 tests/scanner/barapp.h                             |    4 +-
 tests/scanner/drawable.c                           |   14 +++---
 tests/scanner/drawable.h                           |   28 +++++-----
 10 files changed, 88 insertions(+), 87 deletions(-)
---
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
similarity index 99%
rename from tests/scanner/annotation-1.0-expected.gir
rename to tests/scanner/Annotation-1.0-expected.gir
index 3850668..9401ca2 100644
--- a/tests/scanner/annotation-1.0-expected.gir
+++ b/tests/scanner/Annotation-1.0-expected.gir
@@ -8,12 +8,12 @@ and/or use gtk-doc annotations.  -->
             xmlns:glib="http://www.gtk.org/introspection/glib/1.0";>
   <include name="GLib" version="2.0"/>
   <include name="GObject" version="2.0"/>
-  <include name="utility" version="1.0"/>
+  <include name="Utility" version="1.0"/>
   <package name="gobject-2.0"/>
-  <namespace name="annotation"
+  <namespace name="Annotation"
              version="1.0"
              shared-library="libannotation.so"
-             c:prefix="annotation">
+             c:prefix="Annotation">
     <callback name="Callback" c:type="AnnotationCallback">
       <doc xml:whitespace="preserve">This is a callback.</doc>
       <return-value transfer-ownership="none">
diff --git a/tests/scanner/BarApp-1.0-expected.gir b/tests/scanner/BarApp-1.0-expected.gir
index ca9b7ee..9743d11 100644
--- a/tests/scanner/BarApp-1.0-expected.gir
+++ b/tests/scanner/BarApp-1.0-expected.gir
@@ -27,12 +27,12 @@ and/or use gtk-doc annotations.  -->
         <type name="GObject.ObjectClass" c:type="GObjectClass"/>
       </field>
     </record>
-    <function name="func" c:identifier="barapp_func">
+    <function name="func" c:identifier="bar_app_func">
       <return-value transfer-ownership="none">
         <type name="none" c:type="void"/>
       </return-value>
     </function>
-    <function name="func2" c:identifier="barapp_func2">
+    <function name="func2" c:identifier="bar_app_func2">
       <return-value transfer-ownership="none">
         <type name="none" c:type="void"/>
       </return-value>
diff --git a/tests/scanner/foo-1.0-expected.gir b/tests/scanner/Foo-1.0-expected.gir
similarity index 98%
rename from tests/scanner/foo-1.0-expected.gir
rename to tests/scanner/Foo-1.0-expected.gir
index 80d11e6..4007d96 100644
--- a/tests/scanner/foo-1.0-expected.gir
+++ b/tests/scanner/Foo-1.0-expected.gir
@@ -9,13 +9,13 @@ and/or use gtk-doc annotations.  -->
   <include name="GLib" version="2.0"/>
   <include name="GObject" version="2.0"/>
   <include name="Gio" version="2.0"/>
-  <include name="utility" version="1.0"/>
+  <include name="Utility" version="1.0"/>
   <package name="gobject-2.0"/>
   <c:include name="foo.h"/>
-  <namespace name="foo"
+  <namespace name="Foo"
              version="1.0"
              shared-library="libfoo.so"
-             c:prefix="foo">
+             c:prefix="Foo">
     <alias name="List" target="GLib.SList" c:type="FooList"/>
     <alias name="ObjectCookie" target="any" c:type="FooObjectCookie"/>
     <alias name="XEvent" target="none" c:type="FooXEvent"/>
@@ -347,7 +347,7 @@ uses a C sugar return type.</doc>
       </virtual-method>
       <method name="external_type" c:identifier="foo_object_external_type">
         <return-value transfer-ownership="full">
-          <type name="utility.Object" c:type="UtilityObject*"/>
+          <type name="Utility.Object" c:type="UtilityObject*"/>
         </return-value>
       </method>
       <method name="various" c:identifier="foo_object_various">
@@ -425,7 +425,7 @@ uses a C sugar return type.</doc>
         </return-value>
         <parameters>
           <parameter name="glyph" transfer-ownership="none">
-            <type name="utility.Glyph" c:type="UtilityGlyph"/>
+            <type name="Utility.Glyph" c:type="UtilityGlyph"/>
           </parameter>
         </parameters>
       </method>
@@ -717,7 +717,7 @@ exposed to language bindings.</doc>
     </union>
     <record name="UtilityStruct" c:type="FooUtilityStruct">
       <field name="bar" writable="1">
-        <type name="utility.Struct" c:type="UtilityStruct"/>
+        <type name="Utility.Struct" c:type="UtilityStruct"/>
       </field>
     </record>
     <callback name="VarargsCallback"
@@ -809,16 +809,16 @@ exposed to language bindings.</doc>
       </return-value>
       <parameters>
         <parameter name="object" transfer-ownership="none">
-          <type name="utility.Object" c:type="UtilityObject*"/>
+          <type name="Utility.Object" c:type="UtilityObject*"/>
         </parameter>
         <parameter name="e" transfer-ownership="none">
-          <type name="utility.EnumType" c:type="UtilityEnumType"/>
+          <type name="Utility.EnumType" c:type="UtilityEnumType"/>
         </parameter>
         <parameter name="f" transfer-ownership="none">
-          <type name="utility.FlagType" c:type="UtilityFlagType"/>
+          <type name="Utility.FlagType" c:type="UtilityFlagType"/>
         </parameter>
         <parameter name="s" transfer-ownership="none">
-          <type name="utility.Struct" c:type="UtilityStruct"/>
+          <type name="Utility.Struct" c:type="UtilityStruct"/>
         </parameter>
       </parameters>
     </function>
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index e4105d5..d4252c6 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -7,7 +7,7 @@ INTROSPECTION_SCANNER_ARGS += --warn-all --warn-error
 # it does not work with noinst_LTLIBRARIES
 testlib_LTLIBRARIES = \
 	libannotation.la \
-	libdrawable.la \
+	libtestinherit.la \
 	libfoo.la \
 	libutility.la \
 	libregress.la \
@@ -21,7 +21,7 @@ AM_LDFLAGS = -avoid-version
 LIBS = $(GOBJECT_LIBS) $(GTHREAD_LIBS)
 
 libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
-libdrawable_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
+libtestinherit_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
 libfoo_la_SOURCES = $(srcdir)/foo.c $(srcdir)/foo.h
 libutility_la_SOURCES = $(srcdir)/utility.c $(srcdir)/utility.h
 libgtkfrob_la_SOURCES = $(srcdir)/gtkfrob.c $(srcdir)/gtkfrob.h
@@ -56,34 +56,34 @@ Regress_1_0_gir_INCLUDES = cairo-1.0 Gio-2.0
 Regress_1_0_gir_FILES = $(libregress_la_SOURCES)
 GIRS += Regress-1.0.gir
 
-annotation-1.0.gir: utility-1.0.gir libannotation.la
-annotation_1_0_gir_PACKAGES = gobject-2.0
-annotation_1_0_gir_LIBS = libannotation.la
-annotation_1_0_gir_INCLUDES = GObject-2.0 utility-1.0
-annotation_1_0_gir_FILES = $(libannotation_la_SOURCES)
-GIRS += annotation-1.0.gir
-
-drawable-1.0.gir: utility-1.0.gir libdrawable.la
-drawable_1_0_gir_PACKAGES = gobject-2.0
-drawable_1_0_gir_LIBS = libdrawable.la
-drawable_1_0_gir_INCLUDES = GObject-2.0 utility-1.0
-drawable_1_0_gir_FILES = $(libdrawable_la_SOURCES)
-GIRS += drawable-1.0.gir
-
-foo-1.0.gir: utility-1.0.gir libfoo.la
-foo_1_0_gir_PACKAGES = gobject-2.0
-foo_1_0_gir_LIBS = libfoo.la
-foo_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0 utility-1.0
-foo_1_0_gir_FILES = $(srcdir)/foo.h $(srcdir)/foo.c
-foo_1_0_gir_SCANNERFLAGS = --c-include="foo.h"
-GIRS += foo-1.0.gir
-
-utility-1.0.gir: libutility.la
-utility_1_0_gir_PACKAGES = gobject-2.0
-utility_1_0_gir_LIBS = libutility.la
-utility_1_0_gir_INCLUDES = GObject-2.0
-utility_1_0_gir_FILES = $(libutility_la_SOURCES)
-GIRS += utility-1.0.gir
+Annotation-1.0.gir: Utility-1.0.gir libannotation.la
+Annotation_1_0_gir_PACKAGES = gobject-2.0
+Annotation_1_0_gir_LIBS = libannotation.la
+Annotation_1_0_gir_INCLUDES = GObject-2.0 Utility-1.0
+Annotation_1_0_gir_FILES = $(libannotation_la_SOURCES)
+GIRS += Annotation-1.0.gir
+
+TestInherit-1.0.gir: Utility-1.0.gir libtestinherit.la
+TestInherit_1_0_gir_PACKAGES = gobject-2.0
+TestInherit_1_0_gir_LIBS = libtestinherit.la
+TestInherit_1_0_gir_INCLUDES = GObject-2.0 Utility-1.0
+TestInherit_1_0_gir_FILES = $(libtestinherit_la_SOURCES)
+GIRS += TestInherit-1.0.gir
+
+Foo-1.0.gir: Utility-1.0.gir libfoo.la
+Foo_1_0_gir_PACKAGES = gobject-2.0
+Foo_1_0_gir_LIBS = libfoo.la
+Foo_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0 Utility-1.0
+Foo_1_0_gir_FILES = $(srcdir)/foo.h $(srcdir)/foo.c
+Foo_1_0_gir_SCANNERFLAGS = --c-include="foo.h"
+GIRS += Foo-1.0.gir
+
+Utility-1.0.gir: libutility.la
+Utility_1_0_gir_PACKAGES = gobject-2.0
+Utility_1_0_gir_LIBS = libutility.la
+Utility_1_0_gir_INCLUDES = GObject-2.0
+Utility_1_0_gir_FILES = $(libutility_la_SOURCES)
+GIRS += Utility-1.0.gir
 
 # This one tests different --namespace and --strip-prefix
 GtkFrob-1.0.gir: libgtkfrob.la
diff --git a/tests/scanner/drawable-1.0-expected.gir b/tests/scanner/TestInherit-1.0-expected.gir
similarity index 75%
rename from tests/scanner/drawable-1.0-expected.gir
rename to tests/scanner/TestInherit-1.0-expected.gir
index 9ed7060..3c82fb3 100644
--- a/tests/scanner/drawable-1.0-expected.gir
+++ b/tests/scanner/TestInherit-1.0-expected.gir
@@ -8,20 +8,20 @@ and/or use gtk-doc annotations.  -->
             xmlns:glib="http://www.gtk.org/introspection/glib/1.0";>
   <include name="GLib" version="2.0"/>
   <include name="GObject" version="2.0"/>
-  <include name="utility" version="1.0"/>
+  <include name="Utility" version="1.0"/>
   <package name="gobject-2.0"/>
-  <namespace name="drawable"
+  <namespace name="TestInherit"
              version="1.0"
-             shared-library="libdrawable.so"
-             c:prefix="drawable">
-    <class name="TestDrawable"
-           c:type="TestDrawable"
+             shared-library="libtestinherit.so"
+             c:prefix="TestInherit">
+    <class name="Drawable"
+           c:type="TestInheritDrawable"
            parent="GObject.Object"
            abstract="1"
-           glib:type-name="TestDrawable"
-           glib:get-type="test_drawable_get_type"
-           glib:type-struct="TestDrawableClass">
-      <method name="do_foo" c:identifier="test_drawable_do_foo">
+           glib:type-name="TestInheritDrawable"
+           glib:get-type="test_inherit_drawable_get_type"
+           glib:type-struct="DrawableClass">
+      <method name="do_foo" c:identifier="test_inherit_drawable_do_foo">
         <return-value transfer-ownership="none">
           <type name="none" c:type="void"/>
         </return-value>
@@ -31,7 +31,8 @@ and/or use gtk-doc annotations.  -->
           </parameter>
         </parameters>
       </method>
-      <method name="get_origin" c:identifier="test_drawable_get_origin">
+      <method name="get_origin"
+              c:identifier="test_inherit_drawable_get_origin">
         <return-value transfer-ownership="none">
           <type name="none" c:type="void"/>
         </return-value>
@@ -50,7 +51,7 @@ and/or use gtk-doc annotations.  -->
           </parameter>
         </parameters>
       </method>
-      <method name="get_size" c:identifier="test_drawable_get_size">
+      <method name="get_size" c:identifier="test_inherit_drawable_get_size">
         <return-value transfer-ownership="none">
           <type name="none" c:type="void"/>
         </return-value>
@@ -70,7 +71,7 @@ and/or use gtk-doc annotations.  -->
         </parameters>
       </method>
       <method name="do_foo_maybe_throw"
-              c:identifier="test_drawable_do_foo_maybe_throw"
+              c:identifier="test_inherit_drawable_do_foo_maybe_throw"
               throws="1">
         <return-value transfer-ownership="none">
           <type name="none" c:type="void"/>
@@ -85,16 +86,16 @@ and/or use gtk-doc annotations.  -->
         <type name="GObject.Object" c:type="GObject"/>
       </field>
     </class>
-    <record name="TestDrawableClass"
-            c:type="TestDrawableClass"
-            glib:is-gtype-struct-for="TestDrawable">
+    <record name="DrawableClass"
+            c:type="TestInheritDrawableClass"
+            glib:is-gtype-struct-for="Drawable">
       <field name="parent_class">
         <type name="GObject.ObjectClass" c:type="GObjectClass"/>
       </field>
     </record>
-    <record name="TestPixmapObjectClass" c:type="_TestPixmapObjectClass">
+    <record name="PixmapObjectClass" c:type="_TestInheritPixmapObjectClass">
       <field name="parent_class" writable="1">
-        <type name="TestDrawableClass" c:type="TestDrawableClass"/>
+        <type name="DrawableClass" c:type="TestInheritDrawableClass"/>
       </field>
     </record>
   </namespace>
diff --git a/tests/scanner/utility-1.0-expected.gir b/tests/scanner/Utility-1.0-expected.gir
similarity index 99%
rename from tests/scanner/utility-1.0-expected.gir
rename to tests/scanner/Utility-1.0-expected.gir
index 5f8f96c..d7e50ed 100644
--- a/tests/scanner/utility-1.0-expected.gir
+++ b/tests/scanner/Utility-1.0-expected.gir
@@ -9,10 +9,10 @@ and/or use gtk-doc annotations.  -->
   <include name="GLib" version="2.0"/>
   <include name="GObject" version="2.0"/>
   <package name="gobject-2.0"/>
-  <namespace name="utility"
+  <namespace name="Utility"
              version="1.0"
              shared-library="libutility.so"
-             c:prefix="utility">
+             c:prefix="Utility">
     <alias name="Glyph" target="uint32" c:type="UtilityGlyph"/>
     <record name="Buffer" c:type="UtilityBuffer">
       <field name="data" writable="1">
diff --git a/tests/scanner/barapp.c b/tests/scanner/barapp.c
index f2b9254..d336975 100644
--- a/tests/scanner/barapp.c
+++ b/tests/scanner/barapp.c
@@ -16,12 +16,12 @@ bar_baz_init (BarBaz *object)
 }
 
 void
-barapp_func (void)
+bar_app_func (void)
 {
 }
 
 void
-barapp_func2 (int x, double y)
+bar_app_func2 (int x, double y)
 {
 }
 
diff --git a/tests/scanner/barapp.h b/tests/scanner/barapp.h
index 6e09b8a..ff8037d 100644
--- a/tests/scanner/barapp.h
+++ b/tests/scanner/barapp.h
@@ -20,5 +20,5 @@ struct BarBazClass
 
 GType bar_baz_get_type          (void) G_GNUC_CONST;
 
-void barapp_func (void);
-void barapp_func2 (int x, double y);
+void bar_app_func (void);
+void bar_app_func2 (int x, double y);
diff --git a/tests/scanner/drawable.c b/tests/scanner/drawable.c
index 7101d18..0250fc0 100644
--- a/tests/scanner/drawable.c
+++ b/tests/scanner/drawable.c
@@ -1,41 +1,41 @@
 #include "drawable.h"
 
-G_DEFINE_ABSTRACT_TYPE (TestDrawable, test_drawable, G_TYPE_OBJECT);
+G_DEFINE_ABSTRACT_TYPE (TestInheritDrawable, test_inherit_drawable, G_TYPE_OBJECT);
 
 static void
-test_drawable_class_init (TestDrawableClass *klass)
+test_inherit_drawable_class_init (TestInheritDrawableClass *klass)
 {
 
 }
 
 static void
-test_drawable_init (TestDrawable *drawable)
+test_inherit_drawable_init (TestInheritDrawable *drawable)
 {
 
 }
 
 void 
-test_drawable_do_foo (TestDrawable *drawable, int x)
+test_inherit_drawable_do_foo (TestInheritDrawable *drawable, int x)
 {
   
 }
 
 void
-test_drawable_get_origin (TestDrawable *drawable, int *x, int *y)
+test_inherit_drawable_get_origin (TestInheritDrawable *drawable, int *x, int *y)
 {
   *x = 0;
   *y = 0;
 }
 
 void
-test_drawable_get_size (TestDrawable *drawable, guint *width, guint *height)
+test_inherit_drawable_get_size (TestInheritDrawable *drawable, guint *width, guint *height)
 {
   *width = 42;
   *height = 42;
 }
 
 void
-test_drawable_do_foo_maybe_throw (TestDrawable *drawable, int x, GError **error)
+test_inherit_drawable_do_foo_maybe_throw (TestInheritDrawable *drawable, int x, GError **error)
 {
   if (x != 42)
     g_set_error(error, 0, 12, "The answer should be 42!");
diff --git a/tests/scanner/drawable.h b/tests/scanner/drawable.h
index 98a7010..ccc2a0e 100644
--- a/tests/scanner/drawable.h
+++ b/tests/scanner/drawable.h
@@ -1,31 +1,31 @@
-#ifndef __TEST_DRAWABLE_H__
-#define __TEST_DRAWABLE_H__
+#ifndef __TEST_INHERIT_DRAWABLE_H__
+#define __TEST_INHERIT_DRAWABLE_H__
 
 #include <glib-object.h>
 
-typedef struct _TestDrawable TestDrawable;
-typedef struct _TestDrawableClass TestDrawableClass;
+typedef struct _TestInheritDrawable TestInheritDrawable;
+typedef struct _TestInheritDrawableClass TestInheritDrawableClass;
 
-struct _TestDrawable
+struct _TestInheritDrawable
 {
   GObject parent_instance;
 };
 
-struct _TestDrawableClass
+struct _TestInheritDrawableClass
 {
   GObjectClass parent_class;
 };
 
-GType test_drawable_get_type (void) G_GNUC_CONST;
+GType test_inherit_drawable_get_type (void) G_GNUC_CONST;
 
-void test_drawable_do_foo (TestDrawable *drawable, int x);
-void test_drawable_get_origin (TestDrawable *drawable, int *x, int *y);
-void test_drawable_get_size (TestDrawable *drawable, guint *width, guint *height);
-void test_drawable_do_foo_maybe_throw (TestDrawable *drawable, int x, GError **error);
+void test_inherit_drawable_do_foo (TestInheritDrawable *drawable, int x);
+void test_inherit_drawable_get_origin (TestInheritDrawable *drawable, int *x, int *y);
+void test_inherit_drawable_get_size (TestInheritDrawable *drawable, guint *width, guint *height);
+void test_inherit_drawable_do_foo_maybe_throw (TestInheritDrawable *drawable, int x, GError **error);
 
-struct _TestPixmapObjectClass
+struct _TestInheritPixmapObjectClass
 {
-  TestDrawableClass parent_class;
+  TestInheritDrawableClass parent_class;
 };
 
-#endif /* __TEST_DRAWABLE_H__ */
+#endif /* __TEST_INHERIT_DRAWABLE_H__ */



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