[glib/wip/danw/glib.mk: 1/3] gio/tests/resources: fix up inconsistent naming



commit 60f064f8cd05c21a8e863e9af9cc65ba976c0ede
Author: Dan Winship <danw gnome org>
Date:   Wed Jan 23 20:59:06 2013 -0500

    gio/tests/resources: fix up inconsistent naming
    
    Compile test3.gresource.xml into files with "3" in their names, not
    "2". Also, make it include test3.txt, not test1.txt. (Previously
    test3.txt was not actually used anywhere.)
    
    Use hyphens rather than underscores in the generated filenames, for
    consistency with everywhere else.

 gio/tests/.gitignore          |    8 ++++----
 gio/tests/Makefile.am         |   17 +++++++++--------
 gio/tests/resources.c         |   16 ++++++++--------
 gio/tests/test3.gresource.xml |    2 +-
 4 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/gio/tests/.gitignore b/gio/tests/.gitignore
index f9e0587..fd12e88 100644
--- a/gio/tests/.gitignore
+++ b/gio/tests/.gitignore
@@ -88,7 +88,7 @@ network-monitor
 org.gtk.test.enums.xml
 permission
 pollable
-plugin_resources.c
+plugin-resources.c
 proxy
 proxy-test
 readwrite
@@ -107,9 +107,9 @@ srvtarget
 task
 test.mo
 test.gresource
-test_resources.c
-test_resources2.c
-test_resources2.h
+test2-resources.c
+test3-resources.c
+test3-resources.h
 tls-certificate
 tls-interaction
 unix-fd
diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
index 131b42a..ca195c8 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -407,11 +407,11 @@ endif
 
 test_programs += resources
 resources_SOURCES = resources.c
-nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
+nodist_resources_SOURCES = test2-resources.c test3-resources.c test3-resources.h
 resources_DEPENDENCIES = test.gresource
 
 test_ltlibraries += libresourceplugin.la
-libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
+libresourceplugin_la_SOURCES = resourceplugin.c plugin-resources.c
 libresourceplugin_la_LDFLAGS = -avoid-version -module -export-dynamic $(no_undefined)
 libresourceplugin_la_LIBADD = $(LDADD)
 
@@ -432,14 +432,15 @@ else
   glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
 endif
 
-resources.o: test_resources2.h
-test_resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) 
--generate-dependencies $(srcdir)/test2.gresource.xml)
-       $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name 
_g_test1 $<
+resources.o: test3-resources.h
 
-test_resources2.h test_resources2.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) 
--sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
+test2-resources.c: test2.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) 
--generate-dependencies $(srcdir)/test2.gresource.xml)
+       $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name 
_g_test2 $<
+
+test3-resources.h test3-resources.c: test3.gresource.xml Makefile $(shell $(glib_compile_resources) 
--sourcedir=$(srcdir) --generate-dependencies $(srcdir)/test3.gresource.xml)
        $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 
--manual-register $<
 
-plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) 
--generate-dependencies $(srcdir)/test4.gresource.xml)
+plugin-resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) 
--generate-dependencies $(srcdir)/test4.gresource.xml)
        $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name 
_g_plugin $<
 
 test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) 
--generate-dependencies $(srcdir)/test.gresource.xml)
@@ -447,4 +448,4 @@ test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --
 
 EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt 
test4.gresource.xml
 
-CLEANFILES += test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
+CLEANFILES += test2-resources.c test3-resources.[ch] plugin-resources.c test.gresource
diff --git a/gio/tests/resources.c b/gio/tests/resources.c
index 495c05b..6a7bdf1 100644
--- a/gio/tests/resources.c
+++ b/gio/tests/resources.c
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <gio/gio.h>
 #include "gconstructor.h"
-#include "test_resources2.h"
+#include "test3-resources.h"
 
 static void
 test_resource (GResource *resource)
@@ -341,7 +341,7 @@ test_resource_manual (void)
   guint32 flags;
   GBytes *data;
 
-  found = g_resources_get_info ("/manual_loaded/test1.txt",
+  found = g_resources_get_info ("/manual_loaded/test3.txt",
                                G_RESOURCE_LOOKUP_FLAGS_NONE,
                                &size, &flags, &error);
   g_assert (found);
@@ -349,14 +349,14 @@ test_resource_manual (void)
   g_assert_cmpint (size, ==, 6);
   g_assert_cmpuint (flags, ==, 0);
 
-  data = g_resources_lookup_data ("/manual_loaded/test1.txt",
+  data = g_resources_lookup_data ("/manual_loaded/test3.txt",
                                  G_RESOURCE_LOOKUP_FLAGS_NONE,
                                  &error);
   g_assert (data != NULL);
   g_assert_no_error (error);
   size = g_bytes_get_size (data);
   g_assert_cmpint (size, ==, 6);
-  g_assert_cmpstr (g_bytes_get_data (data, NULL), ==, "test1\n");
+  g_assert_cmpstr (g_bytes_get_data (data, NULL), ==, "test3\n");
   g_bytes_unref (data);
 }
 
@@ -368,17 +368,17 @@ test_resource_manual2 (void)
   gsize size;
   GError *error = NULL;
 
-  resource = _g_test2_get_resource ();
+  resource = _g_test3_get_resource ();
 
   data = g_resource_lookup_data (resource,
-                                 "/manual_loaded/test1.txt",
+                                 "/manual_loaded/test3.txt",
                                 G_RESOURCE_LOOKUP_FLAGS_NONE,
                                 &error);
   g_assert (data != NULL);
   g_assert_no_error (error);
   size = g_bytes_get_size (data);
   g_assert_cmpint (size, ==, 6);
-  g_assert_cmpstr (g_bytes_get_data (data, NULL), ==, "test1\n");
+  g_assert_cmpstr (g_bytes_get_data (data, NULL), ==, "test3\n");
   g_bytes_unref (data);
 
   g_resource_unref (resource);
@@ -626,7 +626,7 @@ main (int   argc,
 {
   g_test_init (&argc, &argv, NULL);
 
-  _g_test2_register_resource ();
+  _g_test3_register_resource ();
 
   g_test_add_func ("/resource/file", test_resource_file);
   g_test_add_func ("/resource/data", test_resource_data);
diff --git a/gio/tests/test3.gresource.xml b/gio/tests/test3.gresource.xml
index fdf26fa..94d8e9a 100644
--- a/gio/tests/test3.gresource.xml
+++ b/gio/tests/test3.gresource.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="/manual_loaded">
-    <file>test1.txt</file>
+    <file>test3.txt</file>
   </gresource>
 </gresources>


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