svnno****@sourc*****
svnno****@sourc*****
Wed Feb 18 10:49:18 JST 2009
Revision: 3732 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3732 Author: ikezoe Date: 2009-02-18 10:49:17 +0900 (Wed, 18 Feb 2009) Log Message: ----------- create_new test. Modified Paths: -------------- kazehakase/trunk/test/test-bookmark-file.c Modified: kazehakase/trunk/test/test-bookmark-file.c =================================================================== --- kazehakase/trunk/test/test-bookmark-file.c 2009-02-18 01:06:01 UTC (rev 3731) +++ kazehakase/trunk/test/test-bookmark-file.c 2009-02-18 01:49:17 UTC (rev 3732) @@ -4,6 +4,7 @@ #include "kz-test-utils.h" void test_new (void); +void test_create_new (void); void test_file_type (void); void test_document_title (void); void test_location (void); @@ -23,6 +24,7 @@ static gint n_load_completed_received; static gint n_load_error_received; static gchar *error_message; +static const gchar temporary_bookmark_file[] = "tmp_bookmark.xml"; void setup (void) @@ -50,6 +52,8 @@ g_object_unref(expected); g_free(file_path); g_free(error_message); + + cut_remove_path(temporary_bookmark_file, NULL); } void @@ -58,10 +62,20 @@ file = kz_bookmark_file_new(file_path, "Bookmark file", "XBEL"); cut_assert(file); cut_assert_true(KZ_IS_BOOKMARK_FILE(file)); - cut_assert_true(kz_bookmark_is_folder(KZ_BOOKMARK(file))); + cut_assert_true(KZ_IS_BOOKMARK_FOLDER(file)); } void +test_create_new (void) +{ + file = kz_bookmark_file_create_new(temporary_bookmark_file, "Temporary", "XBEL"); + + cut_assert_true(KZ_IS_BOOKMARK_FILE(file)); + cut_assert_true(KZ_IS_BOOKMARK_FOLDER(file)); + cut_assert_false(kz_bookmark_folder_has_children(KZ_BOOKMARK_FOLDER(file))); +} + +void test_file_type (void) { cut_trace(test_new());