tracker-xmp-test.c 19.1 KB
Newer Older
1
/*
2
 * Copyright (C) 2010, Nokia <ivan.frade@nokia.com>
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 */
19 20 21

#include "config.h"

22
#include <glib-object.h>
23

24
#include <libtracker-extract/tracker-extract.h>
25 26

#define BROKEN_XMP "This is not even XML"
27
#define EXAMPLE_XMP	  \
28 29 30 31
"   <x:xmpmeta   " \
"      xmlns:x=\'adobe:ns:meta/\'" \
"      xmlns:dc=\"http://purl.org/dc/elements/1.1/\"" \
"      xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\"" \
32 33
"      xmlns:exif=\"http://ns.adobe.com/exif/1.0/\"" \
"      xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">" \
34
"     <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">" \
35
"        <rdf:Description rdf:about=\"\">" \
36
"         <dc:format>application/pdf</dc:format>" \
37
"         <dc:title>Title of the content</dc:title>" \
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
"         <dc:rights>CC share alike</dc:rights> " \
"         <dc:description>Description of the content</dc:description>" \
"         <dc:date>2010-03-18T15:17:04Z</dc:date>" \
"         <dc:keywords>test, data, xmp</dc:keywords>" \
"         <dc:subject>Subject of the content</dc:subject>" \
"         <dc:publisher>A honest developer</dc:publisher>" \
"         <dc:contributor>A honest contributor</dc:contributor>" \
"         <dc:type>PhysicalObject</dc:type>" \
"         <dc:identifier>12345</dc:identifier>" \
"         <dc:source>My dirty mind</dc:source>" \
"         <dc:language>Spanglish</dc:language>" \
"         <dc:relation>Single</dc:relation>" \
"         <dc:coverage>Pretty high after this test</dc:coverage>" \
"         <dc:creator>The ultimate creator</dc:creator>" \
"         <exif:Title>Title in exif</exif:Title>" \
"         <exif:DateTimeOriginal>2010-03-18T15:17:04Z</exif:DateTimeOriginal>" \
"         <exif:Artist>Artist in exif</exif:Artist>" \
"         <exif:Make>Make in exif</exif:Make>" \
"         <exif:Model>Model in exif</exif:Model>" \
"         <exif:Flash>0</exif:Flash>" \
"         <exif:MeteringMode>3</exif:MeteringMode>" \
"         <exif:ExposureTime>1000</exif:ExposureTime>" \
"         <exif:FNumber>12</exif:FNumber>" \
"         <exif:FocalLength>50</exif:FocalLength>" \
"         <exif:ISOSpeedRatings>400</exif:ISOSpeedRatings>" \
"         <exif:WhiteBalance>1</exif:WhiteBalance>" \
"         <exif:Copyright>Copyright in exif</exif:Copyright>" \
65
"         <tiff:Orientation>1</tiff:Orientation>" \
66
"         <xmp:CreateDate>2002-08-15T17:10:04Z</xmp:CreateDate>" \
67 68 69 70
"        </rdf:Description> " \
"     </rdf:RDF> " \
"   </x:xmpmeta>"

71
#define METERING_MODE_XMP \
72 73 74
"   <x:xmpmeta   " \
"      xmlns:x=\'adobe:ns:meta/\'" \
"      xmlns:exif=\"http://ns.adobe.com/exif/1.0/\">" \
75
"     <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">" \
76 77 78
"        <rdf:Description rdf:about=\"\">" \
"         <exif:MeteringMode>%d</exif:MeteringMode>" \
"        </rdf:Description>" \
79
"     </rdf:RDF></x:xmpmeta> "
80

81 82 83 84
#define ORIENTATION_XMP	  \
"   <x:xmpmeta   " \
"      xmlns:x=\'adobe:ns:meta/\'" \
"      xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\">" \
85
"     <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">" \
86 87 88
"        <rdf:Description rdf:about=\"\">" \
"         <tiff:Orientation>%s</tiff:Orientation>" \
"        </rdf:Description>" \
89
"     </rdf:RDF></x:xmpmeta> "
90

91

