summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2020-08-12 23:15:45 +0200
committerSam Thursfield <sam@afuera.me.uk>2020-08-12 23:15:45 +0200
commitbbf5b19f9862b4bd78f41a49308976ff84769acc (patch)
tree8d1711caf9a4eae75160246c9a2fe63915316e60
parentdfe542d94fa7190a4965561cd460685fba6196b2 (diff)
downloadtracker-bbf5b19f9862b4bd78f41a49308976ff84769acc.tar.gz
tests: Use g_assert_true() instead of g_assert()
This fixes the tests when -DG_DISABLE_ASSERT is passed at compile time. See https://gitlab.gnome.org/GNOME/tracker/-/issues/240
-rw-r--r--tests/gvdb/gvdb-test.c34
-rw-r--r--tests/libtracker-common/tracker-date-time-test.c22
-rw-r--r--tests/libtracker-common/tracker-file-utils-test.c42
-rw-r--r--tests/libtracker-common/tracker-parser-test.c2
-rw-r--r--tests/libtracker-common/tracker-type-utils-test.c46
-rw-r--r--tests/libtracker-common/tracker-utils-test.c22
-rw-r--r--tests/libtracker-data/tracker-service-test.c4
-rw-r--r--tests/libtracker-data/tracker-sparql-blank-test.c8
-rw-r--r--tests/libtracker-data/tracker-sparql-test.c6
-rw-r--r--tests/libtracker-sparql/tracker-fd-test.c50
-rw-r--r--tests/libtracker-sparql/tracker-resource-test.c18
-rw-r--r--tests/libtracker-sparql/tracker-sparql-test.c12
12 files changed, 133 insertions, 133 deletions
diff --git a/tests/gvdb/gvdb-test.c b/tests/gvdb/gvdb-test.c
index 3a2882103..ad91c7c6d 100644
--- a/tests/gvdb/gvdb-test.c
+++ b/tests/gvdb/gvdb-test.c
@@ -10,7 +10,7 @@
static void
remove_file (const gchar *filename)
{
- g_assert (unlink (filename) == 0);
+ g_assert_true (unlink (filename) == 0);
}
static void
@@ -61,7 +61,7 @@ test_gvdb_walk (void)
g_free (key);
}
- g_assert (gvdb_table_write_contents (root_table, DB_FILE, FALSE, NULL));
+ g_assert_true (gvdb_table_write_contents (root_table, DB_FILE, FALSE, NULL));
g_hash_table_unref (ns_table);
g_hash_table_unref (root_table);
@@ -104,23 +104,23 @@ test_gvdb_nested_keys (void)
g_free (key);
}
- g_assert (gvdb_table_write_contents (root_table, DB_FILE, FALSE, NULL));
+ g_assert_true (gvdb_table_write_contents (root_table, DB_FILE, FALSE, NULL));
g_hash_table_unref (ns_table);
g_hash_table_unref (root_table);
root_level = gvdb_table_new (DB_FILE, TRUE, NULL);
- g_assert (root_level);
+ g_assert_true (root_level);
ns_level = gvdb_table_get_table (root_level, "namespaces");
- g_assert (ns_level);
+ g_assert_true (ns_level);
keys = gvdb_table_list (ns_level, "");
- g_assert (keys);
+ g_assert_true (keys);
g_assert_cmpint (g_strv_length (keys), ==, 3);
for (item_id = 0; item_id < 3; item_id++) {
key = g_strdup_printf ("ns%d", item_id);
- g_assert (gvdb_table_has_value (ns_level, key));
+ g_assert_true (gvdb_table_has_value (ns_level, key));
value = gvdb_table_get_raw_value (ns_level, key);
g_assert_cmpstr (g_variant_get_string (value, NULL), ==, "http://some.cool.ns");
g_free (key);
@@ -142,17 +142,17 @@ simple_test (const gchar *filename, gboolean use_byteswap)
table = gvdb_hash_table_new (NULL, "level1");
gvdb_hash_table_insert_string (table, "key1", "here just a flat string");
- g_assert (gvdb_table_write_contents (table, filename, use_byteswap, NULL));
+ g_assert_true (gvdb_table_write_contents (table, filename, use_byteswap, NULL));
g_hash_table_unref (table);
read = gvdb_table_new (filename, TRUE, NULL);
- g_assert (read);
- g_assert (gvdb_table_is_valid (read));
+ g_assert_true (read);
+ g_assert_true (gvdb_table_is_valid (read));
- g_assert (gvdb_table_has_value (read, "key1"));
+ g_assert_true (gvdb_table_has_value (read, "key1"));
value = gvdb_table_get_value (read, "key1");
expected = g_variant_new_string ("here just a flat string");
- g_assert (g_variant_equal (value, expected));
+ g_assert_true (g_variant_equal (value, expected));
g_variant_unref (expected);
g_variant_unref (value);
@@ -194,19 +194,19 @@ test_gvdb_ref_unref (void)
/* Create a table */
table = gvdb_hash_table_new (NULL, "level1");
gvdb_hash_table_insert_string (table, "key1", "whatever");
- g_assert (gvdb_table_write_contents (table, DB_FILE, FALSE, NULL));
+ g_assert_true (gvdb_table_write_contents (table, DB_FILE, FALSE, NULL));
g_hash_table_unref (table);
/* Read the table */
read = gvdb_table_new (DB_FILE, TRUE, NULL);
- g_assert (read && gvdb_table_is_valid (read));
+ g_assert_true (read && gvdb_table_is_valid (read));
/* Run the checks with a reference */
read_ref = gvdb_table_ref (read);
- g_assert (gvdb_table_has_value (read_ref, "key1"));
+ g_assert_true (gvdb_table_has_value (read_ref, "key1"));
value = gvdb_table_get_value (read_ref, "key1");
expected = g_variant_new_string ("whatever");
- g_assert (g_variant_equal (value, expected));
+ g_assert_true (g_variant_equal (value, expected));
g_variant_unref (expected);
g_variant_unref (value);
@@ -228,7 +228,7 @@ test_gvdb_corrupted_file (void)
-1, NULL);
gvdb_table_new ("./test_invalid.gvdb", TRUE, &error);
- g_assert (error);
+ g_assert_true (error);
remove_file ("./test_invalid.gvdb");
}
diff --git a/tests/libtracker-common/tracker-date-time-test.c b/tests/libtracker-common/tracker-date-time-test.c
index f51c36830..268cac58a 100644
--- a/tests/libtracker-common/tracker-date-time-test.c
+++ b/tests/libtracker-common/tracker-date-time-test.c
@@ -139,7 +139,7 @@ test_date_to_string (void)
#endif
result = tracker_date_to_string (input, 0);
- g_assert (result != NULL && strncmp (result, "2008-06-16T23:53:10Z", 19) == 0);
+ g_assert_true (result != NULL && strncmp (result, "2008-06-16T23:53:10Z", 19) == 0);
g_free (result);
result = tracker_date_to_string (input, 7200);
@@ -186,44 +186,44 @@ test_date_time_from_string ()
g_value_init (&value, TRACKER_TYPE_DATE_TIME);
tracker_date_time_set_from_string (&value, "2011-10-28T17:43:00+03:00", &error);
- g_assert (!error);
+ g_assert_true (!error);
g_assert_cmpint (tracker_date_time_get_time (&value), ==, 1319812980);
g_assert_cmpint (tracker_date_time_get_offset (&value), ==, 10800);
/* Negative offset */
tracker_date_time_set_from_string (&value, "2011-10-28T17:43:00-03:00", &error);
- g_assert (!error);
+ g_assert_true (!error);
g_assert_cmpint (tracker_date_time_get_time (&value), ==, 1319834580);
g_assert_cmpint (tracker_date_time_get_offset (&value), ==, -10800);
/* No offset */
tracker_date_time_set_from_string (&value, "2011-10-28T17:43:00Z", &error);
- g_assert (!error);
+ g_assert_true (!error);
g_assert_cmpint (tracker_date_time_get_time (&value), ==, 1319823780);
g_assert_cmpint (tracker_date_time_get_offset (&value), ==, 0);
/* Invalid format */
tracker_date_time_set_from_string (&value, "2011-10-28T17:43:00Z0900", &error);
- g_assert (error);
+ g_assert_true (error);
g_error_free (error);
error = NULL;
/* There are no 28 months... */
tracker_date_time_set_from_string (&value, "2011-28-10T17:43:00Z0900", &error);
- g_assert (error);
+ g_assert_true (error);
g_error_free (error);
error = NULL;
/* ... nor more than +-12 offsets */
tracker_date_time_set_from_string (&value, "2011-28-10T17:43:00+17:00", &error);
- g_assert (error);
+ g_assert_true (error);
g_error_free (error);
error = NULL;
/* ... the same for the glory of the branch % */
tracker_date_time_set_from_string (&value, "2011-28-10T17:43:00-17:00", &error);
- g_assert (error);
+ g_assert_true (error);
g_error_free (error);
error = NULL;
}
@@ -237,7 +237,7 @@ test_date_time_get_local_date ()
g_value_init (&value, TRACKER_TYPE_DATE_TIME);
tracker_date_time_set_from_string (&value, "2011-10-28T17:43:00+03:00", &error);
- g_assert (!error);
+ g_assert_true (!error);
g_assert_cmpint (tracker_date_time_get_local_date (&value), ==, 15275);
}
@@ -251,7 +251,7 @@ test_date_time_get_local_time ()
g_value_init (&value, TRACKER_TYPE_DATE_TIME);
tracker_date_time_set_from_string (&value, "2011-10-28T17:43:00+03:00", &error);
- g_assert (!error);
+ g_assert_true (!error);
g_assert_cmpint (tracker_date_time_get_local_time (&value), ==, 63780);
}
@@ -268,7 +268,7 @@ test_date_time_conversions (void)
date_str = "2011-10-28T17:43:00+03:00";
time = tracker_string_to_date (date_str, &offset, &error);
- g_assert (!error);
+ g_assert_true (!error);
g_assert_cmpint (time, ==, 1319812980);
g_assert_cmpint (offset, ==, 10800);
diff --git a/tests/libtracker-common/tracker-file-utils-test.c b/tests/libtracker-common/tracker-file-utils-test.c
index a41bead43..aa6cbf29f 100644
--- a/tests/libtracker-common/tracker-file-utils-test.c
+++ b/tests/libtracker-common/tracker-file-utils-test.c
@@ -46,7 +46,7 @@ ensure_file_exists (const gchar *filename)
static void
remove_file (const gchar *filename)
{
- g_assert (g_file_test (filename, G_FILE_TEST_EXISTS));
+ g_assert_true (g_file_test (filename, G_FILE_TEST_EXISTS));
g_assert_cmpint (g_remove (filename), ==, 0);
}
@@ -93,9 +93,9 @@ test_path_list_filter_duplicates (void)
result = tracker_path_list_filter_duplicates (input_as_list, ".", TRUE);
g_assert_cmpint (3, ==, g_slist_length (result));
- g_assert (string_in_list (result, "/home"));
- g_assert (string_in_list (result, "/tmp"));
- g_assert (string_in_list (result, "/usr"));
+ g_assert_true (string_in_list (result, "/home"));
+ g_assert_true (string_in_list (result, "/tmp"));
+ g_assert_true (string_in_list (result, "/usr"));
g_slist_foreach (input_as_list, (GFunc) g_free, NULL);
g_slist_foreach (result, (GFunc) g_free, NULL);
@@ -114,15 +114,15 @@ test_path_list_filter_duplicates_with_exceptions ()
result = tracker_path_list_filter_duplicates (input_as_list, "/home/user/MyDocs", FALSE);
g_assert_cmpint (g_slist_length (result), ==, 3);
- g_assert (string_in_list (result, "/home/user/MyDocs"));
- g_assert (string_in_list (result, "/home/user/MyDocs/.sounds"));
- g_assert (string_in_list (result, "/home/user/MyDocs/visible"));
+ g_assert_true (string_in_list (result, "/home/user/MyDocs"));
+ g_assert_true (string_in_list (result, "/home/user/MyDocs/.sounds"));
+ g_assert_true (string_in_list (result, "/home/user/MyDocs/visible"));
g_slist_foreach (result, (GFunc) g_free, NULL);
result = tracker_path_list_filter_duplicates (input_as_list, "/home/user/MyDocs", TRUE);
g_assert_cmpint (g_slist_length (result), ==, 1);
- g_assert (string_in_list (result, "/home/user/MyDocs"));
+ g_assert_true (string_in_list (result, "/home/user/MyDocs"));
g_slist_foreach (result, (GFunc) g_free, NULL);
g_slist_foreach (input_as_list, (GFunc) g_free, NULL);
@@ -200,16 +200,16 @@ test_path_evaluate_name (void)
g_free (expected);
result = tracker_path_evaluate_name ("");
- g_assert (!result);
+ g_assert_true (!result);
g_free (result);
result = tracker_path_evaluate_name (NULL);
- g_assert (!result);
+ g_assert_true (!result);
g_free (result);
g_setenv ("HOME", "", TRUE);
result = tracker_path_evaluate_name ("~/but-no-home.txt");
- g_assert (!result);
+ g_assert_true (!result);
g_free (result);
g_setenv ("HOME", home, TRUE);
@@ -284,15 +284,15 @@ test_file_utils_open_close ()
FILE *f;
f = tracker_file_open (TEST_FILENAME);
- g_assert (f);
+ g_assert_true (f);
tracker_file_close (f, TRUE);
f = tracker_file_open (TEST_FILENAME);
- g_assert (f);
+ g_assert_true (f);
tracker_file_close (f, FALSE);
f = tracker_file_open ("./file-does-NOT-exist");
- g_assert (!f);
+ g_assert_true (!f);
}
static void
@@ -368,11 +368,11 @@ static void
test_file_system_has_enough_space ()
{
/* Hopefully we will always have 1 byte free... */
- g_assert (tracker_file_system_has_enough_space ("/home", 1, FALSE));
- g_assert (tracker_file_system_has_enough_space ("/home", 1, TRUE));
+ g_assert_true (tracker_file_system_has_enough_space ("/home", 1, FALSE));
+ g_assert_true (tracker_file_system_has_enough_space ("/home", 1, TRUE));
/* gulong goes only up to 4Gb. Cannot ask for unreasonable amount of space */
- //g_assert (!tracker_file_system_has_enough_space ("/home", G_MAXULONG, FALSE));
+ //g_assert_true (!tracker_file_system_has_enough_space ("/home", G_MAXULONG, FALSE));
}
static void
@@ -383,11 +383,11 @@ test_file_utils_is_hidden ()
ensure_file_exists ("./non-hidden-test-file");
f = g_file_new_for_path (TEST_HIDDEN_FILENAME);
- g_assert (tracker_file_is_hidden (f));
+ g_assert_true (tracker_file_is_hidden (f));
g_object_unref (f);
f = g_file_new_for_path ("./non-hidden-test-file");
- g_assert (!tracker_file_is_hidden (f));
+ g_assert_true (!tracker_file_is_hidden (f));
g_object_unref (f);
remove_file ("./non-hidden-test-file");
@@ -402,8 +402,8 @@ test_file_utils_cmp ()
two = g_file_new_for_path (TEST_FILENAME);
three = g_file_new_for_path (TEST_HIDDEN_FILENAME);
- g_assert (!tracker_file_cmp (one, two));
- g_assert (tracker_file_cmp (two, three));
+ g_assert_true (!tracker_file_cmp (one, two));
+ g_assert_true (tracker_file_cmp (two, three));
}
int
diff --git a/tests/libtracker-common/tracker-parser-test.c b/tests/libtracker-common/tracker-parser-test.c
index 954c212bd..656e6ec53 100644
--- a/tests/libtracker-common/tracker-parser-test.c
+++ b/tests/libtracker-common/tracker-parser-test.c
@@ -142,7 +142,7 @@ expected_nwords_check (TrackerParserTestFixture *fixture,
g_assert_cmpuint (nwords, == , testdata->expected_nwords);
else
/* We'll assert if both expected number of words fail */
- g_assert ((nwords == testdata->expected_nwords) ||
+ g_assert_true ((nwords == testdata->expected_nwords) ||
(nwords == testdata->alternate_expected_nwords));
}
diff --git a/tests/libtracker-common/tracker-type-utils-test.c b/tests/libtracker-common/tracker-type-utils-test.c
index 5fce83406..7508efd2e 100644
--- a/tests/libtracker-common/tracker-type-utils-test.c
+++ b/tests/libtracker-common/tracker-type-utils-test.c
@@ -71,11 +71,11 @@ test_string_in_gslist (void)
input = g_slist_prepend (input, g_strdup ("three"));
input = g_slist_prepend (input, g_strdup ("four"));
- g_assert (tracker_string_in_gslist ("one", input));
- g_assert (tracker_string_in_gslist ("two", input));
- g_assert (tracker_string_in_gslist ("three", input));
- g_assert (tracker_string_in_gslist ("four", input));
- g_assert (!tracker_string_in_gslist ("five", input));
+ g_assert_true (tracker_string_in_gslist ("one", input));
+ g_assert_true (tracker_string_in_gslist ("two", input));
+ g_assert_true (tracker_string_in_gslist ("three", input));
+ g_assert_true (tracker_string_in_gslist ("four", input));
+ g_assert_true (!tracker_string_in_gslist ("five", input));
g_slist_foreach (input, (GFunc)g_free, NULL);
g_slist_free (input);
@@ -102,7 +102,7 @@ test_gslist_to_string_list (void)
g_strfreev (result);
result = tracker_gslist_to_string_list (NULL);
- g_assert (result != NULL);
+ g_assert_true (result != NULL);
g_strfreev (result);
}
@@ -113,26 +113,26 @@ test_string_list_to_gslist (void)
GSList *result = NULL;
result = tracker_string_list_to_gslist ((gchar **)input, -1);
- g_assert (result);
+ g_assert_true (result);
g_assert_cmpint (g_slist_length (result), ==, 4);
/* This function is tested in other test, so it should work or fail there also */
- g_assert (tracker_string_in_gslist ("one", result));
- g_assert (tracker_string_in_gslist ("two", result));
- g_assert (tracker_string_in_gslist ("three", result));
- g_assert (tracker_string_in_gslist ("four", result));
+ g_assert_true (tracker_string_in_gslist ("one", result));
+ g_assert_true (tracker_string_in_gslist ("two", result));
+ g_assert_true (tracker_string_in_gslist ("three", result));
+ g_assert_true (tracker_string_in_gslist ("four", result));
g_slist_foreach (result, (GFunc)g_free, NULL);
g_slist_free (result);
result = tracker_string_list_to_gslist ((gchar **)input, 2);
- g_assert (result);
+ g_assert_true (result);
g_assert_cmpint (g_slist_length (result), ==, 2);
- g_assert (tracker_string_in_gslist ("one", result));
- g_assert (tracker_string_in_gslist ("two", result));
- g_assert (!tracker_string_in_gslist ("three", result));
- g_assert (!tracker_string_in_gslist ("four", result));
+ g_assert_true (tracker_string_in_gslist ("one", result));
+ g_assert_true (tracker_string_in_gslist ("two", result));
+ g_assert_true (!tracker_string_in_gslist ("three", result));
+ g_assert_true (!tracker_string_in_gslist ("four", result));
}
static void
@@ -159,23 +159,23 @@ test_gslist_with_string_data_equal (void)
list1 = g_slist_prepend (list1, g_strdup ("two"));
list1 = g_slist_prepend (list1, g_strdup ("three"));
- g_assert (tracker_gslist_with_string_data_equal (list1, list1));
+ g_assert_true (tracker_gslist_with_string_data_equal (list1, list1));
shorty = g_slist_prepend (shorty, g_strdup ("one"));
- g_assert (!tracker_gslist_with_string_data_equal (list1, shorty));
- g_assert (!tracker_gslist_with_string_data_equal (shorty, list1));
+ g_assert_true (!tracker_gslist_with_string_data_equal (list1, shorty));
+ g_assert_true (!tracker_gslist_with_string_data_equal (shorty, list1));
list2 = g_slist_prepend (list2, g_strdup ("one"));
list2 = g_slist_prepend (list2, g_strdup ("two"));
list2 = g_slist_prepend (list2, g_strdup ("three"));
- g_assert (tracker_gslist_with_string_data_equal (list1, list2));
- g_assert (tracker_gslist_with_string_data_equal (list2, list1));
+ g_assert_true (tracker_gslist_with_string_data_equal (list1, list2));
+ g_assert_true (tracker_gslist_with_string_data_equal (list2, list1));
list3 = g_slist_prepend (list3, g_strdup ("one"));
list3 = g_slist_prepend (list3, g_strdup ("something different"));
list3 = g_slist_prepend (list3, g_strdup ("three"));
- g_assert (!tracker_gslist_with_string_data_equal (list1, list3));
- g_assert (!tracker_gslist_with_string_data_equal (list3, list1));
+ g_assert_true (!tracker_gslist_with_string_data_equal (list1, list3));
+ g_assert_true (!tracker_gslist_with_string_data_equal (list3, list1));
g_slist_foreach (list1, (GFunc)g_free, NULL);
g_slist_foreach (list2, (GFunc)g_free, NULL);
diff --git a/tests/libtracker-common/tracker-utils-test.c b/tests/libtracker-common/tracker-utils-test.c
index 8025af8c7..c98b45083 100644
--- a/tests/libtracker-common/tracker-utils-test.c
+++ b/tests/libtracker-common/tracker-utils-test.c
@@ -78,22 +78,22 @@ test_seconds_estimate_to_string ()
static void
test_is_empty_string ()
{
- g_assert (tracker_is_empty_string (NULL));
- g_assert (tracker_is_empty_string (""));
- g_assert (!tracker_is_empty_string ("Eeeeepa not empty"));
+ g_assert_true (tracker_is_empty_string (NULL));
+ g_assert_true (tracker_is_empty_string (""));
+ g_assert_true (!tracker_is_empty_string ("Eeeeepa not empty"));
}
static void
test_is_blank_string ()
{
- g_assert (tracker_is_blank_string (NULL));
- g_assert (tracker_is_blank_string (""));
- g_assert (tracker_is_blank_string (" "));
- g_assert (tracker_is_blank_string (" "));
- g_assert (!tracker_is_blank_string (" - "));
- g_assert (!tracker_is_blank_string (" -"));
- g_assert (!tracker_is_blank_string ("- "));
- g_assert (!tracker_is_blank_string ("nonono"));
+ g_assert_true (tracker_is_blank_string (NULL));
+ g_assert_true (tracker_is_blank_string (""));
+ g_assert_true (tracker_is_blank_string (" "));
+ g_assert_true (tracker_is_blank_string (" "));
+ g_assert_true (!tracker_is_blank_string (" - "));
+ g_assert_true (!tracker_is_blank_string (" -"));
+ g_assert_true (!tracker_is_blank_string ("- "));
+ g_assert_true (!tracker_is_blank_string ("nonono"));
}
diff --git a/tests/libtracker-data/tracker-service-test.c b/tests/libtracker-data/tracker-service-test.c
index f310adfb3..788c6c1ef 100644
--- a/tests/libtracker-data/tracker-service-test.c
+++ b/tests/libtracker-data/tracker-service-test.c
@@ -59,7 +59,7 @@ check_result (TrackerSparqlCursor *cursor,
GError *nerror = NULL;
if (test_info->expect_query_error) {
- g_assert (error != NULL);
+ g_assert_true (error != NULL);
} else {
g_assert_no_error (error);
}
@@ -111,7 +111,7 @@ check_result (TrackerSparqlCursor *cursor,
}
}
} else if (test_info->expect_query_error) {
- g_assert (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
+ g_assert_true (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
g_string_free (test_results, TRUE);
g_free (results);
return;
diff --git a/tests/libtracker-data/tracker-sparql-blank-test.c b/tests/libtracker-data/tracker-sparql-blank-test.c
index bfacf7fa1..7fe67aa4a 100644
--- a/tests/libtracker-data/tracker-sparql-blank-test.c
+++ b/tests/libtracker-data/tracker-sparql-blank-test.c
@@ -66,7 +66,7 @@ test_blank (TestInfo *info,
"INSERT { _:foo a rdfs:Resource . _:bar a rdfs:Resource } ",
&error);
g_assert_no_error (error);
- g_assert (updates != NULL);
+ g_assert_true (updates != NULL);
g_variant_iter_init (&iter, updates);
while ((rows = g_variant_iter_next_value (&iter))) {
@@ -98,15 +98,15 @@ test_blank (TestInfo *info,
g_assert_cmpint (len, ==, 3);
g_assert_cmpstr (solutions[0][0], ==, "foo");
- g_assert (solutions[0][1] != NULL);
+ g_assert_true (solutions[0][1] != NULL);
g_assert_cmpstr (solutions[1][0], ==, "foo");
- g_assert (solutions[1][1] != NULL);
+ g_assert_true (solutions[1][1] != NULL);
g_assert_cmpstr (solutions[0][1], ==, solutions[1][1]);
g_assert_cmpstr (solutions[2][0], ==, "bar");
- g_assert (solutions[2][1] != NULL);
+ g_assert_true (solutions[2][1] != NULL);
g_assert_cmpstr (solutions[2][1], !=, solutions[1][1]);
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index dbda8a03b..b3c49ff8f 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -291,7 +291,7 @@ check_result (TrackerDBCursor *cursor,
GError *nerror = NULL;
if (test_info->expect_query_error) {
- g_assert (error != NULL);
+ g_assert_true (error != NULL);
} else {
g_assert_no_error (error);
}
@@ -343,7 +343,7 @@ check_result (TrackerDBCursor *cursor,
}
}
} else if (test_info->expect_query_error) {
- g_assert (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
+ g_assert_true (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
g_string_free (test_results, TRUE);
g_free (results);
return;
@@ -436,7 +436,7 @@ test_sparql_query (TestInfo *test_info,
tracker_data_update_sparql (data_update, data, &error);
if (test_info->expect_update_error) {
- g_assert (error != NULL);
+ g_assert_true (error != NULL);
g_clear_error (&error);
} else {
g_assert_no_error (error);
diff --git a/tests/libtracker-sparql/tracker-fd-test.c b/tests/libtracker-sparql/tracker-fd-test.c
index 7e801418e..d65e1651a 100644
--- a/tests/libtracker-sparql/tracker-fd-test.c
+++ b/tests/libtracker-sparql/tracker-fd-test.c
@@ -180,8 +180,8 @@ query_and_compare_results (const char *query)
}
/* Check that both cursors are at the end (same number of rows) */
- g_assert (!tracker_sparql_cursor_next (cursor_glib, NULL, NULL));
- g_assert (!tracker_sparql_cursor_next (cursor_fd, NULL, NULL));
+ g_assert_true (!tracker_sparql_cursor_next (cursor_glib, NULL, NULL));
+ g_assert_true (!tracker_sparql_cursor_next (cursor_fd, NULL, NULL));
g_object_unref (cursor_glib);
g_object_unref (cursor_fd);
@@ -213,7 +213,7 @@ test_tracker_sparql_query_iterate_error (DataFixture *fixture,
cursor = tracker_sparql_connection_query (connection, query, NULL, &error);
/* tracker_sparql_query_iterate should return null on error */
- g_assert (!cursor);
+ g_assert_true (!cursor);
/* error should be set, along with its message, note: we don't
* use g_assert_error() because the code does not match the
@@ -221,7 +221,7 @@ test_tracker_sparql_query_iterate_error (DataFixture *fixture,
* dbus/error matching between client/server. This should be
* fixed in gdbus.
*/
- g_assert (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
+ g_assert_true (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
g_error_free (error);
}
@@ -237,7 +237,7 @@ test_tracker_sparql_query_iterate_empty_subprocess (DataFixture *fixture,
cursor = tracker_sparql_connection_query (connection, query, NULL, &error);
- g_assert (tracker_sparql_cursor_next (cursor, NULL, NULL));
+ g_assert_true (tracker_sparql_cursor_next (cursor, NULL, NULL));
/* Testing we fail with this error:
*
@@ -258,13 +258,13 @@ test_tracker_sparql_query_iterate_empty (DataFixture *fixture,
cursor = tracker_sparql_connection_query (connection, query, NULL, &error);
- g_assert (cursor);
+ g_assert_true (cursor);
g_assert_no_error (error);
- g_assert (!tracker_sparql_cursor_next (cursor, NULL, NULL));
+ g_assert_true (!tracker_sparql_cursor_next (cursor, NULL, NULL));
/* This should be 1, the original test had it wrong: there's one column,
* no matter if there are no results*/
- g_assert (tracker_sparql_cursor_get_n_columns (cursor) == 1);
+ g_assert_true (tracker_sparql_cursor_get_n_columns (cursor) == 1);
g_test_trap_subprocess ("/steroids/tracker/tracker_sparql_query_iterate_empty/subprocess", 0, 0);
g_test_trap_assert_failed ();
@@ -283,10 +283,10 @@ test_tracker_sparql_query_iterate_sigpipe (DataFixture *fixture,
cursor = tracker_sparql_connection_query (connection, query, NULL, &error);
- g_assert (cursor);
+ g_assert_true (cursor);
g_assert_no_error (error);
- g_assert (tracker_sparql_cursor_next (cursor, NULL, NULL));
+ g_assert_true (tracker_sparql_cursor_next (cursor, NULL, NULL));
g_object_unref (cursor);
}
@@ -336,7 +336,7 @@ async_update_array_callback (GObject *source_object,
tracker_sparql_connection_update_array_finish (connection, result, &error);
/* main error is only set on fatal (D-Bus) errors that apply to the whole update */
- g_assert (error != NULL);
+ g_assert_true (error != NULL);
g_main_loop_quit (data->main_loop);
}
@@ -385,7 +385,7 @@ test_tracker_sparql_update_fast_error (DataFixture *fixture,
tracker_sparql_connection_update (connection, query, NULL, &error);
- g_assert (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
+ g_assert_true (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
g_error_free (error);
}
@@ -400,7 +400,7 @@ test_tracker_sparql_update_blank_fast_small (DataFixture *fixture,
results = tracker_sparql_connection_update_blank (connection, query, NULL, &error);
g_assert_no_error (error);
- g_assert (results);
+ g_assert_true (results);
/* FIXME: Properly test once we get update_blank implemented */
}
@@ -426,7 +426,7 @@ test_tracker_sparql_update_blank_fast_large (DataFixture *fixture,
g_free (query);
g_assert_no_error (error);
- g_assert (results);
+ g_assert_true (results);
/* FIXME: Properly test once we get update_blank implemented */
}
@@ -441,8 +441,8 @@ test_tracker_sparql_update_blank_fast_error (DataFixture *fixture,
results = tracker_sparql_connection_update_blank (connection, query, NULL, &error);
- g_assert (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
- g_assert (!results);
+ g_assert_true (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
+ g_assert_true (!results);
g_error_free (error);
}
@@ -460,7 +460,7 @@ test_tracker_sparql_update_blank_fast_no_blanks (DataFixture *fixture,
/* FIXME: Properly test once we get update_blank implemented */
g_assert_no_error (error);
- g_assert (results);
+ g_assert_true (results);
}
static void
@@ -473,7 +473,7 @@ test_tracker_batch_sparql_update_fast (DataFixture *fixture,
/* FIXME: batch update is missing so far
* tracker_sparql_connection_batch_update (connection, query, NULL, &error); */
- /* g_assert (!error); */
+ /* g_assert_true (!error); */
}
static void
@@ -491,12 +491,12 @@ async_query_cb (GObject *source_object,
cursor_fd = tracker_sparql_connection_query_finish (connection, result, &error);
g_assert_no_error (error);
- g_assert (cursor_fd != NULL);
+ g_assert_true (cursor_fd != NULL);
cursor_glib = tracker_sparql_connection_query (connection, data->query, NULL, &error);
g_assert_no_error (error);
- g_assert (cursor_glib != NULL);
+ g_assert_true (cursor_glib != NULL);
while (tracker_sparql_cursor_next (cursor_fd, NULL, NULL) &&
tracker_sparql_cursor_next (cursor_glib, NULL, NULL)) {
@@ -505,8 +505,8 @@ async_query_cb (GObject *source_object,
tracker_sparql_cursor_get_string (cursor_glib, 0, NULL));
}
- g_assert (!tracker_sparql_cursor_next (cursor_fd, NULL, NULL));
- g_assert (!tracker_sparql_cursor_next (cursor_glib, NULL, NULL));
+ g_assert_true (!tracker_sparql_cursor_next (cursor_fd, NULL, NULL));
+ g_assert_true (!tracker_sparql_cursor_next (cursor_glib, NULL, NULL));
g_object_unref (cursor_fd);
g_object_unref (cursor_glib);
@@ -551,7 +551,7 @@ cancel_query_cb (GObject *source_object,
tracker_sparql_connection_query_finish (connection, result, &error);
/* An error should be returned (cancelled!) */
- g_assert (error);
+ g_assert_true (error);
}
static void
@@ -630,7 +630,7 @@ cancel_update_cb (GObject *source_object,
tracker_sparql_connection_update_finish (connection, result, &error);
/* An error should be returned (cancelled!) */
- g_assert (error);
+ g_assert_true (error);
}
static void
@@ -669,7 +669,7 @@ async_update_blank_callback (GObject *source_object,
results = tracker_sparql_connection_update_blank_finish (connection, result, &error);
g_assert_no_error (error);
- g_assert (results != NULL);
+ g_assert_true (results != NULL);
}
static void
diff --git a/tests/libtracker-sparql/tracker-resource-test.c b/tests/libtracker-sparql/tracker-resource-test.c
index 0506c0771..068b1c2fc 100644
--- a/tests/libtracker-sparql/tracker-resource-test.c
+++ b/tests/libtracker-sparql/tracker-resource-test.c
@@ -30,13 +30,13 @@ test_resource_get_empty (void)
resource = tracker_resource_new ("http://example.com/resource");
- g_assert (tracker_resource_get_values (resource, "http://example.com/0") == NULL);
+ g_assert_true (tracker_resource_get_values (resource, "http://example.com/0") == NULL);
- g_assert (tracker_resource_get_first_double (resource, "http://example.com/0") == 0.0);
- g_assert (tracker_resource_get_first_int (resource, "http://example.com/0") == 0);
- g_assert (tracker_resource_get_first_int64 (resource, "http://example.com/0") == 0);
- g_assert (tracker_resource_get_first_string (resource, "http://example.com/0") == NULL);
- g_assert (tracker_resource_get_first_uri (resource, "http://example.com/0") == NULL);
+ g_assert_true (tracker_resource_get_first_double (resource, "http://example.com/0") == 0.0);
+ g_assert_true (tracker_resource_get_first_int (resource, "http://example.com/0") == 0);
+ g_assert_true (tracker_resource_get_first_int64 (resource, "http://example.com/0") == 0);
+ g_assert_true (tracker_resource_get_first_string (resource, "http://example.com/0") == NULL);
+ g_assert_true (tracker_resource_get_first_uri (resource, "http://example.com/0") == NULL);
g_object_unref (resource);
}
@@ -54,9 +54,9 @@ test_resource_get_set_simple (void)
tracker_resource_set_string (resource, "http://example.com/4", "Hello");
tracker_resource_set_uri (resource, "http://example.com/5", "http://example.com/");
- g_assert (tracker_resource_get_first_double (resource, "http://example.com/1") == 0.6);
+ g_assert_true (tracker_resource_get_first_double (resource, "http://example.com/1") == 0.6);
g_assert_cmpint (tracker_resource_get_first_int (resource, "http://example.com/2"), ==, 60);
- g_assert (tracker_resource_get_first_int64 (resource, "http://example.com/3") == 123456789);
+ g_assert_true (tracker_resource_get_first_int64 (resource, "http://example.com/3") == 123456789);
g_assert_cmpstr (tracker_resource_get_first_string (resource, "http://example.com/4"), ==, "Hello");
g_assert_cmpstr (tracker_resource_get_first_uri (resource, "http://example.com/5"), ==, "http://example.com/");
@@ -119,7 +119,7 @@ test_resource_get_set_many (void)
g_assert_cmpint (g_value_get_int (list->data), ==, 60);
g_assert_cmpstr (g_value_get_string (list->next->data), ==, "Hello");
- g_assert (G_VALUE_HOLDS (list->next->next->data, RANDOM_GVALUE_TYPE));
+ g_assert_true (G_VALUE_HOLDS (list->next->next->data, RANDOM_GVALUE_TYPE));
g_list_free_full (list, (GDestroyNotify) g_value_unset);
diff --git a/tests/libtracker-sparql/tracker-sparql-test.c b/tests/libtracker-sparql/tracker-sparql-test.c
index 0079cd18a..ec831cb12 100644
--- a/tests/libtracker-sparql/tracker-sparql-test.c
+++ b/tests/libtracker-sparql/tracker-sparql-test.c
@@ -119,7 +119,7 @@ test_tracker_sparql_cursor_next_async_cb (GObject *source,
query = GPOINTER_TO_INT(user_data);
- g_assert (result != NULL);
+ g_assert_true (result != NULL);
success = tracker_sparql_cursor_next_finish (TRACKER_SPARQL_CURSOR (source),
result,
&error);
@@ -132,7 +132,7 @@ test_tracker_sparql_cursor_next_async_cb (GObject *source,
}
cursor = TRACKER_SPARQL_CURSOR (source);
- g_assert (cursor != NULL);
+ g_assert_true (cursor != NULL);
connection = tracker_sparql_cursor_get_connection (cursor);
if (!success) {
@@ -173,18 +173,18 @@ test_tracker_sparql_cursor_next_async_query (TrackerSparqlConnection *connection
TrackerSparqlCursor *cursor;
GError *error = NULL;
- g_assert (query < G_N_ELEMENTS (queries));
+ g_assert_true (query < G_N_ELEMENTS (queries));
g_print ("ASYNC query %d starting:\n", query);
cancellables[query] = g_cancellable_new ();
- g_assert (cancellables[query] != NULL);
+ g_assert_true (cancellables[query] != NULL);
cursor = tracker_sparql_connection_query (connection,
queries[query],
NULL,
&error);
g_assert_no_error (error);
- g_assert (cursor != NULL);
+ g_assert_true (cursor != NULL);
tracker_sparql_cursor_next_async (cursor,
cancellables[query],
@@ -208,7 +208,7 @@ test_tracker_sparql_cursor_next_async (void)
connection = create_local_connection (&error);
g_assert_no_error (error);
- g_assert (connection != NULL);
+ g_assert_true (connection != NULL);
test_tracker_sparql_cursor_next_async_query (connection, 0);
g_main_loop_run (main_loop);