[tepl] testsuite: replace g_assert() calls by g_assert_true()



commit d7114490a1f7b684b7118cded3480f2f7f082f0c
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Nov 3 19:06:00 2019 +0100

    testsuite: replace g_assert() calls by g_assert_true()
    
    See the documentation of those functions.
    
    Done with:
    ls *.c | parallel gcu-lineup-substitution 'g_assert\ ' 'g_assert_true\ '
    
    See https://github.com/swilmet/gnome-c-utils for the
    gcu-lineup-substitution utility.
    
    Thanks to Tomasz Kłoczko for the bug report.
    
    Fixes https://gitlab.gnome.org/GNOME/tepl/issues/14

 testsuite/test-buffer-input-stream.c |  2 +-
 testsuite/test-encoding-converter.c  |  8 +++---
 testsuite/test-encoding.c            |  8 +++---
 testsuite/test-file-content.c        |  2 +-
 testsuite/test-file-loader.c         | 46 +++++++++++++++---------------
 testsuite/test-file-metadata.c       | 50 ++++++++++++++++-----------------
 testsuite/test-file.c                | 50 ++++++++++++++++-----------------
 testsuite/test-fold-region.c         | 54 ++++++++++++++++++------------------
 testsuite/test-notebook.c            | 36 ++++++++++++------------
 testsuite/test-utils.c               |  4 +--
 10 files changed, 130 insertions(+), 130 deletions(-)
---
diff --git a/testsuite/test-buffer-input-stream.c b/testsuite/test-buffer-input-stream.c
index 6d4a46f..e9f61ae 100644
--- a/testsuite/test-buffer-input-stream.c
+++ b/testsuite/test-buffer-input-stream.c
@@ -60,7 +60,7 @@ test_consecutive_read (const gchar     *inbuf,
        g_assert_cmpstr (b, ==, outbuf);
 
        close = g_input_stream_close (G_INPUT_STREAM (in), NULL, &err);
-       g_assert (close);
+       g_assert_true (close);
        g_assert_no_error (err);
 
        g_object_unref (buf);
diff --git a/testsuite/test-encoding-converter.c b/testsuite/test-encoding-converter.c
index 288e08a..f9eaca2 100644
--- a/testsuite/test-encoding-converter.c
+++ b/testsuite/test-encoding-converter.c
@@ -47,8 +47,8 @@ compare_outputs (GQueue *received_output,
                g_assert_cmpstr (received_chunk, ==, expected_chunk);
        }
 
-       g_assert (received_node == NULL);
-       g_assert (expected_node == NULL);
+       g_assert_true (received_node == NULL);
+       g_assert_true (expected_node == NULL);
 }
 
 static void
@@ -290,7 +290,7 @@ test_invalid_sequence (void)
                                       -1,
                                       &error);
 
-       g_assert (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE));
+       g_assert_true (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE));
        g_clear_error (&error);
 
        _tepl_encoding_converter_close (converter, &error);
@@ -315,7 +315,7 @@ test_end_with_incomplete_input (void)
        g_assert_no_error (error);
 
        _tepl_encoding_converter_close (converter, &error);
-       g_assert (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT));
+       g_assert_true (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT));
        g_clear_error (&error);
 
        g_object_unref (converter);
diff --git a/testsuite/test-encoding.c b/testsuite/test-encoding.c
index d9d34c9..4d586ae 100644
--- a/testsuite/test-encoding.c
+++ b/testsuite/test-encoding.c
@@ -39,8 +39,8 @@ test_remove_duplicates (void)
        list = _tepl_encoding_remove_duplicates (list, TEPL_ENCODING_DUPLICATES_KEEP_FIRST);
 
        g_assert_cmpint (2, ==, g_slist_length (list));
-       g_assert (tepl_encoding_equals (list->data, utf8));
-       g_assert (tepl_encoding_equals (list->next->data, iso));
+       g_assert_true (tepl_encoding_equals (list->data, utf8));
+       g_assert_true (tepl_encoding_equals (list->next->data, iso));
 
        /* Before: [UTF-8, ISO-8859-15, UTF-8] */
        list = g_slist_append (list, tepl_encoding_copy (utf8));