92
typedef struct {
93 94
	const gchar *exif_value;
	const gchar *nepomuk_translation;
95 96 97
} ExifNepomuk;

static ExifNepomuk METERING_MODES [] = {
98 99 100 101 102 103 104 105
	{"0",  "nmm:metering-mode-other"},
	{"1", "nmm:metering-mode-average"},
	{"2", "nmm:metering-mode-center-weighted-average"},
	{"3", "nmm:metering-mode-spot"},
	{"4", "nmm:metering-mode-multispot"},
	{"5", "nmm:metering-mode-pattern"},
	{"6", "nmm:metering-mode-partial"},
	{NULL, NULL}
106 107 108
};

static ExifNepomuk ORIENTATIONS [] = {
109
	{"2", "nfo:orientation-top-mirror"},
110 111
	{"3", "nfo:orientation-bottom"},
	{"4", "nfo:orientation-bottom-mirror"},
112 113 114 115
	{"5", "nfo:orientation-left-mirror"},
	{"6", "nfo:orientation-right"},
	{"7", "nfo:orientation-right-mirror"},
	{"8", "nfo:orientation-left"},
116
	{"invalid value", "nfo:orientation-top"}
117
};
118 119

static TrackerXmpData *
120
get_example_expected (void)
121
{
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
	TrackerXmpData *data;

	data = g_new0 (TrackerXmpData, 1);

	/* NS_DC */
	data->title = g_strdup ("Title of the content");
	data->rights = g_strdup ("CC share alike");
	data->creator = g_strdup ("The ultimate creator");
	data->description = g_strdup ("Description of the content");
	data->date = g_strdup ("2010-03-18T15:17:04Z");
	data->keywords = g_strdup ("test, data, xmp");
	data->subject = g_strdup ("Subject of the content");

	data->publisher = g_strdup ("A honest developer");     /* publisher */
	data->contributor = g_strdup ("A honest contributor");
	data->type = NULL ;
	data->format = g_strdup ("application/pdf");
	data->identifier = g_strdup ("12345");
	data->source = g_strdup ("My dirty mind");
	data->language = g_strdup ("Spanglish");
	data->relation = g_strdup ("Single");
	data->coverage = g_strdup ("Pretty high after this test");

	/* NS_CC */
	data->license = NULL;

	/* NS_PDF */
	data->pdf_title = NULL;
	data->pdf_keywords = NULL;

	/* NS_EXIF*/
	data->title2 = g_strdup ("Title in exif");
	data->time_original = g_strdup ("2010-03-18T15:17:04Z");
	data->artist = g_strdup ("Artist in exif");
	data->make = g_strdup ("Make in exif");
	data->model = g_strdup ("Model in exif");
	data->orientation = g_strdup ("nfo:orientation-top");
	data->flash = g_strdup ("nmm:flash-off");
	data->metering_mode = g_strdup ("nmm:metering-mode-spot");
	data->exposure_time = g_strdup ("1000");                      /* exposure time */
	data->fnumber = g_strdup ("12");                              /* fnumber */
	data->focal_length = g_strdup ("50");                         /* focal length */

	data->iso_speed_ratings = g_strdup ("400");                   /* iso speed rating */
	data->white_balance = g_strdup ("nmm:white-balance-manual");
	data->copyright = g_strdup ("Copyright in exif");
168

169 170 171 172 173 174 175 176 177
	/* NS_XAP */
	data->rating = NULL;

	/* NS_IPTC4XMP */
	/* NS_PHOTOSHOP */
	data->address = NULL;                /* address */
	data->country = NULL;                /* country */
	data->state = NULL;                  /* state */
	data->city = NULL;                   /* city */
178

179
	return data;
180 181 182
};

static void
183
test_parsing_xmp_invalid_file_subprocess (void)
184
{
185
	TrackerXmpData *data;
186

187 188
	data = tracker_xmp_new (BROKEN_XMP, strlen (BROKEN_XMP), "test://file");
	g_assert (data != NULL);
189

190 191
	tracker_xmp_free (data);
}
192

