Commit 4d206f76 authored by Martyn Russell's avatar Martyn Russell

tests: Removed all cases of g_test_trap_fork() which has been deprecated.

Now we're using g_test_trap_subprocess() instead and that requires GLib 2.38.

Tracker now depends on GLib 2.38.
parent 72dc5e49
......@@ -162,7 +162,7 @@ PYTHON_REQUIRED=2.6
# Library required versions
DBUS_REQUIRED=1.3.1
GLIB_REQUIRED=2.35.1
GLIB_REQUIRED=2.38.0
PANGO_REQUIRED=1.0.0
GTK_REQUIRED=3.0.0
LIBXML2_REQUIRED=2.6
......
......@@ -32,6 +32,20 @@
#define G_VALUE_INIT { 0, { { 0 } } }
#endif
static void
test_string_to_date_failures_subprocess ()
{
tracker_string_to_date (NULL, NULL, NULL);
}
static void
test_string_to_date_failures ()
{
g_test_trap_subprocess ("/libtracker-common/date-time/string_to_date_failures/subprocess", 0, 0);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*'date_string' failed*");
}
static void
test_string_to_date (void)
{
......@@ -69,11 +83,6 @@ test_string_to_date (void)
g_assert_cmpint (g_date_get_day (expected), ==, g_date_get_day (result));
g_assert_cmpint (g_date_get_month (expected), ==, g_date_get_month (result));
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
result_time_t = tracker_string_to_date (NULL, NULL, NULL);
}
g_test_trap_assert_failed ();
result_time_t = tracker_string_to_date ("", NULL, &error);
g_assert_cmpint (result_time_t, ==, -1);
g_assert_error (error, TRACKER_DATE_ERROR, TRACKER_DATE_ERROR_INVALID_ISO8601);
......@@ -231,6 +240,10 @@ main (gint argc, gchar **argv)
test_date_to_string);
g_test_add_func ("/libtracker-common/date-time/string_to_date",
test_string_to_date);
g_test_add_func ("/libtracker-common/date-time/string_to_date_failures",
test_string_to_date_failures);
g_test_add_func ("/libtracker-common/date-time/string_to_date_failures/subprocess",
test_string_to_date_failures_subprocess);
g_test_add_func ("/libtracker-common/date-time/get_set",
test_date_time_get_set);
g_test_add_func ("/libtracker-common/date-time/from_string",
......
......@@ -43,13 +43,12 @@ log_handler (const gchar *domain,
g_print ("%s\n", message);
}
static void
slist_to_strv (gboolean utf8)
static inline GSList *
slist_to_strv_get_source (gint strings,
gboolean utf8)
{
GSList *input = NULL;
gint i;
gchar **input_as_strv;
gint strings = 5;
gint i;
for (i = 0; i < strings; i++) {
if (utf8) {
......@@ -58,261 +57,105 @@ slist_to_strv (gboolean utf8)
input = g_slist_prepend (input, g_strdup (tracker_test_helpers_get_nonutf8 ()));
}
}
g_assert_cmpint (g_slist_length (input), ==, strings);
if (utf8) {
input_as_strv = tracker_dbus_slist_to_strv (input);
g_assert_cmpint (g_strv_length (input_as_strv), ==, (utf8 ? strings : 0));
g_strfreev (input_as_strv);
} else {
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
g_log_set_default_handler (log_handler, NULL);
input_as_strv = tracker_dbus_slist_to_strv (input);
g_strfreev (input_as_strv);
}
/* Error message:
* Could not add string:'/invalid/file/\xe4\xf6\xe590808.' to GStrv, invalid UTF-8
*/
g_test_trap_assert_stderr ("*Could not add string:*");
}
g_slist_foreach (input, (GFunc) g_free, NULL);
g_slist_free (input);
return input;
}
static void
test_slist_to_strv (void)
test_slist_to_strv_failures_subprocess (void)
{
slist_to_strv (TRUE);
}
#if 0
GSList *input;
gchar **input_as_strv;
static void
test_slist_to_strv_nonutf8 (void)
{
slist_to_strv (FALSE);
}
input = slist_to_strv_get_source (5, FALSE);
#endif
g_log_set_default_handler (log_handler, NULL);
input_as_strv = tracker_dbus_slist_to_strv (input);
g_assert_cmpint (g_strv_length (input_as_strv), ==, 0);
g_strfreev (input_as_strv);
#if 0
g_slist_foreach (input, (GFunc) g_free, NULL);
g_slist_free (input);
}
static void
test_async_queue_to_strv_nonutf8 (void)
test_slist_to_strv_failures (void)
{
async_queue_to_strv (FALSE);
}
g_test_trap_subprocess ("/libtracker-common/tracker-dbus/slist_to_strv_failures/subprocess", 0, 0);
#endif
/* Error message:
* Could not add string:'/invalid/file/\xe4\xf6\xe590808.' to GStrv, invalid UTF-8
*/
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*Could not add string:*");
}
static void
test_dbus_request_failed (void)
test_slist_to_strv (void)
{
TrackerDBusRequest *request;
GError *error = NULL;
GSList *input;
gchar **input_as_strv;
gint strings = 5;
/* For some (unknown) reason, this calls don't appear in the
* coverage evaluation. */
input = slist_to_strv_get_source (strings, TRUE);
g_assert_cmpint (g_slist_length (input), ==, strings);
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"%s()",
__PRETTY_FUNCTION__);
input_as_strv = tracker_dbus_slist_to_strv (input);
/* We have already the error and want only the log line */
error = g_error_new (1000, -1, "The indexer founded an error");
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_request_end (request, error);
}
g_assert_cmpint (g_strv_length (input_as_strv), ==, strings);
g_strfreev (input_as_strv);
g_test_trap_assert_stderr ("*The indexer founded an error*");
g_error_free (error);
g_slist_foreach (input, (GFunc) g_free, NULL);
g_slist_free (input);
}
static void
test_dbus_request ()
test_dbus_request_subprocess (void)
{
TrackerDBusRequest *request;
GError *error = NULL;
tracker_dbus_enable_client_lookup (FALSE);
/* Checking the logging output */
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT)) {
g_log_set_default_handler (log_handler, NULL);
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*TestNewOK*");
g_log_set_default_handler (log_handler, NULL);
/* New request case */
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
tracker_dbus_request_end (request, NULL);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_request_comment (request,
"Well (%s)",
"--TestCommentOK--");
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*TestCommentOK*");
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT)) {
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_request_end (request, NULL);
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*Success*");
}
#if 0
static void
test_dbus_request_client_lookup ()
{
TrackerDBusRequest *request;
tracker_dbus_enable_client_lookup (TRUE);
/* Checking the logging output */
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT)) {
g_log_set_default_handler (log_handler, NULL);
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*TestNewOK*");
g_test_trap_assert_stdout ("*lt-tracker-dbus*");
/* Comment and success case */
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
tracker_dbus_request_comment (request,
"Well (%s)",
"--TestCommentOK--");
tracker_dbus_request_end (request, NULL);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_request_comment (request,
"Well (%s)",
"--TestCommentOK--");
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*TestCommentOK*");
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT)) {
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_request_info (request,
"Test info %s",
"--TestInfoOK--");
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*TestInfoOK*");
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT)) {
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_request_debug (request,
"Test debug %s",
"--TestDebugOK--");
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*TestDebugOK*");
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT)) {
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_request_end (request, NULL);
exit (0);
}
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*Success*");
/* Force client shutdown */
tracker_dbus_enable_client_lookup (FALSE);
}
static void
test_dbus_request_client_lookup_monothread ()
{
/* Run everything in the same fork to check the clients_shutdown code */
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
TrackerDBusRequest *request;
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_enable_client_lookup (TRUE);
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
tracker_dbus_request_comment (request,
"Well (%s)",
"--TestCommentOK--");
/*
tracker_dbus_request_end (request, NULL,
"--TestFailedOK--");
tracker_quark = tracker_dbus_error_quark ();
error = g_error_new (tracker_quark, -1, "test_using_g_error");
tracker_dbus_request_end (tracker_quark, error);
*/
tracker_dbus_request_end (request, NULL);
/* Force client shutdown */
tracker_dbus_enable_client_lookup (FALSE);
exit (0);
}
/* Error case */
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"%s()",
__PRETTY_FUNCTION__);
g_test_trap_assert_passed ();
error = g_error_new (1000, -1, "The indexer founded an error");
tracker_dbus_request_end (request, error);
g_error_free (error);
}
static void
test_dbus_request_failed_coverage ()
test_dbus_request (void)
{
/* Repeat the failed test case in one thread to get coverage */
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) {
GQuark tracker_quark;
GError *error = NULL;
TrackerDBusRequest *request;
g_log_set_default_handler (log_handler, NULL);
tracker_dbus_enable_client_lookup (TRUE);
/* Using GError */
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
tracker_quark = tracker_dbus_error_quark ();
error = g_error_new (tracker_quark, -1, "test_using_g_error");
tracker_dbus_request_end (request, error);
request = tracker_dbus_request_begin ("tracker-dbus-test.c",
"Test request (%s))",
"--TestNewOK--");
tracker_dbus_request_end (request, NULL);
/* Force client shutdown */
tracker_dbus_enable_client_lookup (FALSE);
exit (0);
}
/* Checking the logging output */
g_test_trap_subprocess ("/libtracker-common/tracker-dbus/request/subprocess", 0, 0);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*TestNewOK*");
g_test_trap_assert_stderr ("*TestCommentOK*");
g_test_trap_assert_stdout ("*Success*");
g_test_trap_assert_stderr ("*The indexer founded an error*");
}
#endif
int
main (int argc, char **argv) {
......@@ -332,18 +175,21 @@ main (int argc, char **argv) {
g_test_add_func ("/libtracker-common/tracker-dbus/slist_to_strv_ok",
test_slist_to_strv);
g_test_add_func ("/libtracker-common/tracker-dbus/slist_to_strv_failures",
test_slist_to_strv_failures);
g_test_add_func ("/libtracker-common/tracker-dbus/slist_to_strv_failures/subprocess",
test_slist_to_strv_failures_subprocess);
g_test_add_func ("/libtracker-common/tracker-dbus/request",
test_dbus_request);
g_test_add_func ("/libtracker-common/tracker-dbus/request/subprocess",
test_dbus_request_subprocess);
/* port to gdbus first
g_test_add_func ("/libtracker-common/tracker-dbus/request-client-lookup",
test_dbus_request_client_lookup);
g_test_add_func ("/libtracker-common/tracker-dbus/request-client-lookup",
test_dbus_request_client_lookup_monothread);
*/
g_test_add_func ("/libtracker-common/tracker-dbus/request_failed",
test_dbus_request_failed);
/* g_test_add_func ("/libtracker-common/tracker-dbus/request_failed_coverage",
g_test_add_func ("/libtracker-common/tracker-dbus/request_failed_coverage",
test_dbus_request_failed_coverage);
*/
result = g_test_run ();
......
......@@ -102,6 +102,32 @@ test_guint32_to_string (void)
}
static void
test_string_to_uint_failures_subprocess_1 (void)
{
guint num = 10;
tracker_string_to_uint (NULL, &num);
}
static void
test_string_to_uint_failures_subprocess_2 (void)
{
tracker_string_to_uint ("199", NULL);
}
static void
test_string_to_uint_failures (void)
{
g_test_trap_subprocess ("/libtracker-common/tracker-type-utils/string_to_uint_failures/subprocess/1", 0, 0);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion 's != NULL' failed*");
g_test_trap_subprocess ("/libtracker-common/tracker-type-utils/string_to_uint_failures/subprocess/2", 0, 0);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion 'value != NULL' failed*");
}
static void
test_string_to_uint (void)
{
......@@ -112,28 +138,31 @@ test_string_to_uint (void)
g_assert (rc);
g_assert_cmpint (num_result, ==, 10);
rc = tracker_string_to_uint ("i am not a number", &num_result);
g_assert (!rc);
g_assert_cmpint (rc, ==, 0);
}
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
rc = tracker_string_to_uint (NULL, &num_result);
}
g_test_trap_assert_failed ();
static void
test_string_in_string_list_failures_subprocess (void)
{
const gchar *complete = "This is an extract of text with different terms an props like Audio:Title ...";
gchar **pieces;
/* ???? FIXME */
rc = tracker_string_to_uint ("-20", &num_result);
pieces = g_strsplit (complete, " ", -1);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
tracker_string_to_uint (NULL, &num_result);
}
g_test_trap_assert_failed ();
g_assert_cmpint (tracker_string_in_string_list (NULL, pieces), ==, -1);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
tracker_string_to_uint ("199", NULL);
}
g_test_trap_assert_failed ();
g_strfreev (pieces);
}
rc = tracker_string_to_uint ("i am not a number", &num_result);
g_assert (!rc);
g_assert_cmpint (rc, ==, 0);
static void
test_string_in_string_list_failures (void)
{
g_test_trap_subprocess ("/libtracker-common/tracker-type-utils/string_in_string_list_failures/subprocess", 0, 0);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion 'str != NULL' failed*");
}
static void
......@@ -147,15 +176,7 @@ test_string_in_string_list (void)
g_assert_cmpint (tracker_string_in_string_list ("is", pieces), ==, 1);
g_assert_cmpint (tracker_string_in_string_list ("Audio:Title", pieces), ==, 12);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
g_assert_cmpint (tracker_string_in_string_list (NULL, pieces), ==, -1);
}
g_test_trap_assert_failed ();
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
g_assert_cmpint (tracker_string_in_string_list ("terms", NULL), ==, -1);
}
g_test_trap_assert_failed ();
g_assert_cmpint (tracker_string_in_string_list ("terms", NULL), ==, -1);
}
static void
......@@ -198,12 +219,9 @@ test_gslist_to_string_list (void)
g_strfreev (result);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
result = tracker_gslist_to_string_list (NULL);
g_strfreev (result);
}
g_test_trap_assert_failed ();
result = tracker_gslist_to_string_list (NULL);
g_assert (result != NULL);
g_strfreev (result);
}
static void
......@@ -253,12 +271,8 @@ test_string_list_to_string (void)
g_assert_cmpstr ("one_two_three", ==, result);
g_free (result);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
result = tracker_string_list_to_string (NULL, 6, 'x');
g_free (result);
}
g_test_trap_assert_failed ();
result = tracker_string_list_to_string (NULL, 6, 'x');
g_assert (result == NULL);
result = tracker_string_list_to_string (pieces, -1, ' ');
g_assert_cmpstr (input, ==, result);
......@@ -282,6 +296,20 @@ test_string_to_string_list (void)
g_assert_cmpstr (result [0], ==, "first line");
}
static void
test_boolean_as_text_to_number_failures_subprocess (void)
{
tracker_string_boolean_to_string_gint (NULL);
}
static void
test_boolean_as_text_to_number_failures (void)
{
g_test_trap_subprocess ("/libtracker-common/tracker-type-utils/boolean_as_text_to_number_failures/subprocess", 0, 0);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion 'value != NULL' failed*");
}
static void
test_boolean_as_text_to_number (void)
{
......@@ -326,13 +354,6 @@ test_boolean_as_text_to_number (void)
result = tracker_string_boolean_to_string_gint ("Other invalid value");
g_assert_cmpstr (result, ==, "Other invalid value");
g_free (result);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
result = tracker_string_boolean_to_string_gint (NULL);
g_free (result);
}
g_test_trap_assert_failed ();
}
static void
......@@ -401,6 +422,10 @@ main (int argc, char **argv)
g_test_add_func ("/libtracker-common/tracker-type-utils/boolean_as_text_to_number",
test_boolean_as_text_to_number);
g_test_add_func ("/libtracker-common/tracker-type-utils/boolean_as_text_to_number_failures",
test_boolean_as_text_to_number_failures);
g_test_add_func ("/libtracker-common/tracker-type-utils/boolean_as_text_to_number_failures/subprocess",
test_boolean_as_text_to_number_failures_subprocess);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_list_as_list",
test_string_list_to_string);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_list_as_list",
......@@ -409,12 +434,22 @@ main (int argc, char **argv)
test_gslist_to_string_list);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_in_string_list",
test_string_in_string_list);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_in_string_list_failures",
test_string_in_string_list_failures);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_in_string_list_failures/subprocess",
test_string_in_string_list_failures_subprocess);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_in_gslist",
test_string_in_gslist);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_list_to_gslist",
test_string_list_to_gslist);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_to_uint",
test_string_to_uint);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_to_uint_failures",
test_string_to_uint_failures);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_to_uint_failures/subprocess/1",
test_string_to_uint_failures_subprocess_1);
g_test_add_func ("/libtracker-common/tracker-type-utils/string_to_uint_failures/subprocess/2",
test_string_to_uint_failures_subprocess_2);
g_test_add_func ("/libtracker-common/tracker-type-utils/guint32_to_string",
test_guint32_to_string);
g_test_add_func ("/libtracker-common/tracker-type-utils/gint32_to_string",
......
......@@ -28,6 +28,24 @@
#include <libtracker-extract/tracker-extract.h>
static void
test_guess_date_failures_subprocess ()
{
gchar *result;
result = tracker_date_guess (NULL);
g_free (result);
}
static void
test_guess_date_failures ()
{
g_test_trap_subprocess ("/libtracker-extract/tracker-utils/guess_date_failures/subprocess", 0, G_TEST_SUBPROCESS_INHERIT_STDERR);
g_test_trap_assert_passed ();
/* Should be NO output when using NULL with tracker_date_guess() */
}
static void
test_guess_date (void)
{
......@@ -83,13 +101,6 @@ test_guess_date (void)
result = tracker_date_guess ("2010-03-18T01:02:03.100");
g_assert_cmpstr (result, ==, "2010-03-18T01:02:03.100");
g_free (result);
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
result = tracker_date_guess (NULL);
g_free (result);
}
g_test_trap_assert_failed ();
}
static void
......@@ -274,6 +285,10 @@ main (int argc, char **argv)
g_test_add_func ("/libtracker-extract/tracker-utils/guess_date",
test_guess_date);
g_test_add_func ("/libtracker-extract/tracker-utils/guess_date_failures",
test_guess_date_failures);
g_test_add_func ("/libtracker-extract/tracker-utils/guess_date_failures/subprocess",
test_guess_date_failures_subprocess);
g_test_add_func ("/libtracker-extract/tracker-utils/text-validate-utf8",
test_text_validate_utf8);
g_test_add_func ("/libtracker-extract/tracker-utils/date_to_iso8601",
......
......@@ -180,19 +180,29 @@ get_example_expected (void)
};
static void
test_parsing_xmp (void)
test_parsing_xmp_invalid_file_subprocess (void)
{
TrackerXmpData *data;
TrackerXmpData *expected;
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR)) {
data = tracker_xmp_new (BROKEN_XMP, strlen (BROKEN_XMP), "test://file");
g_assert (data != NULL);
data = tracker_xmp_new (BROKEN_XMP, strlen (BROKEN_XMP), "test://file");
g_assert (data != NULL);
tracker_xmp_free (data);
}
tracker_xmp_free (data);
}
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 ();
g_test_trap_assert_stderr ("*parsing failure*");
}
static void
test_parsing_xmp (void)
{
TrackerXmpData *data;
TrackerXmpData *expected;
data = tracker_xmp_new (EXAMPLE_XMP, strlen (EXAMPLE_XMP), "test://file");
expected = get_example_expected ();
......@@ -606,6 +616,11 @@ main (int argc,
g_test_add_func ("/libtracker-extract/tracker-xmp/parsing_xmp",
test_parsing_xmp);
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);
g_test_add_func ("/libtracker-extract/tracker-xmp/metering-mode",
test_xmp_metering_mode);
......
......@@ -21,6 +21,8 @@
#include <locale.h>
#include <glib-object.h>
#include <libtracker-sparql/tracker-sparql.h>
typedef struct {
......@@ -295,31 +297,64 @@ test_tracker_sparql_nb237150_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
TrackerSparqlConnection *connection;
GError *error = NULL;
static gboolean had_1 = FALSE;
static gboolean had_2 = FALSE;
connection = tracker_sparql_connection_get_finish (result, &error);