Make notification_is_duplicate test icons
Before, it only did test for `ASSERT_FALSE` both times. So a raw_image wasn't guaranteed to be a condition to falsify the return. Using the single field function, will test for both cases.
This commit is contained in:
parent
c1090ad7dc
commit
84e5a0bf26
@ -30,11 +30,8 @@ TEST test_notification_is_duplicate(struct notification *a,
|
||||
|
||||
ASSERT(notification_is_duplicate(a, b));
|
||||
|
||||
char *tmp = b->icon;
|
||||
enum icon_position icon_setting_tmp = settings.icon_position;
|
||||
|
||||
b->icon = "Test1";
|
||||
|
||||
settings.icon_position = ICON_OFF;
|
||||
ASSERT(notification_is_duplicate(a, b));
|
||||
//Setting pointer to a random value since we are checking for null
|
||||
@ -43,18 +40,17 @@ TEST test_notification_is_duplicate(struct notification *a,
|
||||
b->raw_icon = NULL;
|
||||
|
||||
settings.icon_position = ICON_LEFT;
|
||||
ASSERT_FALSE(notification_is_duplicate(a, b));
|
||||
CHECK_CALL(test_notification_is_duplicate_field(&(b->icon), a, b));
|
||||
b->raw_icon = (struct raw_image*)0xff;
|
||||
ASSERT_FALSE(notification_is_duplicate(a, b));
|
||||
b->raw_icon = NULL;
|
||||
|
||||
settings.icon_position = ICON_RIGHT;
|
||||
ASSERT_FALSE(notification_is_duplicate(a, b));
|
||||
CHECK_CALL(test_notification_is_duplicate_field(&(b->icon), a, b));
|
||||
b->raw_icon = (struct raw_image*)0xff;
|
||||
ASSERT_FALSE(notification_is_duplicate(a, b));
|
||||
b->raw_icon = NULL;
|
||||
|
||||
b->icon = tmp;
|
||||
settings.icon_position = icon_setting_tmp;
|
||||
|
||||
ASSERT(notification_is_duplicate(a, b));
|
||||
|
Loading…
x
Reference in New Issue
Block a user