193 194 195 196 197
static void
test_parsing_xmp_invalid_file (void)
{
	g_test_trap_subprocess ("/libtracker-extract/tracker-xmp/parsing_xmp_invalid_file/subprocess", 0, 0);
	g_test_trap_assert_passed ();
198
	g_test_trap_assert_stderr ("*parsing failure*");
199 200 201 202 203 204 205
}

static void
test_parsing_xmp (void)
{
	TrackerXmpData *data;
	TrackerXmpData *expected;
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228

	data = tracker_xmp_new (EXAMPLE_XMP, strlen (EXAMPLE_XMP), "test://file");
	expected = get_example_expected ();

	/* NS_DC */
	g_assert_cmpstr (data->format, ==, expected->format);
	g_assert_cmpstr (data->title, ==, expected->title);
	g_assert_cmpstr (data->rights, ==, expected->rights);
	g_assert_cmpstr (data->description, ==, expected->description);
	g_assert_cmpstr (data->date, ==, expected->date);
	g_assert_cmpstr (data->keywords, ==, expected->keywords);
	g_assert_cmpstr (data->subject, ==, expected->subject);
	g_assert_cmpstr (data->publisher, ==, expected->publisher);
	g_assert_cmpstr (data->contributor, ==, expected->contributor);
	g_assert_cmpstr (data->identifier, ==, expected->identifier);
	g_assert_cmpstr (data->source, ==, expected->source);
	g_assert_cmpstr (data->language, ==, expected->language);
	g_assert_cmpstr (data->relation, ==, expected->relation);
	g_assert_cmpstr (data->coverage, ==, expected->coverage);
	g_assert_cmpstr (data->creator, ==, expected->creator);

	/* NS_EXIF*/
	g_assert_cmpstr (data->title2, ==, expected->title2);
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
	g_assert_cmpstr (data->time_original, ==, expected->time_original);
	g_assert_cmpstr (data->artist, ==, expected->artist);
	g_assert_cmpstr (data->make, ==, expected->make);
	g_assert_cmpstr (data->model, ==, expected->model);
	g_assert_cmpstr (data->orientation, ==, expected->orientation);
	g_assert_cmpstr (data->flash, ==, expected->flash);
	g_assert_cmpstr (data->metering_mode, ==, expected->metering_mode);
	g_assert_cmpstr (data->exposure_time, ==, expected->exposure_time);
	g_assert_cmpstr (data->fnumber, ==, expected->fnumber);
	g_assert_cmpstr (data->focal_length, ==, expected->focal_length);

	g_assert_cmpstr (data->iso_speed_ratings, ==, expected->iso_speed_ratings);
	g_assert_cmpstr (data->white_balance, ==, expected->white_balance);
	g_assert_cmpstr (data->copyright, ==, expected->copyright);

244
	tracker_xmp_free (expected);
245
	tracker_xmp_free (data);
246 247 248
}

static void
249
test_xmp_metering_mode (void)
250
{
251
	gint i;
252

253
	for (i = 0; METERING_MODES[i].exif_value != NULL; i++) {
254 255 256
		TrackerXmpData *data;
		gchar *xmp;

257 258 259
		xmp = g_strdup_printf (METERING_MODE_XMP, i);
		data = tracker_xmp_new (xmp, strlen (xmp), "local://file");
		g_free (xmp);
260

261
		g_assert_cmpstr (data->metering_mode, ==, METERING_MODES[i].nepomuk_translation);
262
		tracker_xmp_free (data);
263
	}
264 265 266
}

static void
267
test_xmp_orientation (void)
268
{
269
	guint i;
270

271
	for (i = 0; i < G_N_ELEMENTS (ORIENTATIONS); i++) {
272 273 274
		TrackerXmpData *data;
		gchar *xmp;

275 276 277
		xmp = g_strdup_printf (ORIENTATION_XMP, ORIENTATIONS[i].exif_value);
		data = tracker_xmp_new (xmp, strlen (xmp), "local://file");
		g_free (xmp);
278

279
		g_assert_cmpstr (data->orientation, ==, ORIENTATIONS[i].nepomuk_translation);
280
		tracker_xmp_free (data);
281
	}
282 283 284
}

