[gobject-introspection] tests: Check against TRUE and FALSE for booleans



commit 9111b8fbdb70fd8e78f6bc9e31e92469017545f3
Author: Philip Chimento <philip chimento gmail com>
Date:   Fri Oct 14 21:11:05 2016 -0700

    tests: Check against TRUE and FALSE for booleans
    
    For boolean arrays, we want to make sure that we actually got an array of
    TRUE and FALSE (1 and 0) instead of an array of integers that may have
    other values besides 1 and 0.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772790

 tests/gimarshallingtests.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index da8617e..e7f5638 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -1429,10 +1429,10 @@ void
 gi_marshalling_tests_array_bool_in (const gboolean *bools, gint length)
 {
   g_assert_cmpint (length, ==, 4);
-  g_assert_true (bools[0]);
-  g_assert_false (bools[1]);
-  g_assert_true (bools[2]);
-  g_assert_true (bools[3]);
+  g_assert_cmpint (bools[0], ==, TRUE);
+  g_assert_cmpint (bools[1], ==, FALSE);
+  g_assert_cmpint (bools[2], ==, TRUE);
+  g_assert_cmpint (bools[3], ==, TRUE);
 }
 
 /**
@@ -2162,10 +2162,10 @@ void
 gi_marshalling_tests_garray_bool_none_in (GArray *array_)
 {
   g_assert_cmpint (array_->len, ==, 4);
-  g_assert_true (g_array_index (array_, gboolean, 0));
-  g_assert_false (g_array_index (array_, gboolean, 1));
-  g_assert_true (g_array_index (array_, gboolean, 2));
-  g_assert_true (g_array_index (array_, gboolean, 3));
+  g_assert_cmpint (g_array_index (array_, gboolean, 0), ==, TRUE);
+  g_assert_cmpint (g_array_index (array_, gboolean, 1), ==, FALSE);
+  g_assert_cmpint (g_array_index (array_, gboolean, 2), ==, TRUE);
+  g_assert_cmpint (g_array_index (array_, gboolean, 3), ==, TRUE);
 }
 
 /**


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