[gnome-builder] Fixed boolean tests assertions
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] Fixed boolean tests assertions
- Date: Sun, 18 Oct 2015 16:16:57 +0000 (UTC)
commit b6e921e50a7ee27a4af8c62b0d2939fc618cbe47
Author: Ignazio Sgalmuzzo <ignaker gmail com>
Date: Sun Oct 18 12:46:23 2015 +0200
Fixed boolean tests assertions
https://bugzilla.gnome.org/show_bug.cgi?id=756666
tests/test-egg-state-machine.c | 8 ++++----
tests/test-ide-ctags.c | 2 +-
tests/test-ide-doap.c | 2 +-
tests/test-ide-file-settings.c | 12 ++++++------
4 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/tests/test-egg-state-machine.c b/tests/test-egg-state-machine.c
index 957c248..cfae1bb 100644
--- a/tests/test-egg-state-machine.c
+++ b/tests/test-egg-state-machine.c
@@ -235,14 +235,14 @@ test_state_machine_basic (void)
egg_state_machine_add_property (machine, "state2", action, "enabled", FALSE);
egg_state_machine_add_property (machine, "state3", action, "enabled", FALSE);
- g_assert_cmpint (g_action_get_enabled (G_ACTION (action)), ==, FALSE);
+ g_assert_false (g_action_get_enabled (G_ACTION (action)));
egg_state_machine_set_state (machine, "state1");
g_assert_cmpstr (egg_state_machine_get_state (machine), ==, "state1");
g_assert_cmpint (dummy->obj1_count, ==, 0);
g_assert_cmpint (dummy->obj2_count, ==, 0);
- g_assert_cmpint (g_action_get_enabled (G_ACTION (action)), ==, TRUE);
+ g_assert_true (g_action_get_enabled (G_ACTION (action)));
g_signal_emit_by_name (obj1, "frobnicate");
g_assert_cmpint (dummy->obj1_count, ==, 1);
@@ -255,7 +255,7 @@ test_state_machine_basic (void)
egg_state_machine_set_state (machine, "state2");
g_assert_cmpstr (egg_state_machine_get_state (machine), ==, "state2");
- g_assert_cmpint (g_action_get_enabled (G_ACTION (action)), ==, FALSE);
+ g_assert_false (g_action_get_enabled (G_ACTION (action)));
g_signal_emit_by_name (obj1, "frobnicate");
g_assert_cmpint (dummy->obj1_count, ==, 1);
@@ -335,7 +335,7 @@ test_state_machine_weak_ref_source (void)
g_assert_cmpint (dummy->obj1_count, ==, 1);
g_object_set (obj, "string", "hello world", NULL);
assert_prop_equal (obj, dummy, "string");
- g_assert_cmpint (g_action_get_enabled (G_ACTION (action)), ==, TRUE);
+ g_assert_true (g_action_get_enabled (G_ACTION (action)));
g_assert (has_style_class (widget, "testing"));
/* Destroy the source objects while still in the state */
diff --git a/tests/test-ide-ctags.c b/tests/test-ide-ctags.c
index 0bad11e..130117b 100644
--- a/tests/test-ide-ctags.c
+++ b/tests/test-ide-ctags.c
@@ -40,7 +40,7 @@ init_cb (GObject *object,
ret = g_async_initable_init_finish (initable, result, &error);
g_assert_no_error (error);
- g_assert_cmpint (ret, ==, TRUE);
+ g_assert_true (ret);
g_assert (index != NULL);
g_assert (IDE_IS_CTAGS_INDEX (index));
diff --git a/tests/test-ide-doap.c b/tests/test-ide-doap.c
index 714dd50..54fa31a 100644
--- a/tests/test-ide-doap.c
+++ b/tests/test-ide-doap.c
@@ -36,7 +36,7 @@ test_load_from_file (void)
ret = ide_doap_load_from_file (doap, file, NULL, &error);
g_assert_no_error (error);
- g_assert_cmpint (ret, ==, TRUE);
+ g_assert_true (ret);
g_assert_cmpstr (ide_doap_get_name (doap), ==, "Project One");
g_assert_cmpstr (ide_doap_get_shortdesc (doap), ==, "Short Description of Project1");
diff --git a/tests/test-ide-file-settings.c b/tests/test-ide-file-settings.c
index 8e76186..6e08aa2 100644
--- a/tests/test-ide-file-settings.c
+++ b/tests/test-ide-file-settings.c
@@ -57,9 +57,9 @@ test_filesettings (void)
g_assert_cmpstr (ide_file_settings_get_encoding (settings), ==, "utf-8");
ide_file_settings_set_insert_trailing_newline (settings, FALSE);
- g_assert_cmpint (ide_file_settings_get_insert_trailing_newline (settings), ==, FALSE);
+ g_assert_false (ide_file_settings_get_insert_trailing_newline (settings));
ide_file_settings_set_insert_trailing_newline (settings, TRUE);
- g_assert_cmpint (ide_file_settings_get_insert_trailing_newline (settings), ==, TRUE);
+ g_assert_true (ide_file_settings_get_insert_trailing_newline (settings));
ide_file_settings_set_newline_type (settings, GTK_SOURCE_NEWLINE_TYPE_CR);
g_assert_cmpint (ide_file_settings_get_newline_type (settings), ==, GTK_SOURCE_NEWLINE_TYPE_CR);
@@ -75,14 +75,14 @@ test_filesettings (void)
g_assert_cmpint (ide_file_settings_get_indent_style (settings), ==, IDE_INDENT_STYLE_SPACES);
ide_file_settings_set_trim_trailing_whitespace (settings, TRUE);
- g_assert_cmpint (ide_file_settings_get_trim_trailing_whitespace (settings), ==, TRUE);
+ g_assert_true (ide_file_settings_get_trim_trailing_whitespace (settings));
ide_file_settings_set_trim_trailing_whitespace (settings, FALSE);
- g_assert_cmpint (ide_file_settings_get_trim_trailing_whitespace (settings), ==, FALSE);
+ g_assert_false (ide_file_settings_get_trim_trailing_whitespace (settings));
ide_file_settings_set_show_right_margin (settings, TRUE);
- g_assert_cmpint (ide_file_settings_get_show_right_margin (settings), ==, TRUE);
+ g_assert_true (ide_file_settings_get_show_right_margin (settings));
ide_file_settings_set_show_right_margin (settings, FALSE);
- g_assert_cmpint (ide_file_settings_get_show_right_margin (settings), ==, FALSE);
+ g_assert_false (ide_file_settings_get_show_right_margin (settings));
g_object_unref (settings);
g_assert (settings == NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]