static void
285
test_xmp_apply (void)
286
{
287 288
	TrackerResource *resource;
	TrackerResource *artist;
289
	TrackerXmpData *data;
290

291
	resource = tracker_resource_new ("urn:uuid:test");
292

293
	data = tracker_xmp_new (EXAMPLE_XMP, strlen (EXAMPLE_XMP), "urn:uuid:test");
294
	g_assert (data != NULL);
295

296
	g_assert (tracker_xmp_apply_to_resource (resource, data));
297

298 299 300
	/* We just check a few of the properties at random. */
	g_assert_cmpstr (tracker_resource_get_first_string (resource, "nie:description"), ==,
	                 "Description of the content");
301

302 303 304
	artist = tracker_resource_get_first_relation (resource, "nco:contributor");
	g_assert_cmpstr (tracker_resource_get_first_string(artist, "nco:fullname"), ==,
	                 "Artist in exif");
305

306
	tracker_xmp_free (data);
307 308 309
}

static void
310
test_xmp_apply_location (void)
311
{
312
	TrackerXmpData data = { 0, };
313
	TrackerResource *resource, *location, *address;
314

315 316 317 318
	data.address = g_strdup ("Itamerenkatu 11-13");
	data.city = g_strdup ("Helsinki");
	data.state = g_strdup ("N/A");
	data.country = g_strdup ("Findland");
319

320
	resource = tracker_resource_new ("urn:uuid:test");
321

322
	g_assert (tracker_xmp_apply_to_resource (resource, &data));
323

324 325
	location = tracker_resource_get_first_relation (resource, "slo:location");
	address = tracker_resource_get_first_relation (location, "slo:postalAddress");
326

327 328 329 330
	g_assert_cmpstr (tracker_resource_get_first_string (address, "nco:streetAddress"), ==, data.address);
	g_assert_cmpstr (tracker_resource_get_first_string (address, "nco:region"), ==, data.state);
	g_assert_cmpstr (tracker_resource_get_first_string (address, "nco:locality"), ==, data.city);
	g_assert_cmpstr (tracker_resource_get_first_string (address, "nco:country"), ==, data.country);
331 332 333 334 335

	g_free (data.address);
	g_free (data.city);
	g_free (data.state);
	g_free (data.country);
336 337
}

338 339 340 341

static void
test_xmp_regions (void)
{
342 343
	TrackerXmpData *data;
	TrackerXmpRegion *region;
344

345 346 347 348
	GFile *f;
	gchar *contents;
	gsize  size;
	gchar *filepath;
349

350 351 352
	filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "areas.xmp", NULL);
	f = g_file_new_for_path (filepath);
	g_assert (g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
353
	g_object_unref (f);
354
	g_free (filepath);
355 356

	data = tracker_xmp_new (contents, size, "test://file");
357

358
        g_free (contents);
359 360 361

	g_assert_cmpint (2, ==, g_slist_length (data->regions));

362
	region = g_slist_nth_data (data->regions, 1);
363 364 365 366 367 368 369 370
	g_assert_cmpstr (region->x, ==, "0.51");
	g_assert_cmpstr (region->y, ==, "0.51");
	g_assert_cmpstr (region->width, ==, "0.01");
	g_assert_cmpstr (region->height, ==, "0.09");
	g_assert_cmpstr (region->type, ==, "Pet");
	g_assert_cmpstr (region->title, ==, "Fido");
	g_assert_cmpstr (region->description, ==, "Fido looks happy!");

371
	region = g_slist_nth_data (data->regions, 0);
372 373 374 375 376 377 378 379
	g_assert_cmpstr (region->x, ==, "0.5");
	g_assert_cmpstr (region->y, ==, "0.5");
	g_assert_cmpstr (region->width, ==, "0.06");
	g_assert_cmpstr (region->height, ==, "0.09");
	g_assert_cmpstr (region->type, ==, "Face");
	g_assert_cmpstr (region->title, ==, "John Doe");

	tracker_xmp_free (data);
380 381 382 383 384
}

