diff options
author | Martyn Russell <martyn@lanedo.com> | 2014-10-17 12:03:03 +0100 |
---|---|---|
committer | Martyn Russell <martyn@lanedo.com> | 2014-10-17 12:03:03 +0100 |
commit | 6015d86492b15e8aca3f8f17f67d59c11e0c1191 (patch) | |
tree | 20c0df36200d1859ff429b0fc5e438c7b991267d /tests | |
parent | fa9a183d8bad3a3f41b985517f7dcf7cc37c3d85 (diff) | |
parent | 88c961d19f2621572a22ec9c170ad33eac2900c9 (diff) | |
download | libmediaart-6015d86492b15e8aca3f8f17f67d59c11e0c1191.tar.gz |
Merge branch 'remove-mediaartlocal'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mediaarttest.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/tests/mediaarttest.c b/tests/mediaarttest.c index f93845c..ff22991 100644 --- a/tests/mediaarttest.c +++ b/tests/mediaarttest.c @@ -131,15 +131,13 @@ static void test_mediaart_location (TestInfo *test_info, gconstpointer context) { - gchar *path = NULL, *local_uri = NULL; + gchar *path = NULL; gchar *expected; media_art_get_path (test_info->input1, test_info->input2, "album", - "file:///home/test/a.mp3", - &path, - &local_uri); + &path); expected = g_build_path (G_DIR_SEPARATOR_S, g_get_user_cache_dir (), "media-art", @@ -149,37 +147,32 @@ test_mediaart_location (TestInfo *test_info, g_free (expected); g_free (path); - g_free (local_uri); } static void test_mediaart_location_null (void) { - gchar *path = NULL, *local_uri = NULL; + gchar *path = NULL; - /* NULL parameters */ - media_art_get_path (NULL, "some-title", "album", "file:///a/b/c.mp3", &path, &local_uri); - g_assert (path != NULL); - g_assert (local_uri != NULL); + /* NULL parameters */ + media_art_get_path (NULL, "some-title", "album", &path); + g_assert (path != NULL); - media_art_get_path ("some-artist", NULL, "album", "file:///a/b/c.mp3", &path, &local_uri); - g_assert (path != NULL); - g_assert (local_uri != NULL); + media_art_get_path ("some-artist", NULL, "album", &path); + g_assert (path != NULL); } static void test_mediaart_location_path (void) { - gchar *path = NULL, *local_uri = NULL; + gchar *path = NULL; gchar *expected; /* Use path instead of URI */ media_art_get_path (location_test_cases[0].input1, location_test_cases[0].input2, "album", - "/home/test/a.mp3", - &path, - &local_uri); + &path); expected = g_build_path (G_DIR_SEPARATOR_S, g_get_user_cache_dir (), "media-art", @@ -189,7 +182,6 @@ test_mediaart_location_path (void) g_free (expected); g_free (path); - g_free (local_uri); } static void @@ -329,9 +321,7 @@ test_mediaart_process_buffer_cb (GObject *source_object, media_art_get_path ("Lanedo", /* artist / title */ NULL, /* album */ NULL, /* prefix */ - path, - &out_path, - &out_uri); + &out_path); g_free (path); g_object_unref (file); @@ -362,9 +352,9 @@ test_mediaart_process_buffer (void) GCancellable *cancellable; GFile *file; GError *error = NULL; + gchar *dir; gchar *path; gchar *out_path = NULL; - gchar *out_uri = NULL; unsigned char *buffer = NULL; size_t length = 0; const gchar *mime; @@ -377,17 +367,19 @@ test_mediaart_process_buffer (void) media_art_get_path ("Lanedo", /* artist / title */ NULL, /* album */ NULL, /* prefix */ - path, - &out_path, - &out_uri); + &out_path); g_assert_false (g_file_test (out_path, G_FILE_TEST_EXISTS)); g_free (out_path); - g_free (out_uri); + /* Creates media-art cache dir if it doesn't exist ... */ process = media_art_process_new (&error); g_assert_no_error (error); g_assert_nonnull (process); + dir = g_build_filename (g_get_user_cache_dir (), "media-art", NULL); + g_assert_true (g_file_test (dir, G_FILE_TEST_EXISTS)); + g_free (dir); + ml = g_main_loop_new (NULL, FALSE); /* Process data */ |