diff options
author | Bastien Nocera <hadess@hadess.net> | 2018-04-18 18:08:59 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2018-04-24 15:13:59 +0200 |
commit | f0f14a4fdfdbf1d70b0b28a2a18119da5f8ab4fa (patch) | |
tree | c728fbc2776270c977d57a725fbd3b2840435d1c /tests | |
parent | 6e8a504228178f8e094857f9542771f6bb40efb9 (diff) | |
download | grilo-plugins-f0f14a4fdfdbf1d70b0b28a2a18119da5f8ab4fa.tar.gz |
metrolyrics: Add debug helper to the tests
Save the "computed" lyrics to a temporary file on disk, so as to avoid
having to guess how to have it downloaded and processed.
https://bugzilla.gnome.org/show_bug.cgi?id=795361
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lua-factory/sources/test_lua_metrolyrics.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/lua-factory/sources/test_lua_metrolyrics.c b/tests/lua-factory/sources/test_lua_metrolyrics.c index 391969e..a48b7a7 100644 --- a/tests/lua-factory/sources/test_lua_metrolyrics.c +++ b/tests/lua-factory/sources/test_lua_metrolyrics.c @@ -106,8 +106,17 @@ test_resolve_metrolyrics (void) g_clear_pointer (&file, g_object_unref); if (g_ascii_strncasecmp (lyrics, data, size - 1) != 0) { - g_warning ("Lyrics of '%s' from '%s' changed. Check if metrolyrics.com changed", - audios[i].title, audios[i].artist); + char *filename; + int fd; + + fd = g_file_open_tmp ("metrolyrics-test-XXXXXX", &filename, NULL); + g_assert (fd > 0); + g_assert (g_file_set_contents (filename, lyrics, -1, NULL)); + close (fd); + + g_warning ("Lyrics of '%s' from '%s' changed. Check if metrolyrics.com changed. New lyrics saved in '%s'", + audios[i].title, audios[i].artist, filename); + g_free (filename); } g_clear_pointer (&lyrics, g_free); g_clear_pointer (&data, g_free); |