static void
test_xmp_regions_quill (void)
{
385
	TrackerXmpData *data;
386 387
	TrackerXmpRegion *region;

388 389 390 391
	GFile *f;
	gchar *contents;
	gsize  size;
	gchar *filepath;
392

393 394 395
	filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "areas-with-contacts.xmp", NULL);
	f = g_file_new_for_path (filepath);
	g_assert (g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
396
	g_object_unref (f);
397
	g_free (filepath);
398 399 400

	data = tracker_xmp_new (contents, size, "test://file");

401 402
        g_free (contents);

403 404
	g_assert_cmpint (2, ==, g_slist_length (data->regions));

405
	region = g_slist_nth_data (data->regions, 1);
406 407 408 409 410 411 412 413 414
	g_assert_cmpstr (region->x, ==, "0.4");
	g_assert_cmpstr (region->y, ==, "0.3");
	g_assert_cmpstr (region->width, ==, "0.17");
	g_assert_cmpstr (region->height, ==, "0.15");
	g_assert_cmpstr (region->type, ==, "Face");
	g_assert_cmpstr (region->title, ==, "Dilbert");
	g_assert_cmpstr (region->link_class, ==, "nco:PersonContact");
	g_assert_cmpstr (region->link_uri, ==, "urn:uuid:2");

415
	region = g_slist_nth_data (data->regions, 0);
416 417 418 419 420 421 422 423 424 425
	g_assert_cmpstr (region->x, ==, "0.3");
	g_assert_cmpstr (region->y, ==, "0.4");
	g_assert_cmpstr (region->width, ==, "0.15");
	g_assert_cmpstr (region->height, ==, "0.17");
	g_assert_cmpstr (region->type, ==, "Face");
	g_assert_cmpstr (region->title, ==, "Albert Einstein");
	g_assert_cmpstr (region->link_class, ==, "nco:PersonContact");
	g_assert_cmpstr (region->link_uri, ==, "urn:uuid:1");

	tracker_xmp_free (data);
426 427 428 429 430
}

static void
test_xmp_regions_ns_prefix (void)
{
431 432
	TrackerXmpData *data;
	TrackerXmpRegion *region;
433

434 435 436 437
	GFile *f;
	gchar *contents;
	gsize  size;
	gchar *filepath;
438

439 440
	filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "areas-ns.xmp", NULL);
	f = g_file_new_for_path (filepath);
441 442
	g_assert(g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
	g_object_unref (f);
443
	g_free (filepath);
444 445 446

	data = tracker_xmp_new (contents, size, "test://file");

447 448
        g_free (contents);

449 450
	g_assert_cmpint (2, ==, g_slist_length (data->regions));

451
	region = g_slist_nth_data (data->regions, 1);
452 453 454 455 456 457 458 459
	g_assert_cmpstr (region->x, ==, "0.51");
	g_assert_cmpstr (region->y, ==, "0.51");
	g_assert_cmpstr (region->width, ==, "0.01");
	g_assert_cmpstr (region->height, ==, "0.09");
	g_assert_cmpstr (region->type, ==, "Pet");
	g_assert_cmpstr (region->title, ==, "Fidoz");
	g_assert_cmpstr (region->description, ==, "Fido looks happy!");

460
	region = g_slist_nth_data (data->regions, 0);
461 462 463 464 465 466 467 468
	g_assert_cmpstr (region->x, ==, "0.5");
	g_assert_cmpstr (region->y, ==, "0.5");
	g_assert_cmpstr (region->width, ==, "0.06");
	g_assert_cmpstr (region->height, ==, "0.09");
	g_assert_cmpstr (region->type, ==, "Face");
	g_assert_cmpstr (region->title, ==, "Average Joe");

	tracker_xmp_free (data);
469 470
}

