[glib/glib-2-34] Add a test for the previous fix
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-34] Add a test for the previous fix
- Date: Wed, 17 Oct 2012 01:18:39 +0000 (UTC)
commit bab186e66a9e75e16f7534526eced0f521b12b24
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 16 21:16:50 2012 -0400
Add a test for the previous fix
Running tests/bytes with G_SLICE=always-malloc MALLOC_CHECK_=2
was aborting before.
glib/tests/bytes.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/bytes.c b/glib/tests/bytes.c
index 83589fe..044450d 100644
--- a/glib/tests/bytes.c
+++ b/glib/tests/bytes.c
@@ -316,6 +316,21 @@ test_to_array_non_malloc (void)
g_byte_array_unref (array);
}
+static void
+test_null (void)
+{
+ GBytes *bytes;
+ gpointer data;
+ gsize size;
+
+ bytes = g_bytes_new (NULL, 0);
+
+ data = g_bytes_unref_to_data (bytes, &size);
+
+ g_assert (data == NULL);
+ g_assert (size == 0);
+}
+
int
main (int argc, char *argv[])
{
@@ -337,6 +352,7 @@ main (int argc, char *argv[])
g_test_add_func ("/bytes/to-array/transfered", test_to_array_transferred);
g_test_add_func ("/bytes/to-array/two-refs", test_to_array_two_refs);
g_test_add_func ("/bytes/to-array/non-malloc", test_to_array_non_malloc);
+ g_test_add_func ("/bytes/null", test_null);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]