mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-05 21:29:20 +02:00
Move bookmarkfile tests to the test framework
This commit is contained in:
@@ -143,6 +143,9 @@ logging_LDADD = $(progs_ldadd)
|
||||
TEST_PROGS += error
|
||||
error_LDADD = $(progs_ldadd)
|
||||
|
||||
TEST_PROGS += bookmarkfile
|
||||
bookmarkfile_LDADD = $(progs_ldadd)
|
||||
|
||||
if OS_UNIX
|
||||
|
||||
# some testing of gtester funcitonality
|
||||
@@ -166,3 +169,7 @@ dist_hook:
|
||||
mkdir $(distdir)/markups; \
|
||||
for f in $(srcdir)/markups/*; do \
|
||||
cp $$f $(distdir)/markups; done
|
||||
mkdir $(distdir)/bookmarks; \
|
||||
for f in $(srcdir)/bookmarks/* ; do \
|
||||
cp $$f $(distdir)/bookmarks; done
|
||||
|
||||
|
298
glib/tests/bookmarkfile.c
Normal file
298
glib/tests/bookmarkfile.c
Normal file
@@ -0,0 +1,298 @@
|
||||
#undef G_DISABLE_ASSERT
|
||||
|
||||
#include <glib.h>
|
||||
#include <time.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef SRCDIR
|
||||
#define SRCDIR "."
|
||||
#endif
|
||||
|
||||
#define TEST_URI_0 "file:///abc/defgh/ijklmnopqrstuvwxyz"
|
||||
#define TEST_URI_1 "file:///test/uri/1"
|
||||
#define TEST_URI_2 "file:///test/uri/2"
|
||||
|
||||
#define TEST_MIME "text/plain"
|
||||
|
||||
#define TEST_APP_NAME "bookmarkfile-test"
|
||||
#define TEST_APP_EXEC "bookmarkfile-test %f"
|
||||
|
||||
static gboolean
|
||||
test_load (GBookmarkFile *bookmark,
|
||||
const gchar *filename)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gboolean res;
|
||||
|
||||
res = g_bookmark_file_load_from_file (bookmark, filename, &error);
|
||||
if (error && g_test_verbose ())
|
||||
{
|
||||
g_print ("Load error: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
test_query (GBookmarkFile *bookmark)
|
||||
{
|
||||
gint size;
|
||||
gchar **uris;
|
||||
gsize uris_len, i;
|
||||
gchar *mime;
|
||||
GError *error;
|
||||
|
||||
size = g_bookmark_file_get_size (bookmark);
|
||||
uris = g_bookmark_file_get_uris (bookmark, &uris_len);
|
||||
|
||||
g_assert_cmpint (uris_len, ==, size);
|
||||
|
||||
for (i = 0; i < uris_len; i++)
|
||||
{
|
||||
g_assert (g_bookmark_file_has_item (bookmark, uris[i]));
|
||||
error = NULL;
|
||||
mime = g_bookmark_file_get_mime_type (bookmark, uris[i], &error);
|
||||
g_assert (mime != NULL);
|
||||
g_assert_no_error (error);
|
||||
g_free (mime);
|
||||
}
|
||||
g_strfreev (uris);
|
||||
|
||||
g_assert (!g_bookmark_file_has_item (bookmark, "file:///no/such/uri"));
|
||||
error = NULL;
|
||||
mime = g_bookmark_file_get_mime_type (bookmark, "file:///no/such/uri", &error);
|
||||
g_assert (mime == NULL);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND);
|
||||
g_error_free (error);
|
||||
g_free (mime);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_modify (GBookmarkFile *bookmark)
|
||||
{
|
||||
gchar *text;
|
||||
guint count;
|
||||
time_t stamp;
|
||||
time_t now;
|
||||
GError *error = NULL;
|
||||
gchar **groups;
|
||||
gsize length;
|
||||
gchar **apps;
|
||||
gchar *icon;
|
||||
gchar *mime;
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("\t=> check global title/description...");
|
||||
g_bookmark_file_set_title (bookmark, NULL, "a file");
|
||||
g_bookmark_file_set_description (bookmark, NULL, "a bookmark file");
|
||||
|
||||
text = g_bookmark_file_get_title (bookmark, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (text, ==, "a file");
|
||||
g_free (text);
|
||||
|
||||
text = g_bookmark_file_get_description (bookmark, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (text, ==, "a bookmark file");
|
||||
g_free (text);
|
||||
if (g_test_verbose ())
|
||||
g_print ("ok\n");
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("\t=> check bookmark title/description...");
|
||||
g_bookmark_file_set_title (bookmark, TEST_URI_0, "a title");
|
||||
g_bookmark_file_set_description (bookmark, TEST_URI_0, "a description");
|
||||
g_bookmark_file_set_is_private (bookmark, TEST_URI_0, TRUE);
|
||||
time (&now);
|
||||
g_bookmark_file_set_added (bookmark, TEST_URI_0, now);
|
||||
g_bookmark_file_set_modified (bookmark, TEST_URI_0, now);
|
||||
g_bookmark_file_set_visited (bookmark, TEST_URI_0, now);
|
||||
g_bookmark_file_set_icon (bookmark, TEST_URI_0, "testicon", "image/png");
|
||||
|
||||
text = g_bookmark_file_get_title (bookmark, TEST_URI_0, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (text, ==, "a title");
|
||||
g_free (text);
|
||||
text = g_bookmark_file_get_description (bookmark, TEST_URI_0, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (text, ==, "a description");
|
||||
g_free (text);
|
||||
g_assert (g_bookmark_file_get_is_private (bookmark, TEST_URI_0, &error));
|
||||
g_assert_no_error (error);
|
||||
stamp = g_bookmark_file_get_added (bookmark, TEST_URI_0, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (stamp == now);
|
||||
stamp = g_bookmark_file_get_modified (bookmark, TEST_URI_0, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (stamp == now);
|
||||
stamp = g_bookmark_file_get_visited (bookmark, TEST_URI_0, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (stamp == now);
|
||||
g_assert (g_bookmark_file_get_icon (bookmark, TEST_URI_0, &icon, &mime, &error));
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (icon, ==, "testicon");
|
||||
g_assert_cmpstr (mime, ==, "image/png");
|
||||
g_free (icon);
|
||||
g_free (mime);
|
||||
if (g_test_verbose ())
|
||||
g_print ("ok\n");
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("\t=> check non existing bookmark...");
|
||||
g_bookmark_file_get_description (bookmark, TEST_URI_1, &error);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND);
|
||||
g_clear_error (&error);
|
||||
g_bookmark_file_get_is_private (bookmark, TEST_URI_1, &error);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND);
|
||||
g_clear_error (&error);
|
||||
g_bookmark_file_get_added (bookmark, TEST_URI_1, &error);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND);
|
||||
g_clear_error (&error);
|
||||
g_bookmark_file_get_modified (bookmark, TEST_URI_1, &error);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND);
|
||||
g_clear_error (&error);
|
||||
g_bookmark_file_get_visited (bookmark, TEST_URI_1, &error);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND);
|
||||
g_clear_error (&error);
|
||||
if (g_test_verbose ())
|
||||
g_print ("ok\n");
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("\t=> check application...");
|
||||
g_bookmark_file_set_mime_type (bookmark, TEST_URI_0, TEST_MIME);
|
||||
g_assert (!g_bookmark_file_has_application (bookmark, TEST_URI_0, TEST_APP_NAME, NULL));
|
||||
g_bookmark_file_add_application (bookmark, TEST_URI_0,
|
||||
TEST_APP_NAME,
|
||||
TEST_APP_EXEC);
|
||||
g_assert (g_bookmark_file_has_application (bookmark, TEST_URI_0, TEST_APP_NAME, NULL));
|
||||
g_bookmark_file_get_app_info (bookmark, TEST_URI_0, TEST_APP_NAME,
|
||||
&text,
|
||||
&count,
|
||||
&stamp,
|
||||
&error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (count == 1);
|
||||
g_assert (stamp == g_bookmark_file_get_modified (bookmark, TEST_URI_0, NULL));
|
||||
g_free (text);
|
||||
g_assert (g_bookmark_file_remove_application (bookmark, TEST_URI_0, TEST_APP_NAME, &error));
|
||||
g_assert_no_error (error);
|
||||
g_bookmark_file_add_application (bookmark, TEST_URI_0, TEST_APP_NAME, TEST_APP_EXEC);
|
||||
apps = g_bookmark_file_get_applications (bookmark, TEST_URI_0, &length, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpint (length, ==, 1);
|
||||
g_assert_cmpstr (apps[0], ==, TEST_APP_NAME);
|
||||
g_strfreev (apps);
|
||||
|
||||
g_bookmark_file_get_app_info (bookmark, TEST_URI_0, "fail",
|
||||
&text,
|
||||
&count,
|
||||
&stamp,
|
||||
&error);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED);
|
||||
g_clear_error (&error);
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("ok\n");
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("\t=> check groups...");
|
||||
g_assert (!g_bookmark_file_has_group (bookmark, TEST_URI_1, "Test", NULL));
|
||||
g_bookmark_file_add_group (bookmark, TEST_URI_1, "Test");
|
||||
g_assert (g_bookmark_file_has_group (bookmark, TEST_URI_1, "Test", NULL));
|
||||
g_assert (!g_bookmark_file_has_group (bookmark, TEST_URI_1, "Fail", NULL));
|
||||
g_assert (g_bookmark_file_remove_group (bookmark, TEST_URI_1, "Test", &error));
|
||||
g_assert_no_error (error);
|
||||
groups = g_bookmark_file_get_groups (bookmark, TEST_URI_1, NULL, &error);
|
||||
g_assert_cmpint (g_strv_length (groups), ==, 0);
|
||||
g_strfreev (groups);
|
||||
groups = g_new0 (gchar *, 3);
|
||||
groups[0] = "Group1";
|
||||
groups[1] = "Group2";
|
||||
groups[2] = NULL;
|
||||
g_bookmark_file_set_groups (bookmark, TEST_URI_1, (const gchar **)groups, 2);
|
||||
g_free (groups);
|
||||
groups = g_bookmark_file_get_groups (bookmark, TEST_URI_1, &length, &error);
|
||||
g_assert_cmpint (length, ==, 2);
|
||||
g_strfreev (groups);
|
||||
g_assert_no_error (error);
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("ok\n");
|
||||
|
||||
if (g_test_verbose ())
|
||||
g_print ("\t=> check remove...");
|
||||
g_assert (g_bookmark_file_remove_item (bookmark, TEST_URI_1, &error) == TRUE);
|
||||
g_assert_no_error (error);
|
||||
g_assert (g_bookmark_file_remove_item (bookmark, TEST_URI_1, &error) == FALSE);
|
||||
g_assert_error (error, G_BOOKMARK_FILE_ERROR, G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND);
|
||||
g_clear_error (&error);
|
||||
if (g_test_verbose ())
|
||||
g_print ("ok\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
test_file (gconstpointer d)
|
||||
{
|
||||
const gchar *filename = d;
|
||||
GBookmarkFile *bookmark_file;
|
||||
gboolean success;
|
||||
gchar *data;
|
||||
GError *error;
|
||||
|
||||
bookmark_file = g_bookmark_file_new ();
|
||||
g_assert (bookmark_file != NULL);
|
||||
|
||||
success = test_load (bookmark_file, filename);
|
||||
|
||||
if (success)
|
||||
{
|
||||
test_query (bookmark_file);
|
||||
test_modify (bookmark_file);
|
||||
|
||||
error = NULL;
|
||||
data = g_bookmark_file_to_data (bookmark_file, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
/* FIXME do some checks on data */
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
g_bookmark_file_free (bookmark_file);
|
||||
|
||||
g_assert (success == (strstr (filename, "fail") == NULL));
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GDir *dir;
|
||||
GError *error;
|
||||
const gchar *name;
|
||||
gchar *path;
|
||||
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
test_file (argv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
error = NULL;
|
||||
dir = g_dir_open (SRCDIR "/bookmarks", 0, &error);
|
||||
g_assert_no_error (error);
|
||||
while ((name = g_dir_read_name (dir)) != NULL)
|
||||
{
|
||||
path = g_strdup_printf ("/bookmarks/parse/%s", name);
|
||||
g_test_add_data_func (path, g_build_filename (SRCDIR, "bookmarks", name, NULL), test_file);
|
||||
g_free (path);
|
||||
}
|
||||
g_dir_close (dir);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
0
glib/tests/bookmarks/fail-01.xbel
Normal file
0
glib/tests/bookmarks/fail-01.xbel
Normal file
2
glib/tests/bookmarks/fail-02.xbel
Normal file
2
glib/tests/bookmarks/fail-02.xbel
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<fail/>
|
18
glib/tests/bookmarks/fail-03.xbel
Normal file
18
glib/tests/bookmarks/fail-03.xbel
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark>
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
21
glib/tests/bookmarks/fail-04.xbel
Normal file
21
glib/tests/bookmarks/fail-04.xbel
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" fail="attr">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
21
glib/tests/bookmarks/fail-05.xbel
Normal file
21
glib/tests/bookmarks/fail-05.xbel
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file & containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
19
glib/tests/bookmarks/fail-06.xbel
Normal file
19
glib/tests/bookmarks/fail-06.xbel
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</bookmark>
|
||||
</xbel>
|
21
glib/tests/bookmarks/fail-07.xbel
Normal file
21
glib/tests/bookmarks/fail-07.xbel
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata>
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
18
glib/tests/bookmarks/fail-08.xbel
Normal file
18
glib/tests/bookmarks/fail-08.xbel
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<bookmark:fail/>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
20
glib/tests/bookmarks/fail-09.xbel
Normal file
20
glib/tests/bookmarks/fail-09.xbel
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<bookmark:applications>
|
||||
<bookmark:application/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
21
glib/tests/bookmarks/fail-10.xbel
Normal file
21
glib/tests/bookmarks/fail-10.xbel
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
22
glib/tests/bookmarks/fail-11.xbel
Normal file
22
glib/tests/bookmarks/fail-11.xbel
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<title>&</title>
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
22
glib/tests/bookmarks/fail-12.xbel
Normal file
22
glib/tests/bookmarks/fail-12.xbel
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
<bookmark:icon type="image/png"/>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
22
glib/tests/bookmarks/fail-13.xbel
Normal file
22
glib/tests/bookmarks/fail-13.xbel
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
<fail/>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
24
glib/tests/bookmarks/fail-14.xbel
Normal file
24
glib/tests/bookmarks/fail-14.xbel
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
<bookmark:groups>
|
||||
<fail>Test</fail>
|
||||
</bookmark:groups>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
23
glib/tests/bookmarks/fail-15.xbel
Normal file
23
glib/tests/bookmarks/fail-15.xbel
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
<bookmark:groups>
|
||||
<bookmark:group>Test</bookmark:group>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
24
glib/tests/bookmarks/fail-16.xbel
Normal file
24
glib/tests/bookmarks/fail-16.xbel
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
<bookmark:groups>
|
||||
<bookmark:group>Test</group>
|
||||
</bookmark:groups>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
22
glib/tests/bookmarks/fail-17.xbel
Normal file
22
glib/tests/bookmarks/fail-17.xbel
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
<invalid/>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
21
glib/tests/bookmarks/valid-01.xbel
Normal file
21
glib/tests/bookmarks/valid-01.xbel
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
15
glib/tests/bookmarks/valid-02.xbel
Normal file
15
glib/tests/bookmarks/valid-02.xbel
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xbel version="1.0">
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime-type type="application/postscript"/>
|
||||
<applications>
|
||||
<application name="populate-recent" exec="populate-recent --info %u" timestamp="1128121528" count="1"/>
|
||||
</applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
21
glib/tests/bookmarks/valid-03.xbel
Normal file
21
glib/tests/bookmarks/valid-03.xbel
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE xbel
|
||||
PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
|
||||
"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
|
||||
<xbel version="1.0"
|
||||
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
|
||||
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
|
||||
>
|
||||
<title>Singleton</title>
|
||||
<desc>A file containing a single bookmark element</desc>
|
||||
<bookmark href="file:///home/zefram/Documents/milan-stuttgart.ps" added="20050930T23:05:28Z" modified="20050930T23:05:28Z" visited="20050930T23:05:28Z">
|
||||
<info>
|
||||
<metadata owner="http://freedesktop.org">
|
||||
<mime:mime-type type="application/postscript"/>
|
||||
<bookmark:applications>
|
||||
<bookmark:application name="populate-recent" exec="populate-recent --info %u" modified="2005-09-30T23:05:28Z" count="1"/>
|
||||
</bookmark:applications>
|
||||
</metadata>
|
||||
</info>
|
||||
</bookmark>
|
||||
</xbel>
|
Reference in New Issue
Block a user