471
static void
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
test_xmp_regions_nb282393 ()
{
	TrackerXmpData *data;
	TrackerXmpRegion *region;

	GFile *f;
	gchar *contents;
	gsize  size;
	gchar *filepath;

	filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "nb282393.xmp", NULL);
	f = g_file_new_for_path (filepath);
	g_assert(g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
	g_object_unref (f);
	g_free (filepath);

	data = tracker_xmp_new (contents, size, "test://file");

490 491
        g_free (contents);

492 493 494 495 496 497 498 499 500 501 502 503 504
	g_assert_cmpint (1, ==, g_slist_length (data->regions));

	/* Regions are stacked while parsing.*/
	region = g_slist_nth_data (data->regions, 0);
	g_assert_cmpstr (region->x, ==, "0.433333");
	g_assert_cmpstr (region->y, ==, "0.370000");
	g_assert_cmpstr (region->width, ==, "0.586667");
	g_assert_cmpstr (region->height, ==, "0.440000");
	g_assert_cmpstr (region->title, ==, " ");

	tracker_xmp_free (data);
}

505
static void
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
test_xmp_regions_nb282393_2 ()
{
	TrackerXmpData *data;
	TrackerXmpRegion *region;

	GFile *f;
	gchar *contents;
	gsize  size;
	gchar *filepath;

	filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "nb282393_simple.xmp", NULL);
	f = g_file_new_for_path (filepath);
	g_assert(g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
	g_object_unref (f);
	g_free (filepath);

	data = tracker_xmp_new (contents, size, "test://file");

524 525
        g_free (contents);

526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
	g_assert_cmpint (1, ==, g_slist_length (data->regions));

	/* Regions are stacked while parsing.*/
	region = g_slist_nth_data (data->regions, 0);
	g_assert_cmpstr (region->x, ==, "0.440000");
	g_assert_cmpstr (region->y, ==, "0.365000");
	g_assert_cmpstr (region->width, ==, "0.586667");
	g_assert_cmpstr (region->height, ==, "0.440000");
	g_assert_cmpstr (region->title, ==, " ");

        g_assert_cmpstr (region->link_class, ==, "nco:PersonContact");
        g_assert_cmpstr (region->link_uri, ==, "urn:uuid:840a3c05-6cc6-48a1-bb56-fc50fae3345a");

	tracker_xmp_free (data);
}

542 543 544 545
int
main (int    argc,
      char **argv)
{
546
	gint result;
547 548

	g_test_init (&argc, &argv, NULL);
549

550 551
	g_test_message ("Testing XMP");

552
#ifdef HAVE_EXEMPI
553

554
	g_test_add_func ("/libtracker-extract/tracker-xmp/parsing_xmp",
555
	                 test_parsing_xmp);
556

557 558 559 560 561
	g_test_add_func ("/libtracker-extract/tracker-xmp/parsing_xmp_invalid_file",
	                 test_parsing_xmp_invalid_file);
	g_test_add_func ("/libtracker-extract/tracker-xmp/parsing_xmp_invalid_file/subprocess",
	                 test_parsing_xmp_invalid_file_subprocess);

562 563
	g_test_add_func ("/libtracker-extract/tracker-xmp/metering-mode",
	                 test_xmp_metering_mode);
564

565 566
	g_test_add_func ("/libtracker-extract/tracker-xmp/orientation",
	                 test_xmp_orientation);
567

568 569
	g_test_add_func ("/libtracker-extract/tracker-xmp/sparql_translation",
	                 test_xmp_apply);
570

571 572
	g_test_add_func ("/libtracker-extract/tracker-xmp/xmp_regions",
	                 test_xmp_regions);
573

574 575
	g_test_add_func ("/libtracker-extract/tracker-xmp/xmp_regions_2",
	                 test_xmp_regions_quill);
576

577 578 579
        g_test_add_func ("/libtracker-extract/tracker-xmp/xmp_regions_crash_nb282393",
                         test_xmp_regions_nb282393);

580 581 582
        g_test_add_func ("/libtracker-extract/tracker-xmp/xmp_regions_crash_nb282393_2",
                         test_xmp_regions_nb282393_2);

583 584
	g_test_add_func ("/libtracker-extract/tracker-xmp/xmp_regions_ns_prefix",
	                 test_xmp_regions_ns_prefix);
585

586
#endif
587 588 589 590
	g_test_add_func ("/libtracker-extract/tracker-xmp/sparql_translation_location",
	                 test_xmp_apply_location);

	result = g_test_run ();
591

592 593
	return result;
}