From a51fe8ee858485db8f5c599e64f1f6318403de43 Mon Sep 17 00:00:00 2001 From: Mikael Ottela Date: Tue, 27 Jan 2009 18:38:21 +0000 Subject: Added performance tests for image extraction svn path=/trunk/; revision=2848 --- tests/tracker-extract/data/jpeg/create_jpeg_perfdata | 7 +++++++ tests/tracker-extract/data/png/create_png_perfdata | 7 +++++++ tests/tracker-extract/data/tiff/create_tiff_perfdata | 7 +++++++ tests/tracker-extract/tracker-extract-jpeg-test.c | 3 ++- tests/tracker-extract/tracker-extract-png-test.c | 3 ++- tests/tracker-extract/tracker-extract-test-utils.c | 11 +++++++++-- tests/tracker-extract/tracker-extract-testsuite-jpeg.c | 6 ++++++ tests/tracker-extract/tracker-extract-testsuite-jpeg.h | 2 ++ tests/tracker-extract/tracker-extract-testsuite-png.c | 7 +++++++ tests/tracker-extract/tracker-extract-testsuite-png.h | 2 ++ tests/tracker-extract/tracker-extract-testsuite-tiff.c | 7 +++++++ tests/tracker-extract/tracker-extract-testsuite-tiff.h | 3 +++ tests/tracker-extract/tracker-extract-tiff-test.c | 3 ++- 13 files changed, 63 insertions(+), 5 deletions(-) create mode 100755 tests/tracker-extract/data/jpeg/create_jpeg_perfdata create mode 100755 tests/tracker-extract/data/png/create_png_perfdata create mode 100755 tests/tracker-extract/data/tiff/create_tiff_perfdata (limited to 'tests/tracker-extract') diff --git a/tests/tracker-extract/data/jpeg/create_jpeg_perfdata b/tests/tracker-extract/data/jpeg/create_jpeg_perfdata new file mode 100755 index 000000000..d22b0e6f7 --- /dev/null +++ b/tests/tracker-extract/data/jpeg/create_jpeg_perfdata @@ -0,0 +1,7 @@ +#!/bin/sh + +for i in $(seq 1000) +do + convert -size 320x240 pattern:checkerboard perf_jpeg_$i.jpg + exiftool -exif:Orientation=1 -xmp:Location=Perfora_$i -Rating=5 perf_jpeg_$i.jpg +done diff --git a/tests/tracker-extract/data/png/create_png_perfdata b/tests/tracker-extract/data/png/create_png_perfdata new file mode 100755 index 000000000..0a75a73d7 --- /dev/null +++ b/tests/tracker-extract/data/png/create_png_perfdata @@ -0,0 +1,7 @@ +#!/bin/sh + +for i in $(seq 1000) +do + convert -size 320x240 pattern:checkerboard perf_png_$i.png + exiftool -xmp:Location=Perfora_$i -Rating=5 perf_png_$i.png +done diff --git a/tests/tracker-extract/data/tiff/create_tiff_perfdata b/tests/tracker-extract/data/tiff/create_tiff_perfdata new file mode 100755 index 000000000..31284aa62 --- /dev/null +++ b/tests/tracker-extract/data/tiff/create_tiff_perfdata @@ -0,0 +1,7 @@ +#!/bin/sh + +for i in $(seq 1000) +do + convert -size 320x240 pattern:checkerboard perf_tiff_$i.tif + exiftool -exif:Orientation=1 -xmp:Location=Perfora_$i -Rating=5 perf_tiff_$i.tif +done diff --git a/tests/tracker-extract/tracker-extract-jpeg-test.c b/tests/tracker-extract/tracker-extract-jpeg-test.c index 93f2ae4be..6b4c020f4 100644 --- a/tests/tracker-extract/tracker-extract-jpeg-test.c +++ b/tests/tracker-extract/tracker-extract-jpeg-test.c @@ -63,7 +63,8 @@ main (int argc, char **argv) { data, test_tracker_extract_jpeg_exif_tags); if (g_test_perf()) { - + g_test_add_data_func ("/tracker-extract/tracker-extract-jpeg/performance", + data, performance_tracker_extract_jpeg); } #endif diff --git a/tests/tracker-extract/tracker-extract-png-test.c b/tests/tracker-extract/tracker-extract-png-test.c index 25b1f8435..6c74f5a10 100644 --- a/tests/tracker-extract/tracker-extract-png-test.c +++ b/tests/tracker-extract/tracker-extract-png-test.c @@ -54,7 +54,8 @@ main (int argc, char **argv) { /* data, test_tracker_extract_png_xmp_exif_orientation); */ if (g_test_perf()) { - + g_test_add_data_func ("/tracker-extract/tracker-extract-png/performance", + data, performance_tracker_extract_png); } #endif diff --git a/tests/tracker-extract/tracker-extract-test-utils.c b/tests/tracker-extract/tracker-extract-test-utils.c index d59769c39..c80470e14 100644 --- a/tests/tracker-extract/tracker-extract-test-utils.c +++ b/tests/tracker-extract/tracker-extract-test-utils.c @@ -97,8 +97,9 @@ performance_extract_files (const TrackerExtractorData *data, const gchar *filema g_test_timer_start(); - for (i=1;i<=filecount;i++) { + for (i=1;i<=filecount;i++) { char filename[256]; + char tmp[256]; GHashTable *metadata; metadata = g_hash_table_new_full (g_str_hash, @@ -106,7 +107,13 @@ performance_extract_files (const TrackerExtractorData *data, const gchar *filema g_free, g_free); - if (sprintf (filename, "%s%s%d.mp3",TEST_DATA_DIR,filematch,i) < 0) { + + + if (sprintf (tmp, "%s%s",TEST_DATA_DIR,filematch) < 0) { + g_assert_not_reached(); + } + + if (sprintf (filename, tmp, i) < 0) { g_assert_not_reached(); } diff --git a/tests/tracker-extract/tracker-extract-testsuite-jpeg.c b/tests/tracker-extract/tracker-extract-testsuite-jpeg.c index bdd87ea33..c68ec1fd8 100644 --- a/tests/tracker-extract/tracker-extract-testsuite-jpeg.c +++ b/tests/tracker-extract/tracker-extract-testsuite-jpeg.c @@ -166,3 +166,9 @@ void test_tracker_extract_jpeg_exif_tags(gconstpointer data) } } +void performance_tracker_extract_jpeg(gconstpointer data) +{ + const TrackerExtractorData *extractor = data; + + performance_extract_files (data, "/jpeg/perf_jpeg_%d.jpg", 1000); +} diff --git a/tests/tracker-extract/tracker-extract-testsuite-jpeg.h b/tests/tracker-extract/tracker-extract-testsuite-jpeg.h index bf5b2f74c..30ba26590 100644 --- a/tests/tracker-extract/tracker-extract-testsuite-jpeg.h +++ b/tests/tracker-extract/tracker-extract-testsuite-jpeg.h @@ -30,4 +30,6 @@ void test_tracker_extract_jpeg_exif_flash (gconstpointer data); void test_tracker_extract_jpeg_exif_tags (gconstpointer data); +void performance_tracker_extract_jpeg (gconstpointer data); + #endif diff --git a/tests/tracker-extract/tracker-extract-testsuite-png.c b/tests/tracker-extract/tracker-extract-testsuite-png.c index e9125584c..54e2dad20 100644 --- a/tests/tracker-extract/tracker-extract-testsuite-png.c +++ b/tests/tracker-extract/tracker-extract-testsuite-png.c @@ -71,3 +71,10 @@ void test_tracker_extract_png_xmp_exif_orientation(gconstpointer data) data_xmp_exif_orientation[i].testdata); } } + +void performance_tracker_extract_png(gconstpointer data) +{ + const TrackerExtractorData *extractor = data; + + performance_extract_files (data, "/png/perf_png_%d.png", 1000); +} diff --git a/tests/tracker-extract/tracker-extract-testsuite-png.h b/tests/tracker-extract/tracker-extract-testsuite-png.h index 0ee802f09..ad320576a 100644 --- a/tests/tracker-extract/tracker-extract-testsuite-png.h +++ b/tests/tracker-extract/tracker-extract-testsuite-png.h @@ -26,4 +26,6 @@ void test_tracker_extract_png_basic_size (gconstpointer data); void test_tracker_extract_png_xmp_exif_orientation (gconstpointer data); +void performance_tracker_extract_png (gconstpointer data); + #endif diff --git a/tests/tracker-extract/tracker-extract-testsuite-tiff.c b/tests/tracker-extract/tracker-extract-testsuite-tiff.c index d8c3fa44f..a1edf8a66 100644 --- a/tests/tracker-extract/tracker-extract-testsuite-tiff.c +++ b/tests/tracker-extract/tracker-extract-testsuite-tiff.c @@ -90,3 +90,10 @@ void test_tracker_extract_tiff_exif_orientation(gconstpointer data) data_exif_orientation[i].testdata); } } + +void performance_tracker_extract_tiff(gconstpointer data) +{ + const TrackerExtractorData *extractor = data; + + performance_extract_files (data, "/tiff/perf_tiff_%d.tif", 1000); +} diff --git a/tests/tracker-extract/tracker-extract-testsuite-tiff.h b/tests/tracker-extract/tracker-extract-testsuite-tiff.h index eb1c0d39d..969ba2927 100644 --- a/tests/tracker-extract/tracker-extract-testsuite-tiff.h +++ b/tests/tracker-extract/tracker-extract-testsuite-tiff.h @@ -27,4 +27,7 @@ void test_tracker_extract_tiff_basic_size (gconstpointer data); void test_tracker_extract_tiff_exif_size (gconstpointer data); void test_tracker_extract_tiff_exif_orientation (gconstpointer data); +void performance_tracker_extract_tiff (gconstpointer data); + + #endif diff --git a/tests/tracker-extract/tracker-extract-tiff-test.c b/tests/tracker-extract/tracker-extract-tiff-test.c index 23ae2fef0..5f192429c 100644 --- a/tests/tracker-extract/tracker-extract-tiff-test.c +++ b/tests/tracker-extract/tracker-extract-tiff-test.c @@ -57,7 +57,8 @@ main (int argc, char **argv) { data, test_tracker_extract_tiff_exif_orientation); if (g_test_perf()) { - + g_test_add_data_func ("/tracker-extract/tracker-extract-tiff/performance", + data, performance_tracker_extract_tiff); } #endif -- cgit v1.2.1