Skip to content

Commit

Permalink
tests/notification: Test file-descriptor based icons/sounds
Browse files Browse the repository at this point in the history
Now that libportal support for notifications v2 landed, we can enable
the file-descriptor based tests for icons and sounds.
  • Loading branch information
swick committed Nov 27, 2024
1 parent cb38a29 commit eaebdcf
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions tests/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16px\" width=\"16px\"/>"


/* reenable when the proper PR in libportal is merged */
#if 0
static const guchar SOUND_DATA[] = {
0x52, 0x49, 0x46, 0x46, 0x24, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45,
0x66, 0x6d, 0x74, 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
0x44, 0xac, 0x00, 0x00, 0x88, 0x58, 0x01, 0x00, 0x02, 0x00, 0x10, 0x00,
0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00
};
#endif

extern char outdir[];

Expand Down Expand Up @@ -373,8 +369,6 @@ test_bytes_icon (void)
}


/* reenable when the proper PR in libportal is merged */
#if 0
static void
test_file_icon (void)
{
Expand All @@ -401,7 +395,6 @@ test_file_icon (void)
g_file_delete (file, NULL, &error);
g_assert_no_error (error);
}
#endif

void
test_notification_icon (void)
Expand All @@ -413,10 +406,7 @@ test_notification_icon (void)
test_themed_icon ();
test_bytes_icon ();

/* reenable when the proper PR in libportal is merged */
#if 0
test_file_icon ();
#endif

/* Tests that should fail */
test_icon ("('themed', <'test-icon-symbolic'>)", NULL, TRUE);
Expand Down Expand Up @@ -448,8 +438,6 @@ test_sound (const char *serialized_sound,
run_notification_test ("test-sound", notification_s, expected_notification_s, expect_failure);
}

/* reenable when the proper PR in libportal is merged */
#if 0
static void
test_file_sound (void)
{
Expand All @@ -471,17 +459,14 @@ test_file_sound (void)
g_file_delete (file, NULL, &error);
g_assert_no_error (error);
}
#endif

void
test_notification_sound (void)
{
test_sound ("'default'", NULL, FALSE);
test_sound ("'silent'", NULL, FALSE);
/* reenable when the proper PR in libportal is merged */
#if 0

test_file_sound ();
#endif

/* Tests that should fail */
test_sound ("('file-descriptor', <''>)", NULL, TRUE);
Expand Down

0 comments on commit eaebdcf

Please sign in to comment.