svnno****@sourc*****
svnno****@sourc*****
Mon Jan 26 14:26:01 JST 2009
Revision: 3572 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3572 Author: ikezoe Date: 2009-01-26 14:26:01 +0900 (Mon, 26 Jan 2009) Log Message: ----------- added. Modified Paths: -------------- kazehakase/trunk/test/Makefile.am Added Paths: ----------- kazehakase/trunk/test/test-bookmark-file.c Modified: kazehakase/trunk/test/Makefile.am =================================================================== --- kazehakase/trunk/test/Makefile.am 2009-01-26 01:48:51 UTC (rev 3571) +++ kazehakase/trunk/test/Makefile.am 2009-01-26 05:26:01 UTC (rev 3572) @@ -7,6 +7,7 @@ kz_test_utils.la \ test-bookmark.la \ test-bookmark-folder.la \ + test-bookmark-file.la \ test-bookmark-separator.la \ test-root-bookmark.la endif @@ -37,6 +38,8 @@ test_bookmark_la_SOURCES = test-bookmark.c test_bookmark_folder_la_SOURCES = test-bookmark-folder.c test_bookmark_separator_la_SOURCES = test-bookmark-separator.c +test_bookmark_file_la_SOURCES = test-bookmark-file.c +test_bookmark_file_la_LIBADD = kz_test_utils.la test_root_bookmark_la_SOURCES = test-root-bookmark.c test_root_bookmark_la_LIBADD = kz_test_utils.la Added: kazehakase/trunk/test/test-bookmark-file.c =================================================================== --- kazehakase/trunk/test/test-bookmark-file.c (rev 0) +++ kazehakase/trunk/test/test-bookmark-file.c 2009-01-26 05:26:01 UTC (rev 3572) @@ -0,0 +1,56 @@ +#include "src/bookmarks/kz-bookmark-file.h" + +#include <gcutter.h> +#include "kz-test-utils.h" + +void test_new (void); +void test_file_type (void); +void test_location (void); + +static KzBookmarkFile *file; +static gchar *file_path; + +void +setup (void) +{ + file = NULL; + file_path = g_build_filename(kz_test_get_base_dir(), + "fixtures", "bookmarks.xml", + NULL); +} + +void +teardown (void) +{ + if (file) + g_object_unref(file); + g_free(file_path); +} + +void +test_new (void) +{ + file = kz_bookmark_file_new(file_path, "Bookmark file", "XBEL"); + cut_assert(file); + cut_assert_true(KZ_IS_BOOKMARK_FILE(file)); +} + +void +test_file_type (void) +{ + cut_trace(test_new()); + + cut_assert_equal_string("XBEL", kz_bookmark_file_get_file_type(file)); +} + +void +test_location (void) +{ + cut_trace(test_new()); + + cut_assert_equal_string(file_path, kz_bookmark_file_get_location(file)); +} + +/* +vi:ts=4:nowrap:ai:expandtab:sw=4 +*/