@@ -49,8 +49,8 @@ test_remove_duplicates (void)
        list = _tepl_encoding_remove_duplicates (list, TEPL_ENCODING_DUPLICATES_KEEP_LAST);
 
        g_assert_cmpint (2, ==, g_slist_length (list));
-       g_assert (tepl_encoding_equals (list->data, iso));
-       g_assert (tepl_encoding_equals (list->next->data, utf8));
+       g_assert_true (tepl_encoding_equals (list->data, iso));
+       g_assert_true (tepl_encoding_equals (list->next->data, utf8));
 
        g_slist_free_full (list, (GDestroyNotify)tepl_encoding_free);
        tepl_encoding_free (utf8);
diff --git a/testsuite/test-file-content.c b/testsuite/test-file-content.c
index db5e76d..9ecf1e3 100644
--- a/testsuite/test-file-content.c
+++ b/testsuite/test-file-content.c
@@ -50,7 +50,7 @@ check_determine_encoding_fallback (GSList       *candidate_encodings,
        detected_encoding = _tepl_file_content_determine_encoding_with_fallback_mode (content,
                                                                                      candidate_encodings);
 
-       g_assert (tepl_encoding_equals (detected_encoding, expected_encoding));
+       g_assert_true (tepl_encoding_equals (detected_encoding, expected_encoding));
 
        g_object_unref (content);
        tepl_encoding_free (detected_encoding);
diff --git a/testsuite/test-file-loader.c b/testsuite/test-file-loader.c
index c996c0d..41e9cfa 100644
--- a/testsuite/test-file-loader.c
+++ b/testsuite/test-file-loader.c
@@ -54,7 +54,7 @@ test_data_new (const gchar     *expected_buffer_content,
 {
        TestData *data;
 
-       g_assert (expected_buffer_content != NULL);
+       g_assert_true (expected_buffer_content != NULL);
 
        data = g_new0 (TestData, 1);
        data->expected_buffer_content = g_strdup (expected_buffer_content);
@@ -137,7 +137,7 @@ check_buffer_state (GtkTextBuffer *buffer)
        g_assert_cmpint (offset, ==, 0);
 
        modified = gtk_text_buffer_get_modified (buffer);
-       g_assert (!modified);
+       g_assert_true (!modified);
 }
 
 static void
@@ -181,8 +181,8 @@ load_cb (GObject      *source_object,
                g_assert_cmpint (tepl_file_get_compression_type (file), ==, TEPL_COMPRESSION_TYPE_NONE);
                g_assert_cmpint (tepl_file_loader_get_newline_type (loader), ==, data->expected_newline_type);
                g_assert_cmpint (tepl_file_get_newline_type (file), ==, data->expected_newline_type);
-               g_assert (!tepl_file_is_externally_modified (file));
-               g_assert (!tepl_file_is_deleted (file));
+               g_assert_true (!tepl_file_is_externally_modified (file));
+               g_assert_true (!tepl_file_is_deleted (file));
 
                if (data->expected_line_count != -1)
                {
@@ -200,9 +200,9 @@ load_cb (GObject      *source_object,
        }
        else
        {
-               g_assert (g_error_matches (error,
-                                          data->expected_error_domain,
-                                          data->expected_error_code));
+               g_assert_true (g_error_matches (error,
+                                               data->expected_error_domain,
+                                               data->expected_error_code));
                g_clear_error (&error);
        }
 
@@ -359,8 +359,8 @@ test_split_cr_lf (void)
        test_loader_split_cr_lf (content, expected_line_count);
 
        /* End block size by \r */
-       g_assert (content[block_size - 1] != '\n');
-       g_assert (content[block_size] == '\0');
+       g_assert_true (content[block_size - 1] != '\n');
+       g_assert_true (content[block_size] == '\0');
        content[block_size - 1] = '\r';
        expected_line_count++;
        test_loader_split_cr_lf (content, expected_line_count);
@@ -370,9 +370,9 @@ test_split_cr_lf (void)
         * Start of block 2: a
         */
        content = generate_content (block_size + 1, &expected_line_count);
-       g_assert (content[block_size - 1] != '\n');
-       g_assert (content[block_size] == 'a');
-       g_assert (content[block_size + 1] == '\0');
+       g_assert_true (content[block_size - 1] != '\n');
+       g_assert_true (content[block_size] == 'a');
+       g_assert_true (content[block_size + 1] == '\0');
        content[block_size - 1] = '\r';
        expected_line_count++;
        test_loader_split_cr_lf (content, expected_line_count);
@@ -381,9 +381,9 @@ test_split_cr_lf (void)
         * End of block 1: \r
         * Start of block 2: \n
         */
-       g_assert (content[block_size - 1] == '\r');
-       g_assert (content[block_size] == 'a');
-       g_assert (content[block_size + 1] == '\0');
+       g_assert_true (content[block_size - 1] == '\r');
+       g_assert_true (content[block_size] == 'a');
+       g_assert_true (content[block_size + 1] == '\0');
        content[block_size] = '\n';
        test_loader_split_cr_lf (content, expected_line_count);
        g_free (content);
@@ -393,10 +393,10 @@ test_split_cr_lf (void)
         * Start of block 2: \na
         */
        content = generate_content (block_size + 2, &expected_line_count);
-       g_assert (content[block_size - 1] != '\n');
-       g_assert (content[block_size] != '\n');
-       g_assert (content[block_size + 1] == 'a');
-       g_assert (content[block_size + 2] == '\0');
+       g_assert_true (content[block_size - 1] != '\n');
+       g_assert_true (content[block_size] != '\n');
+       g_assert_true (content[block_size + 1] == 'a');
+       g_assert_true (content[block_size + 2] == '\0');
        content[block_size - 1] = '\r';
        content[block_size] = '\n';
        expected_line_count++;
@@ -410,14 +410,14 @@ test_split_cr_lf (void)
         */
        content = generate_content (block_size * 2, &expected_line_count);
 
-       g_assert (content[block_size - 1] != '\n');
-       g_assert (content[block_size] != '\n');
+       g_assert_true (content[block_size - 1] != '\n');
+       g_assert_true (content[block_size] != '\n');
        content[block_size - 1] = '\r';
        content[block_size] = '\n';
        expected_line_count++;
 
-       g_assert (content[block_size*2 - 1] != '\n');
-       g_assert (content[block_size*2] == '\0');
+       g_assert_true (content[block_size*2 - 1] != '\n');
+       g_assert_true (content[block_size*2] == '\0');
        content[block_size*2 - 1] = '\r';
        expected_line_count++;
 
diff --git a/testsuite/test-file-metadata.c b/testsuite/test-file-metadata.c
index ae9f1eb..6d99170 100644
--- a/testsuite/test-file-metadata.c
+++ b/testsuite/test-file-metadata.c
@@ -77,7 +77,7 @@ do_test_get_set_metadata (gboolean use_gvfs_metadata)
        metadata = tepl_file_get_file_metadata (file);
 
        value = tepl_file_metadata_get (metadata, TEST_KEY);
-       g_assert (value == NULL);
+       g_assert_true (value == NULL);
 
        tepl_file_metadata_set (metadata, TEST_KEY, "zippy");
        value = tepl_file_metadata_get (metadata, TEST_KEY);
@@ -85,7 +85,7 @@ do_test_get_set_metadata (gboolean use_gvfs_metadata)
        g_free (value);
 
        value = tepl_file_metadata_get (metadata, TEST_OTHER_KEY);
-       g_assert (value == NULL);
+       g_assert_true (value == NULL);
 
        tepl_file_metadata_set (metadata, TEST_KEY, "zippiness");
        value = tepl_file_metadata_get (metadata, TEST_KEY);
@@ -95,12 +95,12 @@ do_test_get_set_metadata (gboolean use_gvfs_metadata)
        /* Unset */
        tepl_file_metadata_set (metadata, TEST_KEY, NULL);
        value = tepl_file_metadata_get (metadata, TEST_KEY);
-       g_assert (value == NULL);
+       g_assert_true (value == NULL);
 
        /* Unset non-set metadata */
        tepl_file_metadata_set (metadata, TEST_OTHER_KEY, NULL);
        value = tepl_file_metadata_get (metadata, TEST_OTHER_KEY);
-       g_assert (value == NULL);
+       g_assert_true (value == NULL);
 
        g_object_unref (file);
 }
@@ -134,11 +134,11 @@ do_test_load_save_metadata_sync (gboolean use_gvfs_metadata)
 
        ok = tepl_file_metadata_load (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (!ok);
+       g_assert_true (!ok);
 
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (!ok);
+       g_assert_true (!ok);
 
        value = tepl_file_metadata_get (metadata, TEST_KEY);
        g_assert_cmpstr (value, ==, "epica");
@@ -154,14 +154,14 @@ do_test_load_save_metadata_sync (gboolean use_gvfs_metadata)
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        if (use_gvfs_metadata)
        {
-               g_assert (error != NULL); /* No such file or directory */
+               g_assert_true (error != NULL); /* No such file or directory */
                g_clear_error (&error);
-               g_assert (!ok);
+               g_assert_true (!ok);
        }
        else
        {
                g_assert_no_error (error);
-               g_assert (ok);
+               g_assert_true (ok);
        }
 
        g_file_set_contents (path, "blum", -1, &error);
@@ -169,7 +169,7 @@ do_test_load_save_metadata_sync (gboolean use_gvfs_metadata)
 
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        g_object_unref (file);
 
@@ -183,10 +183,10 @@ do_test_load_save_metadata_sync (gboolean use_gvfs_metadata)
 
        ok = tepl_file_metadata_load (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        value = tepl_file_metadata_get (metadata, TEST_OTHER_KEY);
-       g_assert (value == NULL);
+       g_assert_true (value == NULL);
 
        value = tepl_file_metadata_get (metadata, TEST_KEY);
        g_assert_cmpstr (value, ==, "epica");
@@ -197,14 +197,14 @@ do_test_load_save_metadata_sync (gboolean use_gvfs_metadata)
        tepl_file_metadata_set (metadata, TEST_KEY, NULL);
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        ok = tepl_file_metadata_load (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        value = tepl_file_metadata_get (metadata, TEST_KEY);
-       g_assert (value == NULL);
+       g_assert_true (value == NULL);
 
        /* Clean-up */
 
@@ -214,14 +214,14 @@ do_test_load_save_metadata_sync (gboolean use_gvfs_metadata)
        ok = tepl_file_metadata_load (metadata, NULL, &error);
        if (use_gvfs_metadata)
        {
-               g_assert (error != NULL); /* No such file or directory */
+               g_assert_true (error != NULL); /* No such file or directory */
                g_clear_error (&error);
-               g_assert (!ok);
+               g_assert_true (!ok);
        }
        else
        {
                g_assert_no_error (error);
-               g_assert (ok);
+               g_assert_true (ok);
        }
 
        g_free (path);
@@ -254,7 +254,7 @@ load_metadata_async_cb (GObject      *source_object,
 
        ok = tepl_file_metadata_load_finish (metadata, result, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        value = tepl_file_metadata_get (metadata, TEST_KEY);
        g_assert_cmpstr (value, ==, "in flames");
@@ -265,7 +265,7 @@ load_metadata_async_cb (GObject      *source_object,
        tepl_file_metadata_set (metadata, TEST_KEY, NULL);
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        location = tepl_file_get_location (file);
        g_file_delete (location, NULL, &error);
@@ -286,7 +286,7 @@ save_metadata_async_cb (GObject      *source_object,
 
        ok = tepl_file_metadata_save_finish (metadata, result, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        tepl_file_metadata_set (metadata, TEST_KEY, NULL);
 
@@ -367,7 +367,7 @@ do_test_set_without_load (gboolean use_gvfs_metadata)
        tepl_file_metadata_set (metadata, TEST_KEY, "dimmu");
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        g_object_unref (file);
 
@@ -378,12 +378,12 @@ do_test_set_without_load (gboolean use_gvfs_metadata)
        tepl_file_metadata_set (metadata, TEST_OTHER_KEY, "borgir");
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        /* Load */
        ok = tepl_file_metadata_load (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        /* Check that the two metadata are present */
        value = tepl_file_metadata_get (metadata, TEST_KEY);
@@ -399,7 +399,7 @@ do_test_set_without_load (gboolean use_gvfs_metadata)
        tepl_file_metadata_set (metadata, TEST_OTHER_KEY, NULL);
        ok = tepl_file_metadata_save (metadata, NULL, &error);
        g_assert_no_error (error);
-       g_assert (ok);
+       g_assert_true (ok);
 
        g_file_delete (location, NULL, &error);
        g_assert_no_error (error);
diff --git a/testsuite/test-file.c b/testsuite/test-file.c
index 31edfdf..a7c88f1 100644
--- a/testsuite/test-file.c
+++ b/testsuite/test-file.c
@@ -66,9 +66,9 @@ save_cb (GObject      *source_object,
        tepl_file_saver_save_finish (saver, result, &error);
        if (expect_externally_modified_error)
        {
-               g_assert (g_error_matches (error,
-                                          TEPL_FILE_SAVER_ERROR,
-                                          TEPL_FILE_SAVER_ERROR_EXTERNALLY_MODIFIED));
+               g_assert_true (g_error_matches (error,
+                                               TEPL_FILE_SAVER_ERROR,
+                                               TEPL_FILE_SAVER_ERROR_EXTERNALLY_MODIFIED));
                g_clear_error (&error);
        }
        else
@@ -153,9 +153,9 @@ test_externally_modified (void)
        file = tepl_buffer_get_file (buffer);
 
        /* With NULL location */
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Set location, but not yet loaded or saved */
        path = g_build_filename (g_get_tmp_dir (), "tepl-test-file", NULL);
@@ -164,21 +164,21 @@ test_externally_modified (void)
 
        location = g_file_new_for_path (path);
        tepl_file_set_location (file, location);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Load */
        load (buffer);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Save */
        save (buffer, FALSE);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Modify externally and then save.
         * Sleep one second to force the timestamp/etag to change.
@@ -187,31 +187,31 @@ test_externally_modified (void)
        g_file_set_contents (path, "b", -1, &error);
        g_assert_no_error (error);
        tepl_file_check_file_on_disk (file);
-       g_assert (tepl_file_is_externally_modified (file));
+       g_assert_true (tepl_file_is_externally_modified (file));
 
        save (buffer, TRUE);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Modify externally and then load */
        sleep (1);
        g_file_set_contents (path, "c", -1, &error);
        g_assert_no_error (error);
        tepl_file_check_file_on_disk (file);
-       g_assert (tepl_file_is_externally_modified (file));
+       g_assert_true (tepl_file_is_externally_modified (file));
 
        load (buffer);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Modify externally and then save as */
        sleep (1);
        g_file_set_contents (path, "d", -1, &error);
        g_assert_no_error (error);
        tepl_file_check_file_on_disk (file);
-       g_assert (tepl_file_is_externally_modified (file));
+       g_assert_true (tepl_file_is_externally_modified (file));
 
        new_path = g_build_filename (g_get_tmp_dir (), "tepl-test-file-2", NULL);
        g_file_set_contents (new_path, "e", -1, &error);
@@ -219,23 +219,23 @@ test_externally_modified (void)
 
        new_location = g_file_new_for_path (new_path);
        save_as (buffer, new_location);
-       g_assert (g_file_equal (new_location, tepl_file_get_location (file)));
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (g_file_equal (new_location, tepl_file_get_location (file)));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Modify externally and then save as to same location */
        sleep (1);
        g_file_set_contents (new_path, "f", -1, &error);
        g_assert_no_error (error);
        tepl_file_check_file_on_disk (file);
-       g_assert (tepl_file_is_externally_modified (file));
+       g_assert_true (tepl_file_is_externally_modified (file));
 
-       g_assert (g_file_equal (new_location, tepl_file_get_location (file)));
+       g_assert_true (g_file_equal (new_location, tepl_file_get_location (file)));
        save_as (buffer, new_location);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
        tepl_file_check_file_on_disk (file);
-       g_assert (!tepl_file_is_externally_modified (file));
+       g_assert_true (!tepl_file_is_externally_modified (file));
 
        /* Cleanup */
        g_file_delete (location, NULL, &error);
diff --git a/testsuite/test-fold-region.c b/testsuite/test-fold-region.c
index 928b6cc..d61bf32 100644
--- a/testsuite/test-fold-region.c
+++ b/testsuite/test-fold-region.c
@@ -88,7 +88,7 @@ test_fold (void)
        fold_region = test_create_fold_region (buffer, 1, 3);
        tepl_fold_region_set_folded (fold_region, TRUE);
 
-       g_assert (test_next_visible_line (buffer, 1) == 4);
+       g_assert_true (test_next_visible_line (buffer, 1) == 4);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -106,7 +106,7 @@ test_unfold (void)
        tepl_fold_region_set_folded (fold_region, TRUE);
        tepl_fold_region_set_folded (fold_region, FALSE);
 
-       g_assert (test_next_visible_line (buffer, 1) == 2);
+       g_assert_true (test_next_visible_line (buffer, 1) == 2);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -124,17 +124,17 @@ test_toggle (void)
        fold_region = test_create_fold_region (buffer, 1, 3);
 
        folded = tepl_fold_region_get_folded (fold_region);
-       g_assert (folded == FALSE);
+       g_assert_true (folded == FALSE);
 
        folded = !folded;
        tepl_fold_region_set_folded (fold_region, folded);
        folded = tepl_fold_region_get_folded (fold_region);
-       g_assert (folded == TRUE);
+       g_assert_true (folded == TRUE);
 
        folded = !folded;
        tepl_fold_region_set_folded (fold_region, folded);
        folded = tepl_fold_region_get_folded (fold_region);
-       g_assert (folded == FALSE);
+       g_assert_true (folded == FALSE);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -152,8 +152,8 @@ test_set_bounds (void)
        test_set_bounds_with_line_number (fold_region, 2, 4);
        tepl_fold_region_set_folded (fold_region, TRUE);
 
-       g_assert (test_next_visible_line (buffer, 1) == 2);
-       g_assert (test_next_visible_line (buffer, 2) == 5);
+       g_assert_true (test_next_visible_line (buffer, 1) == 2);
+       g_assert_true (test_next_visible_line (buffer, 2) == 5);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -171,8 +171,8 @@ test_set_bounds_while_folded (void)
        tepl_fold_region_set_folded (fold_region, TRUE);
        test_set_bounds_with_line_number (fold_region, 2, 4);
 
-       g_assert (test_next_visible_line (buffer, 1) == 2);
-       g_assert (test_next_visible_line (buffer, 2) == 5);
+       g_assert_true (test_next_visible_line (buffer, 1) == 2);
+       g_assert_true (test_next_visible_line (buffer, 2) == 5);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -197,7 +197,7 @@ test_get_bounds (void)
        start_line = gtk_text_iter_get_line (&start_iter);
        end_line = gtk_text_iter_get_line (&end_iter);
 
-       g_assert (test_next_visible_line (buffer, start_line) == end_line + 1);
+       g_assert_true (test_next_visible_line (buffer, start_line) == end_line + 1);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -215,7 +215,7 @@ test_unref_while_folded (void)
        tepl_fold_region_set_folded (fold_region, TRUE);
        g_clear_object (&fold_region);
 
-       g_assert (test_next_visible_line (buffer, 1) == 2);
+       g_assert_true (test_next_visible_line (buffer, 1) == 2);
 
        g_object_unref (buffer);
 }
@@ -236,8 +236,8 @@ test_clear_buffer (void)
 
        tepl_fold_region_get_bounds (fold_region, &start_iter, &end_iter);
 
-       g_assert (gtk_text_iter_get_line (&start_iter) == 0);
-       g_assert (gtk_text_iter_get_line (&end_iter) == 0);
+       g_assert_true (gtk_text_iter_get_line (&start_iter) == 0);
+       g_assert_true (gtk_text_iter_get_line (&end_iter) == 0);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -262,7 +262,7 @@ test_bounds_at_middle_of_line (void)
        fold_region = tepl_fold_region_new (buffer, &start_iter, &end_iter);
 
        tepl_fold_region_set_folded (fold_region, TRUE);
-       g_assert (test_next_visible_line (buffer, 1) == 4);
+       g_assert_true (test_next_visible_line (buffer, 1) == 4);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -289,7 +289,7 @@ test_bounds_at_end_of_line (void)
        fold_region = tepl_fold_region_new (buffer, &start_iter, &end_iter);
 
        tepl_fold_region_set_folded (fold_region, TRUE);
-       g_assert (test_next_visible_line (buffer, 1) == 4);
+       g_assert_true (test_next_visible_line (buffer, 1) == 4);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -307,11 +307,11 @@ test_double_fold (void)
        tepl_fold_region_set_folded (fold_region, TRUE);
        tepl_fold_region_set_folded (fold_region, TRUE);
 
-       g_assert (test_next_visible_line (buffer, 1) == 4);
+       g_assert_true (test_next_visible_line (buffer, 1) == 4);
 
        tepl_fold_region_set_folded (fold_region, FALSE);
 
-       g_assert (test_next_visible_line (buffer, 1) == 2);
+       g_assert_true (test_next_visible_line (buffer, 1) == 2);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -330,11 +330,11 @@ test_double_unfold (void)
        tepl_fold_region_set_folded (fold_region, FALSE);
        tepl_fold_region_set_folded (fold_region, FALSE);
 
-       g_assert (test_next_visible_line (buffer, 1) == 2);
+       g_assert_true (test_next_visible_line (buffer, 1) == 2);
 
        tepl_fold_region_set_folded (fold_region, TRUE);
 
-       g_assert (test_next_visible_line (buffer, 1) == 4);
+       g_assert_true (test_next_visible_line (buffer, 1) == 4);
 
        g_object_unref (fold_region);
        g_object_unref (buffer);
@@ -353,30 +353,30 @@ test_overlapping_regions (void)
        fold_region2 = test_create_fold_region (buffer, 2, 4);
 
        tepl_fold_region_set_folded (fold_region1, TRUE);
-       g_assert (test_next_visible_line (buffer, 1) == 4);
+       g_assert_true (test_next_visible_line (buffer, 1) == 4);
        tepl_fold_region_set_folded (fold_region2, TRUE);
-       g_assert (test_next_visible_line (buffer, 1) == 5);
+       g_assert_true (test_next_visible_line (buffer, 1) == 5);
 
        tepl_fold_region_set_folded (fold_region1, FALSE);
        tepl_fold_region_set_folded (fold_region2, FALSE);
 
        tepl_fold_region_set_folded (fold_region2, TRUE);
-       g_assert (test_next_visible_line (buffer, 2) == 5);
+       g_assert_true (test_next_visible_line (buffer, 2) == 5);
        tepl_fold_region_set_folded (fold_region1, TRUE);
-       g_assert (test_next_visible_line (buffer, 1) == 5);
+       g_assert_true (test_next_visible_line (buffer, 1) == 5);
 
        tepl_fold_region_set_folded (fold_region1, FALSE);
-       g_assert (test_next_visible_line (buffer, 2) == 5);
+       g_assert_true (test_next_visible_line (buffer, 2) == 5);
        tepl_fold_region_set_folded (fold_region2, FALSE);
-       g_assert (test_next_visible_line (buffer, 2) == 3);
+       g_assert_true (test_next_visible_line (buffer, 2) == 3);
 
        tepl_fold_region_set_folded (fold_region1, TRUE);
        tepl_fold_region_set_folded (fold_region2, TRUE);
 
        tepl_fold_region_set_folded (fold_region2, FALSE);
-       g_assert (test_next_visible_line (buffer, 1) == 4);
+       g_assert_true (test_next_visible_line (buffer, 1) == 4);
        tepl_fold_region_set_folded (fold_region1, FALSE);
-       g_assert (test_next_visible_line (buffer, 2) == 3);
+       g_assert_true (test_next_visible_line (buffer, 2) == 3);
 
        g_object_unref (fold_region1);
        g_object_unref (fold_region2);
diff --git a/testsuite/test-notebook.c b/testsuite/test-notebook.c
index 8357857..6092c3b 100644
--- a/testsuite/test-notebook.c
+++ b/testsuite/test-notebook.c
@@ -35,11 +35,11 @@ check_list_equal (GList *expected_list,
                gpointer expected_data = l1->data;
                gpointer received_data = l2->data;
 
-               g_assert (expected_data == received_data);
+               g_assert_true (expected_data == received_data);
        }
 
-       g_assert (l1 == NULL);
-       g_assert (l2 == NULL);
+       g_assert_true (l1 == NULL);
+       g_assert_true (l2 == NULL);
 }
 
 static void
@@ -60,8 +60,8 @@ test_tab_group_basic (void)
        gtk_widget_show (GTK_WIDGET (notebook));
 
        /* Empty */
-       g_assert (tepl_tab_group_get_tabs (tab_group) == NULL);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_tabs (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == NULL);
 
        /* One child, but not a TeplTab */
        other_widget = gtk_grid_new ();
@@ -69,8 +69,8 @@ test_tab_group_basic (void)
        gtk_notebook_append_page (notebook, other_widget, NULL);
 
        g_assert_cmpint (gtk_notebook_get_n_pages (notebook), ==, 1);
-       g_assert (tepl_tab_group_get_tabs (tab_group) == NULL);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_tabs (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == NULL);
 
        /* Append one TeplTab */
        tab1 = tepl_tab_new ();
@@ -79,7 +79,7 @@ test_tab_group_basic (void)
        expected_list = g_list_append (NULL, tab1);
 
        g_assert_cmpint (gtk_notebook_get_n_pages (notebook), ==, 2);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == tab1);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == tab1);
 
        received_list = tepl_tab_group_get_tabs (tab_group);
        check_list_equal (expected_list, received_list);
@@ -87,7 +87,7 @@ test_tab_group_basic (void)
        received_list = NULL;
 
        gtk_notebook_set_current_page (notebook, 0);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == NULL);
 
        received_list = tepl_tab_group_get_tabs (tab_group);
        check_list_equal (expected_list, received_list);
@@ -101,13 +101,13 @@ test_tab_group_basic (void)
        expected_list = g_list_append (expected_list, tab2);
 
        gtk_notebook_set_current_page (notebook, gtk_notebook_page_num (notebook, other_widget));
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == NULL);
 
        tepl_tab_group_set_active_tab (tab_group, tab1);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == tab1);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == tab1);
 
        tepl_tab_group_set_active_tab (tab_group, tab2);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == tab2);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == tab2);
 
        received_list = tepl_tab_group_get_tabs (tab_group);
        check_list_equal (expected_list, received_list);
@@ -219,8 +219,8 @@ test_tab_group_notify_signals (void)
        /* Remove tab -> active-tab is NULL. */
        gtk_widget_destroy (GTK_WIDGET (tab1));
        check_notify_delta_counters (&delta_counters, 1, 1);
-       g_assert (tepl_tab_group_get_tabs (tab_group) == NULL);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_tabs (tab_group) == NULL);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == NULL);
 
        /* Re-create first tab. */
        tab1 = tepl_tab_new ();
@@ -256,21 +256,21 @@ test_tab_group_notify_signals (void)
        /* Reorder non-active tab */
        gtk_notebook_reorder_child (notebook, GTK_WIDGET (tab1), 1);
        check_notify_delta_counters (&delta_counters, 0, 0);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == tab2);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == tab2);
 
        /* Reorder active tab.
         * The order is reset to tab1 -> tab2.
         */
        gtk_notebook_reorder_child (notebook, GTK_WIDGET (tab2), 1);
        check_notify_delta_counters (&delta_counters, 0, 0);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == tab2);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == tab2);
 
        /* Append a third tab. */
        tab3 = tepl_tab_new ();
        gtk_widget_show (GTK_WIDGET (tab3));
        tepl_tab_group_append_tab (tab_group, tab3, FALSE);
        check_notify_delta_counters (&delta_counters, 0, 0);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == tab2);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == tab2);
 
        /* Remove a non-active tab. */
        gtk_widget_destroy (GTK_WIDGET (tab1));
