[glib/wip/makefile.glib: 1/2] gio/tests/resources: fix up inconsistent naming



commit 2877ca56f80ba802693729aa49dff8652147af80
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         |   21 +++++++++++----------
 gio/tests/resources.c         |   16 ++++++++--------
 gio/tests/test3.gresource.xml |    2 +-
 4 files changed, 24 insertions(+), 23 deletions(-)
---
diff --git a/gio/tests/.gitignore b/gio/tests/.gitignore
index 0652ff7..27722e9 100644
--- a/gio/tests/.gitignore
+++ b/gio/tests/.gitignore
@@ -87,7 +87,7 @@ network-monitor
 org.gtk.test.enums.xml
 permission
 pollable
-plugin_resources.c
+plugin-resources.c
 proxy
 proxy-test
 readwrite
@@ -106,9 +106,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 948be46..8b15dba 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -292,7 +292,7 @@ gdbus_non_socket_SOURCES = \
 
 gdbus_exit_on_close_SOURCES = gdbus-exit-on-close.c gdbus-sessionbus.c gdbus-sessionbus.h gdbus-tests.h 
gdbus-tests.c
 
-resources_SOURCES = resources.c test_resources.c test_resources2.c test_resources2.h
+resources_SOURCES = resources.c test2-resources.c test3-resources.c test3-resources.h
 resources_DEPENDENCIES = test.gresource
 
 gapplication_SOURCES = gapplication.c gdbus-sessionbus.h gdbus-sessionbus.c gdbus-tests.h gdbus-tests.c
@@ -458,14 +458,15 @@ else
   glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
 endif
 
-BUILT_SOURCES += test_resources.c test_resources2.c 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 $<
+BUILT_SOURCES += test2-resources.c test3-resources.c 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)
-       $(AM_V_GEN) $(glib_compile_resources) --target=$@ --sourcedir=$(srcdir) --generate --c-name _g_test2 
--manual-register $<
+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 $<
 
-plugin_resources.c: test4.gresource.xml Makefile $(shell $(glib_compile_resources) --sourcedir=$(srcdir) 
--generate-dependencies $(srcdir)/test4.gresource.xml)
+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_test3 
--manual-register $<
+
+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)
@@ -477,11 +478,11 @@ else
 noinst_LTLIBRARIES = libresourceplugin.la
 endif
 
-libresourceplugin_la_SOURCES = resourceplugin.c plugin_resources.c
+libresourceplugin_la_SOURCES = resourceplugin.c plugin-resources.c
 libresourceplugin_la_LDFLAGS = -avoid-version -module $(no_undefined) -rpath $(insttestdir)
 libresourceplugin_la_LIBADD = $(LDADD)
 
-CLEANFILES = gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml test_resources2.[ch] 
plugin_resources.c
+CLEANFILES = gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml test3-resources.[ch] 
plugin-resources.c
 
 DISTCLEANFILES = \
        applications/mimeinfo.cache     \
@@ -489,7 +490,7 @@ DISTCLEANFILES = \
        de/LC_MESSAGES/test.mo          \
        test.mo                         \
        test.gresource                  \
-       test_resources.c                \
+       test2-resources.c               \
        gsettings.store                 \
        gschemas.compiled               \
        schema-source/gschemas.compiled
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]