tracker r2850 - in trunk: . tests/tracker-extract tests/tracker-extract/data/jpeg tests/tracker-extract/data/mp3
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2850 - in trunk: . tests/tracker-extract tests/tracker-extract/data/jpeg tests/tracker-extract/data/mp3
- Date: Tue, 27 Jan 2009 20:14:54 +0000 (UTC)
Author: mottela
Date: Tue Jan 27 20:14:54 2009
New Revision: 2850
URL: http://svn.gnome.org/viewvc/tracker?rev=2850&view=rev
Log:
Added extractor file access testing
Modified:
trunk/ChangeLog
trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata
trunk/tests/tracker-extract/data/mp3/create_mp3_testdata
trunk/tests/tracker-extract/tracker-extract-mp3-test.c
trunk/tests/tracker-extract/tracker-extract-test-utils.c
trunk/tests/tracker-extract/tracker-extract-test-utils.h
trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.c
trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.h
Modified: trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata
==============================================================================
--- trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata (original)
+++ trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata Tue Jan 27 20:14:54 2009
@@ -2,6 +2,19 @@
# Basic properties
+#file access test
+convert -size 320x240 pattern:checkerboard access_1.jpg
+chmod 777 access_1.jpg
+
+convert -size 320x240 pattern:checkerboard access_2.jpg
+chmod 777 access_2.jpg
+
+convert -size 320x240 pattern:checkerboard access_3.jpg
+chmod 555 access_3.jpg
+
+convert -size 320x240 pattern:checkerboard access_4.jpg
+chmod 444 access_4.jpg
+
#size
convert -size 320x240 pattern:checkerboard basic_size_1.jpg
convert -size 640x480 pattern:checkerboard basic_size_2.jpg
Modified: trunk/tests/tracker-extract/data/mp3/create_mp3_testdata
==============================================================================
--- trunk/tests/tracker-extract/data/mp3/create_mp3_testdata (original)
+++ trunk/tests/tracker-extract/data/mp3/create_mp3_testdata Tue Jan 27 20:14:54 2009
@@ -1,5 +1,18 @@
#!/bin/sh
+#file access test
+echo Basic id3v1 tags 1| text2wave - | lame --resample 48 - "access_1.mp3"
+chmod 777 access_1.mp3
+
+echo Basic id3v1 tags 1| text2wave - | lame --resample 48 - "access_2.mp3"
+chmod 666 access_2.mp3
+
+echo Basic id3v1 tags 1| text2wave - | lame --resample 48 - "access_3.mp3"
+chmod 555 access_3.mp3
+
+echo Basic id3v1 tags 1| text2wave - | lame --resample 48 - "access_4.mp3"
+chmod 444 access_4.mp3
+
# *** Basic id3v1 tags (ver 1 layer 3) ***
echo Basic id3v1 tags 1| text2wave - | lame --resample 48 - "id3v1_basic_1.mp3"
Modified: trunk/tests/tracker-extract/tracker-extract-mp3-test.c
==============================================================================
--- trunk/tests/tracker-extract/tracker-extract-mp3-test.c (original)
+++ trunk/tests/tracker-extract/tracker-extract-mp3-test.c Tue Jan 27 20:14:54 2009
@@ -44,9 +44,13 @@
g_test_add_func ("/tracker-extract/tracker-extract-mp3/check-extractor-data",
test_tracker_extract_check_extractor_data);
-#if 0
data = tracker_test_extract_get_extractor ("audio/mpeg");
+ g_test_add_data_func ("/tracker-extract/tracker-extract-mp3/access",
+ data, access_tracker_extract_mp3);
+
+#if 0
+
g_test_add_data_func ("/tracker-extract/tracker-extract-mp3/id3v1_basic",
data, test_tracker_extract_mp3_id3v1_basic);
g_test_add_data_func ("/tracker-extract/tracker-extract-mp3/id3v23_basic",
Modified: trunk/tests/tracker-extract/tracker-extract-test-utils.c
==============================================================================
--- trunk/tests/tracker-extract/tracker-extract-test-utils.c (original)
+++ trunk/tests/tracker-extract/tracker-extract-test-utils.c Tue Jan 27 20:14:54 2009
@@ -131,6 +131,43 @@
g_test_minimized_result (perftime, "Time of the performance tests");
}
+void
+access_extract_files (const TrackerExtractorData *data, const gchar *filematch, guint filecount)
+{
+ double perftime;
+ guint i;
+
+ g_assert (data != NULL);
+ g_assert (filematch != NULL);
+ g_assert (filecount >0 );
+
+ for (i=1;i<=filecount;i++) {
+ char filename[256];
+ char tmp[256];
+ GHashTable *metadata;
+
+ metadata = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ g_free,
+ g_free);
+
+
+
+ if (sprintf (tmp, "%s%s",TEST_DATA_DIR,filematch) < 0) {
+ g_assert_not_reached();
+ }
+
+ if (sprintf (filename, tmp, i) < 0) {
+ g_assert_not_reached();
+ }
+
+ (*data->extractor) (filename, metadata);
+
+ g_assert (g_hash_table_size (metadata) > 0);
+
+ g_hash_table_destroy (metadata);
+ }
+}
TrackerExtractorData *
search_mime_extractor (const gchar *mime)
Modified: trunk/tests/tracker-extract/tracker-extract-test-utils.h
==============================================================================
--- trunk/tests/tracker-extract/tracker-extract-test-utils.h (original)
+++ trunk/tests/tracker-extract/tracker-extract-test-utils.h Tue Jan 27 20:14:54 2009
@@ -36,6 +36,9 @@
void performance_extract_files (const TrackerExtractorData *data,
const gchar *filematch,
guint filecount);
+void access_extract_files (const TrackerExtractorData *data,
+ const gchar *filematch,
+ guint filecount);
GHashTable * parse_testdata_file (const gchar *filename);
void dump_metadata (GHashTable *metadata);
Modified: trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.c
==============================================================================
--- trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.c (original)
+++ trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.c Tue Jan 27 20:14:54 2009
@@ -102,6 +102,13 @@
{ NULL, NULL }
};
+void access_tracker_extract_mp3(gconstpointer data)
+{
+ const TrackerExtractorData *extractor = data;
+
+ access_extract_files (data, "/mp3/access_%d.mp3", 4);
+}
+
void test_tracker_extract_mp3_id3v1_basic(gconstpointer data)
{
const TrackerExtractorData *extractor = data;
@@ -192,6 +199,6 @@
{
const TrackerExtractorData *extractor = data;
- performance_extract_files (data, "/mp3/perf_cbr_id3v1_", 1000);
+ performance_extract_files (data, "/mp3/perf_cbr_id3v1_%d.mp3", 1000);
}
Modified: trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.h
==============================================================================
--- trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.h (original)
+++ trunk/tests/tracker-extract/tracker-extract-testsuite-mp3.h Tue Jan 27 20:14:54 2009
@@ -23,6 +23,8 @@
#include <tracker-extract/tracker-extract.h>
+void access_tracker_extract_mp3 (gconstpointer data);
+
void test_tracker_extract_mp3_id3v1_basic (gconstpointer data);
void test_tracker_extract_mp3_id3v23_basic (gconstpointer data);
void test_tracker_extract_mp3_id3v23_tcon (gconstpointer data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]