@@ -279,7 +279,7 @@ test_tab_group_notify_signals (void)
        /* Remove active tab. */
        gtk_widget_destroy (GTK_WIDGET (tab2));
        check_notify_delta_counters (&delta_counters, 1, 1);
-       g_assert (tepl_tab_group_get_active_tab (tab_group) == tab3);
+       g_assert_true (tepl_tab_group_get_active_tab (tab_group) == tab3);
 
        g_object_unref (notebook);
 }
diff --git a/testsuite/test-utils.c b/testsuite/test-utils.c
index 84921a9..41aa497 100644
--- a/testsuite/test-utils.c
+++ b/testsuite/test-utils.c
@@ -50,13 +50,13 @@ test_decode_uri (void)
        /* Basic test, for what is used in Tepl (the host). */
        ret = _tepl_utils_decode_uri ("smb://example.net/home/file.c",
                                      NULL, NULL, &host, NULL, NULL);
-       g_assert (ret);
+       g_assert_true (ret);
        g_assert_cmpstr (host, ==, "example.net");
        g_free (host);
 
        ret = _tepl_utils_decode_uri ("smb://154.23.201.4/home/file.c",
                                      NULL, NULL, &host, NULL, NULL);
-       g_assert (ret);
+       g_assert_true (ret);
        g_assert_cmpstr (host, ==, "154.23.201.4");
        g_free (host);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]