summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristophe Fergeau <teuf@gnome.org>2006-04-12 18:51:51 +0000
committerChristophe Fergeau <teuf@gnome.org>2006-04-12 18:51:51 +0000
commit42231ea2f01974507ae00cfef80806485c25d645 (patch)
treef81ebc2ab12dc704f6dffe201cbcf7a99a4c7b11 /tests
parent4c1dd3b2911949aa2d24c933ce9c868e011d1234 (diff)
downloadlibgpod-tmz-42231ea2f01974507ae00cfef80806485c25d645.tar.gz
libgpod-tmz-42231ea2f01974507ae00cfef80806485c25d645.tar.xz
libgpod-tmz-42231ea2f01974507ae00cfef80806485c25d645.zip
* tests/test-rebuild-db.cc: forgot to propagate a GError
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1246 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'tests')
-rw-r--r--tests/test-rebuild-db.cc34
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/test-rebuild-db.cc b/tests/test-rebuild-db.cc
index c5c232c..334c376 100644
--- a/tests/test-rebuild-db.cc
+++ b/tests/test-rebuild-db.cc
@@ -2,20 +2,20 @@
* Copyright (C) 2006 Christophe Fergeau
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
+ * sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
- * The above copyright notice and this permission notice shall be included in
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
@@ -89,7 +89,7 @@ track_from_file (const char *filename)
g_print ("\t%d\n", tag->year());
g_print ("\t%d\n", tag->track());
g_print ("\n");
-#endif
+#endif
track = itdb_track_new ();
track->title = g_strdup (tag->title().toCString(true));
track->album = g_strdup (tag->album().toCString(true));
@@ -130,9 +130,9 @@ process_one_file (const char *filename, gpointer data)
typedef void (*DirTraversalFunc)(const char *filename, gpointer data);
static void
-foreach_file (const char *basedir,
- DirTraversalFunc func, gpointer data,
- GError **error)
+foreach_file (const char *basedir,
+ DirTraversalFunc func, gpointer data,
+ GError **error)
{
GError *tmp_error;
const char *name;
@@ -146,7 +146,7 @@ foreach_file (const char *basedir,
g_propagate_error (error, tmp_error);
return;
}
-
+
name = g_dir_read_name (dir);
while (name != NULL) {
char *absolute_path;
@@ -183,7 +183,11 @@ fill_db (Itdb_iTunesDB *db, GError **error)
music_dir = itdb_get_music_dir (itdb_get_mountpoint (db));
foreach_file (music_dir, process_one_file, db, &err);
g_free (music_dir);
- g_print ("Found %d files\n",
+ if (err != NULL) {
+ g_propagate_error (error, err);
+ return;
+ }
+ g_print ("Found %d files\n",
g_list_length (itdb_playlist_mpl(db)->members));
}
@@ -209,7 +213,7 @@ int main (int argc, char **argv)
{
Itdb_iTunesDB *db;
GError *error;
-
+
if (argc != 2) {
g_print ("Usage:\n");
g_print ("%s <mountpoint>\n", g_basename (argv[0]));