aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-11-06 22:20:20 -0600
committerCharles Kerr <charles.kerr@canonical.com>2012-11-06 22:20:20 -0600
commit33683f3166434cf1540ac5ad66910c7e04e516de (patch)
treeb2837b19ac38bd45cebc66dfe5e8c1ae1c3f6f9c
parent0b83123924f907e93780baf015a330c74166235a (diff)
downloadayatana-ido-33683f3166434cf1540ac5ad66910c7e04e516de.tar.gz
ayatana-ido-33683f3166434cf1540ac5ad66910c7e04e516de.tar.bz2
ayatana-ido-33683f3166434cf1540ac5ad66910c7e04e516de.zip
add more coverage for idocalendar. total package's line coverage is up to 50% now
-rw-r--r--tests/gtest-menuitems.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/tests/gtest-menuitems.cpp b/tests/gtest-menuitems.cpp
index 55fa4d9..20bafc4 100644
--- a/tests/gtest-menuitems.cpp
+++ b/tests/gtest-menuitems.cpp
@@ -41,7 +41,25 @@ TEST_F(TestMenuitems, BuildCalendar) {
EXPECT_TRUE(IDO_IS_CALENDAR_MENU_ITEM(cal));
EXPECT_TRUE(GTK_IS_MENU_ITEM(cal));
+ const guint year_in = 1963;
+ const guint month_in = 10;
+ const guint day_in = 23;
+ ido_calendar_menu_item_set_date (IDO_CALENDAR_MENU_ITEM(cal), year_in, month_in, day_in);
+ guint year_out = 0;
+ guint month_out = 0;
+ guint day_out = 0;
+ ido_calendar_menu_item_get_date (IDO_CALENDAR_MENU_ITEM(cal), &year_out, &month_out, &day_out);
+ ASSERT_EQ (year_in, year_out);
+ ASSERT_EQ (month_in, month_out);
+ ASSERT_EQ (day_in, day_out);
+
+ const GtkCalendarDisplayOptions options_in = GTK_CALENDAR_SHOW_DAY_NAMES;
+ ido_calendar_menu_item_set_display_options (IDO_CALENDAR_MENU_ITEM(cal), options_in);
+ const GtkCalendarDisplayOptions options_out = ido_calendar_menu_item_get_display_options (IDO_CALENDAR_MENU_ITEM(cal));
+ ASSERT_EQ (options_in, options_out);
+
PutInMenu (cal);
+
return;
}
@@ -80,15 +98,14 @@ TEST_F(TestMenuitems, BuildScaleSmall) {
TEST_F(TestMenuitems, BuildSwitch) {
- GtkWidget * item = ido_switch_menu_item_new ();
- EXPECT_TRUE (item != NULL);
- EXPECT_TRUE (IDO_IS_SWITCH_MENU_ITEM(item));
- EXPECT_TRUE (GTK_IS_MENU_ITEM(item));
+ GtkWidget * item = ido_switch_menu_item_new ();
+ EXPECT_TRUE (item != NULL);
+ EXPECT_TRUE (IDO_IS_SWITCH_MENU_ITEM(item));
+ EXPECT_TRUE (GTK_IS_MENU_ITEM(item));
- GtkContainer * content_area = ido_switch_menu_item_get_content_area (IDO_SWITCH_MENU_ITEM(item));
- EXPECT_TRUE (content_area != NULL);
- EXPECT_TRUE (GTK_IS_CONTAINER (content_area));
+ GtkContainer * content_area = ido_switch_menu_item_get_content_area (IDO_SWITCH_MENU_ITEM(item));
+ EXPECT_TRUE (content_area != NULL);
+ EXPECT_TRUE (GTK_IS_CONTAINER (content_area));
- PutInMenu (item);
- return;
+ PutInMenu (item);
}