svnno****@sourc*****
svnno****@sourc*****
Mon Jan 26 15:24:08 JST 2009
Revision: 3576 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3576 Author: ikezoe Date: 2009-01-26 15:24:08 +0900 (Mon, 26 Jan 2009) Log Message: ----------- added more test. Modified Paths: -------------- kazehakase/trunk/test/test-root-bookmark.c Added Paths: ----------- kazehakase/trunk/test/fixtures/bookmarkbar.xml Added: kazehakase/trunk/test/fixtures/bookmarkbar.xml =================================================================== --- kazehakase/trunk/test/fixtures/bookmarkbar.xml (rev 0) +++ kazehakase/trunk/test/fixtures/bookmarkbar.xml 2009-01-26 06:24:08 UTC (rev 3576) @@ -0,0 +1,54 @@ +<?xml version="1.0"?> +<xbel version="1.0" folded="none" xmlns:kz="http://kazehakase.sourceforge.jp/2004"> + <title>BookmarkBar</title> + <bookmark href="http://kazehakase.sourceforge.jp/"> + <title>Home</title> + </bookmark> + <separator/> + <bookmark href="about:blank"> + <title>New</title> + </bookmark> + <separator/> + <folder> + <title>Yahoo!News</title> + <info> + <metadata owner="http://kazehakase.sourceforge.jp/" kz:location="http://rss.news.yahoo.com/rss/topstories" /> + </info> + </folder> + <folder> + <title>Slashdot</title> + <info> + <metadata owner="http://kazehakase.sourceforge.jp/" kz:location="http://rss.slashdot.org/Slashdot/slashdot" kz:update_interval="60" /> + </info> + </folder> + <folder> + <title>FootNote</title> + <info> + <metadata owner="http://kazehakase.sourceforge.jp/" kz:location="http://gnomedesktop.org/node/feed" /> + </info> + </folder> + <folder> + <title>mozillaZine</title> + <info> + <metadata owner="http://kazehakase.sourceforge.jp/" kz:location="http://www.mozillazine.org/contents.rdf" /> + </info> + </folder> + <folder> + <title>NewsForge</title> + <info> + <metadata owner="http://kazehakase.sourceforge.jp/" kz:location="http://www.newsforge.com/newsforge.rss" /> + </info> + </folder> + <folder> + <title>LWN</title> + <info> + <metadata owner="http://kazehakase.sourceforge.jp/" kz:location="http://lwn.net/headlines/rss" /> + </info> + </folder> + <folder> + <title>FM</title> + <info> + <metadata owner="http://kazehakase.sourceforge.jp/" kz:location="http://download.freshmeat.net/backend/fm-releases-global.xml" /> + </info> + </folder> +</xbel> Modified: kazehakase/trunk/test/test-root-bookmark.c =================================================================== --- kazehakase/trunk/test/test-root-bookmark.c 2009-01-26 06:04:26 UTC (rev 3575) +++ kazehakase/trunk/test/test-root-bookmark.c 2009-01-26 06:24:08 UTC (rev 3576) @@ -5,10 +5,12 @@ #include "kz-test-utils.h" void test_new (void); +void test_add_bookmark_bar_file (void); static KzRootBookmark *root; static KzBookmark *expected; static gchar *bookmark_file; +static gchar *bookmark_bar_file; void setup (void) @@ -19,6 +21,9 @@ bookmark_file = g_build_filename(kz_test_get_base_dir(), "fixtures", "bookmarks.xml", NULL); + bookmark_bar_file = g_build_filename(kz_test_get_base_dir(), + "fixtures", "bookmarkbar.xml", + NULL); } void @@ -47,6 +52,20 @@ kz_assert_equal_bookmark(expected, root->menu); } +void +test_add_bookmark_bar_file (void) +{ + cut_trace(test_new()); + + kz_root_bookmark_add_bookmark_bar_file(root, bookmark_bar_file, NULL); + + expected = kz_bookmark_pure_folder_new(); + kz_bookmark_append(expected, + KZ_BOOKMARK(kz_bookmark_file_new(bookmark_bar_file, "Bookmark Bar", "XBEL"))); + + kz_assert_equal_bookmark(expected, root->bookmark_bars); +} + /* vi:ts=4:nowrap:ai:expandtab:sw=4 */