summaryrefslogtreecommitdiff
path: root/tests/test-basic-c.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-basic-c.c')
-rw-r--r--tests/test-basic-c.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/test-basic-c.c b/tests/test-basic-c.c
index fc995298..7a6b8ee7 100644
--- a/tests/test-basic-c.c
+++ b/tests/test-basic-c.c
@@ -176,10 +176,12 @@ static gboolean hi_content_stream_new (GInputStream **out_stream,
GError **error)
{
static const char hi[] = "hi";
- g_autoptr(GMemoryInputStream) hi_memstream = (GMemoryInputStream*)g_memory_input_stream_new_from_data (hi, sizeof(hi)-1, NULL);
+ const size_t len = sizeof(hi)-1;
+ g_autoptr(GMemoryInputStream) hi_memstream = (GMemoryInputStream*)g_memory_input_stream_new_from_data (hi, len, NULL);
g_autoptr(GFileInfo) finfo = g_file_info_new ();
g_file_info_set_attribute_uint32 (finfo, "standard::type", G_FILE_TYPE_REGULAR);
g_file_info_set_attribute_boolean (finfo, "standard::is-symlink", FALSE);
+ g_file_info_set_size (finfo, len);
g_file_info_set_attribute_uint32 (finfo, "unix::uid", 0);
g_file_info_set_attribute_uint32 (finfo, "unix::gid", 0);
g_file_info_set_attribute_uint32 (finfo, "unix::mode", S_IFREG|0644);
@@ -512,7 +514,7 @@ test_read_xattrs (void)
{
g_autoptr(GVariant) current_xattrs = ostree_fs_get_all_xattrs (tmpd.fd, NULL, error);
g_assert_no_error (local_error);
-
+
int r = fsetxattr (tmpd.fd, "user.ostreetesting", value, sizeof (value), 0);
if (r != 0)
@@ -525,7 +527,7 @@ test_read_xattrs (void)
g_autoptr(GVariant) new_xattrs = ostree_fs_get_all_xattrs (tmpd.fd, NULL, error);
g_assert_no_error (local_error);
-
+
compare_xattrs (current_xattrs, new_xattrs);
}
@@ -546,10 +548,10 @@ test_read_xattrs (void)
// if (r < 0)
// glnx_throw_errno_prefix (error, "lsetxattr");
// g_assert_no_error (local_error);
-
+
// g_autoptr(GVariant) new_xattrs = ostree_fs_get_all_xattrs_at (tmpd.fd, "somelink", NULL, error);
// g_assert_no_error (local_error);
-
+
// compare_xattrs (current_xattrs, new_xattrs);
}
}