aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@gnome.org>2009-12-03 06:01:24 +0800
committerDiego Escalante Urrelo <diegoe@gnome.org>2009-12-05 02:03:23 +0800
commit5aee0deca12e14554ce0fa0d4b02613e99ba77a9 (patch)
treee5d390c9e4630010212dc8ca8c78ce5dd7a95dde /tests
parent0fdd13a976543bf83ed360d42eabf085294195f1 (diff)
downloadgsoc2013-epiphany-5aee0deca12e14554ce0fa0d4b02613e99ba77a9.tar
gsoc2013-epiphany-5aee0deca12e14554ce0fa0d4b02613e99ba77a9.tar.gz
gsoc2013-epiphany-5aee0deca12e14554ce0fa0d4b02613e99ba77a9.tar.bz2
gsoc2013-epiphany-5aee0deca12e14554ce0fa0d4b02613e99ba77a9.tar.lz
gsoc2013-epiphany-5aee0deca12e14554ce0fa0d4b02613e99ba77a9.tar.xz
gsoc2013-epiphany-5aee0deca12e14554ce0fa0d4b02613e99ba77a9.tar.zst
gsoc2013-epiphany-5aee0deca12e14554ce0fa0d4b02613e99ba77a9.zip
Remove redundant parameters in location-set API
EphyLocationEntry, EphyLocationAction and EphyToolbar take an @adress and @typed_address parameter, while both are useful we only end up using one so we can easily decide which one to use in ephy-window.c instead of carrying both around until ephy-location-entry.c Bonus: make ephy_location_entry_set_location accept NULL as @address safely. Bug #603651
Diffstat (limited to 'tests')
-rw-r--r--tests/testephylocationentry.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/testephylocationentry.c b/tests/testephylocationentry.c
index 905ae852f..440fe1858 100644
--- a/tests/testephylocationentry.c
+++ b/tests/testephylocationentry.c
@@ -56,15 +56,11 @@ test_entry_set_location (void)
null = ephy_location_entry_get_location (entry);
- ephy_location_entry_set_location (entry, set, NULL);
+ ephy_location_entry_set_location (entry, set);
get = ephy_location_entry_get_location (entry);
g_assert_cmpstr (set, ==, get);
}
-/*
- * FIXME: there's an already an assertion to avoid null as the arg, but we
- * should *confirm* that it indeed fails, although I'm not pretty sure it's
- * required to fail if the text is NULL.
static void
test_entry_set_location_null (void)
{
@@ -74,11 +70,10 @@ test_entry_set_location_null (void)
EphyLocationEntry *entry;
entry = EPHY_LOCATION_ENTRY (ephy_location_entry_new ());
- ephy_location_entry_set_location (entry, NULL, NULL);
+ ephy_location_entry_set_location (entry, NULL);
get = ephy_location_entry_get_location (entry);
- g_assert_cmpstr (set, ==, get);
+ g_assert_cmpstr (set, !=, get);
}
-*/
static void
test_entry_get_location (void)
@@ -89,7 +84,7 @@ test_entry_get_location (void)
EphyLocationEntry *entry;
entry = EPHY_LOCATION_ENTRY (ephy_location_entry_new ());
- ephy_location_entry_set_location (entry, set, NULL);
+ ephy_location_entry_set_location (entry, set);
get = ephy_location_entry_get_location (entry);
g_assert_cmpstr (set, ==, get);
}
@@ -132,8 +127,8 @@ test_entry_can_redo (void)
entry = EPHY_LOCATION_ENTRY (ephy_location_entry_new ());
g_assert_cmpint (ephy_location_entry_get_can_redo (entry), ==, FALSE);
- /* Can't redo, in this point we can UNdo */
- ephy_location_entry_set_location (entry, test, NULL);
+ /* Can't redo, in this point we can undo */
+ ephy_location_entry_set_location (entry, test);
g_assert_cmpint (ephy_location_entry_get_can_redo (entry), ==, FALSE);
/* Reset should set redo to TRUE */
@@ -158,11 +153,9 @@ main (int argc, char *argv[])
g_test_add_func (
"/lib/widgets/ephy-location-entry/get_location",
test_entry_get_location);
- /*
g_test_add_func (
"/lib/widgets/ephy-location-entry/set_location_null",
test_entry_set_location_null);
- */
g_test_add_func (
"/lib/widgets/ephy-location-entry/get_location_empty",
test_entry_get_location_empty);