summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-06-01 00:36:16 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-06-01 18:51:25 -0400
commitfed8ae38c3b43c8da693c624bb552c50d269af84 (patch)
tree2cb6a9b579f9e093bcb1bf01eb4a0eabf22d39f2
parentc0f96bb27636de407a29c8ee30bb44a03c74a0fb (diff)
downloadglib-fed8ae38c3b43c8da693c624bb552c50d269af84.tar.gz
Improve test coverage a bit
-rw-r--r--gio/tests/file.c20
-rw-r--r--gio/tests/memory-output-stream.c10
2 files changed, 30 insertions, 0 deletions
diff --git a/gio/tests/file.c b/gio/tests/file.c
index c59a66013..8edb290fa 100644
--- a/gio/tests/file.c
+++ b/gio/tests/file.c
@@ -103,6 +103,25 @@ test_type (void)
g_object_unref (datapath_f);
}
+static void
+test_parse_name (void)
+{
+ GFile *file;
+ gchar *name;
+
+ file = g_file_new_for_uri ("file://somewhere");
+ name = g_file_get_parse_name (file);
+ g_assert_cmpstr (name, ==, "file://somewhere");
+ g_object_unref (file);
+ g_free (name);
+
+ file = g_file_parse_name ("~foo");
+ name = g_file_get_parse_name (file);
+ g_assert (name != NULL);
+ g_print (name);
+ g_object_unref (file);
+ g_free (name);
+}
typedef struct
{
@@ -799,6 +818,7 @@ main (int argc, char *argv[])
g_test_add_func ("/file/parent", test_parent);
g_test_add_func ("/file/child", test_child);
g_test_add_func ("/file/type", test_type);
+ g_test_add_func ("/file/parse-name", test_parse_name);
g_test_add_data_func ("/file/async-create-delete/0", GINT_TO_POINTER (0), test_create_delete);
g_test_add_data_func ("/file/async-create-delete/1", GINT_TO_POINTER (1), test_create_delete);
g_test_add_data_func ("/file/async-create-delete/10", GINT_TO_POINTER (10), test_create_delete);
diff --git a/gio/tests/memory-output-stream.c b/gio/tests/memory-output-stream.c
index 3399bbe00..1fc107492 100644
--- a/gio/tests/memory-output-stream.c
+++ b/gio/tests/memory-output-stream.c
@@ -122,6 +122,7 @@ test_properties (void)
gsize data_size_prop;
gpointer data_fun;
gpointer data_prop;
+ gpointer func;
g_test_bug ("605733");
@@ -145,6 +146,15 @@ test_properties (void)
g_object_get (mo, "data", &data_prop, NULL);
g_assert_cmphex (GPOINTER_TO_SIZE (data_fun), ==, GPOINTER_TO_SIZE (data_prop));
+ g_object_get (mo, "realloc-function", &func, NULL);
+ g_assert (func == g_realloc);
+ g_object_get (mo, "destroy-function", &func, NULL);
+ g_assert (func == g_free);
+
+ data_size_fun = g_memory_output_stream_get_size (G_MEMORY_OUTPUT_STREAM (mo));
+ g_object_get (mo, "size", &data_size_prop, NULL);
+ g_assert_cmpint (data_size_fun, ==, data_size_prop);
+
g_object_unref (o);
g_object_unref (mo);
}