summaryrefslogtreecommitdiff
path: root/lib/test-lib.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-02-24 14:44:05 +0100
committerAlexander Larsson <alexl@redhat.com>2016-02-24 14:44:16 +0100
commit69052c7d9a89a874855a3d5ea06407faf4799ad6 (patch)
tree6899e1ffd6ad6ae394fad1718e355e5ab679361c /lib/test-lib.c
parentcbf3d2544017cdbd85ba608f6eaca594483d96c8 (diff)
downloadxdg-app-69052c7d9a89a874855a3d5ea06407faf4799ad6.tar.gz
lib: Add XdgAppBundleRef
Diffstat (limited to 'lib/test-lib.c')
-rw-r--r--lib/test-lib.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/test-lib.c b/lib/test-lib.c
index aabe2af..2ec6de4 100644
--- a/lib/test-lib.c
+++ b/lib/test-lib.c
@@ -88,6 +88,30 @@ main (int argc, char *argv[])
return 0;
}
+ g_print ("\n**** Loading bundle\n");
+ {
+ g_autoptr(GFile) f = g_file_new_for_commandline_arg ("tests/hello.xdgapp");
+ g_autoptr(XdgAppBundleRef) bundle = xdg_app_bundle_ref_new (f, &error);
+ if (bundle == NULL)
+ {
+ g_print ("Error loading bundle: %s\n", error->message);
+ g_clear_error (&error);
+ }
+ else
+ {
+ g_autofree char *path = g_file_get_path (xdg_app_bundle_ref_get_file (bundle));
+ g_autoptr(GBytes) metadata = xdg_app_bundle_ref_get_metadata (bundle);
+ g_print ("%d %s %s %s %s %s\n%s\n",
+ xdg_app_ref_get_kind (XDG_APP_REF(bundle)),
+ xdg_app_ref_get_name (XDG_APP_REF(bundle)),
+ xdg_app_ref_get_arch (XDG_APP_REF(bundle)),
+ xdg_app_ref_get_branch (XDG_APP_REF(bundle)),
+ xdg_app_ref_get_commit (XDG_APP_REF(bundle)),
+ path,
+ (char *)g_bytes_get_data (metadata, NULL));
+ }
+ }
+
g_print ("\n**** Checking for updates\n");
{
g_autoptr(GPtrArray) updates =