svnno****@sourc*****
svnno****@sourc*****
Sun Jan 25 07:59:15 JST 2009
Revision: 3560 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3560 Author: ikezoe Date: 2009-01-25 07:59:15 +0900 (Sun, 25 Jan 2009) Log Message: ----------- more tests. Modified Paths: -------------- kazehakase/trunk/test/test-bookmark-folder.c Modified: kazehakase/trunk/test/test-bookmark-folder.c =================================================================== --- kazehakase/trunk/test/test-bookmark-folder.c 2009-01-24 22:12:27 UTC (rev 3559) +++ kazehakase/trunk/test/test-bookmark-folder.c 2009-01-24 22:59:15 UTC (rev 3560) @@ -11,6 +11,8 @@ void test_prepend (void); void test_insert_before (void); void test_remove (void); +void test_next (void); +void test_prev (void); static KzBookmark *folder; static KzBookmark *child; @@ -104,14 +106,13 @@ { cut_trace(test_append()); - g_object_unref(child); - child = kz_bookmark_new_with_attrs("Title", "URI", "Description"); - kz_bookmark_prepend(folder, child); + another_child = kz_bookmark_new_with_attrs("Title", "URI", "Description"); + kz_bookmark_prepend(folder, another_child); children = kz_bookmark_get_children(folder); cut_assert_equal_int(2, g_list_length(children)); - cut_assert_equal_pointer(children->data, child); + cut_assert_equal_pointer(children->data, another_child); } void @@ -119,12 +120,8 @@ { KzBookmark *another_child; - cut_trace(test_new()); + cut_trace(test_append()); - cut_assert_false(kz_bookmark_has_children(folder)); - child = kz_bookmark_new_with_attrs("Title", "URI", "Description"); - kz_bookmark_append(folder, child); - another_child = kz_bookmark_new_with_attrs("Title", "URI", "Description"); kz_bookmark_insert_before(folder, another_child, child); @@ -137,22 +134,28 @@ void test_remove (void) { - cut_trace(test_new()); + cut_trace(test_append()); + kz_bookmark_remove(folder, child); cut_assert_false(kz_bookmark_has_children(folder)); - child = kz_bookmark_new_with_attrs("Title", "URI", "Description"); - kz_bookmark_append(folder, child); +} - cut_assert_true(kz_bookmark_has_children(folder)); +void +test_next (void) +{ + cut_trace(test_prepend()); - children = kz_bookmark_get_children(folder); - cut_assert_equal_int(1, g_list_length(children)); + cut_assert_equal_pointer(child, kz_bookmark_next(another_child)); +} - cut_assert_equal_pointer(children->data, child); +void +test_prev (void) +{ + cut_trace(test_prepend()); - kz_bookmark_remove(folder, child); - cut_assert_false(kz_bookmark_has_children(folder)); + cut_assert_equal_pointer(another_child, kz_bookmark_prev(child)); } + /* vi:ts=4:nowrap:ai:expandtab:sw=4 */