summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHans Breuer <hans@breuer.org>2007-12-21 10:11:35 +0000
committerHans Breuer <hans@src.gnome.org>2007-12-21 10:11:35 +0000
commit1cda3c9e017ce9359d5019bb7bc8993208523891 (patch)
tree33c8a43181004c13db498d024bec949ee3b8d4b3 /tests
parent2c0f3fc5ff74b9b3940eece169ec17e3411d72a1 (diff)
adapt to recent api changes variable declaration at the beginning of a
2007-12-09 Hans Breuer <hans@breuer.org> * tests/gio-ls.c : adapt to recent api changes * tests/testglib.c : variable declaration at the beginning of a block (Lieven van der Heide, #503602) * win32-fixup.pl : process *.rc.in as well; substitute LT_CURRENT_MINUS_AGE * glib/makefile.msc.in : alphabetic sorting of OBJECTS svn path=/trunk/; revision=6184
Diffstat (limited to 'tests')
-rw-r--r--tests/gio-ls.c20
-rw-r--r--tests/testglib.c7
2 files changed, 12 insertions, 15 deletions
diff --git a/tests/gio-ls.c b/tests/gio-ls.c
index deab59b1f..c29ea6c34 100644
--- a/tests/gio-ls.c
+++ b/tests/gio-ls.c
@@ -1,5 +1,4 @@
-#include <glib/goption.h>
#include <gio/gio.h>
#define GETTEXT_PACKAGE "gio-ls"
@@ -61,7 +60,7 @@ print_path (const gchar* path,
guint32 flags)
{
GFile *top;
- const gchar *short_attrs = G_FILE_ATTRIBUTE_STD_NAME;
+ const gchar *short_attrs = G_FILE_ATTRIBUTE_STANDARD_NAME;
const gchar *long_attrs = G_FILE_ATTRIBUTE_OWNER_USER "," G_FILE_ATTRIBUTE_OWNER_GROUP "," \
"access:*,std:*";
const gchar *attrs;
@@ -92,7 +91,7 @@ print_path (const gchar* path,
if (flags & SHOW_LONG)
{
- GFileAttributeValue *val = g_file_info_get_attribute (info, G_FILE_ATTRIBUTE_OWNER_USER);
+ const gchar *val;
g_print ("%c%c%c%c ",
g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY ? 'd' : '-',
@@ -100,19 +99,14 @@ print_path (const gchar* path,
g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE) ? 'w' : '-',
g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE) ? 'x' : '-');
- if (!val)
- g_print ("\t?");
- else if (val->type == G_FILE_ATTRIBUTE_TYPE_STRING)
- g_print ("\t%15s", val->u.string);
+ val = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_OWNER_USER);
+ g_print ("\t%15s", val ? val : "?user?");
- val = g_file_info_get_attribute (info, G_FILE_ATTRIBUTE_OWNER_GROUP);
- if (!val)
- g_print ("\t?");
- else if (val->type == G_FILE_ATTRIBUTE_TYPE_STRING)
- g_print ("\t%15s", val->u.string);
+ val = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_OWNER_GROUP);
+ g_print ("\t%15s", val ? val : "?group?");
}
- g_print ("\t%s\n", name ? name : "<NULL>");
+ g_print ("\t%s\n", name ? name : "?noname?");
g_object_unref (info);
}
diff --git a/tests/testglib.c b/tests/testglib.c
index 6275e733c..048369004 100644
--- a/tests/testglib.c
+++ b/tests/testglib.c
@@ -819,6 +819,9 @@ test_info (void)
if (g_test_verbose())
{
+#ifdef G_PLATFORM_WIN32
+ gchar *glib_dll;
+#endif
const gchar *charset;
if (g_get_charset ((G_CONST_RETURN char**)&charset))
g_print ("current charset is UTF-8: %s\n", charset);
@@ -828,10 +831,10 @@ test_info (void)
#ifdef G_PLATFORM_WIN32
#ifdef G_OS_WIN32
/* Can't calculate GLib DLL name at runtime. */
- gchar *glib_dll = "libglib-2.0-0.dll";
+ glib_dll = "libglib-2.0-0.dll";
#endif
#ifdef G_WITH_CYGWIN
- gchar *glib_dll = "cygglib-2.0-0.dll";
+ glib_dll = "cygglib-2.0-0.dll";
#endif
g_print ("current locale: %s\n", g_win32_getlocale ());