[gjs: 1/6] tests: Don't compare Rooted<T> against NULL



commit 8c781945effb6d4c3f58df5c53760659728a031a
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Jan 15 23:03:48 2018 -0800

    tests: Don't compare Rooted<T> against NULL
    
    In SpiderMonkey 60, it will be ambiguous to compare JS::Rooted<T> to NULL
    (i.e., long type). Instead of g_assert_null() and g_assert_nonnull(), we
    assert with g_assert_false() and g_assert_true() respectively.

 test/gjs-test-call-args.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/test/gjs-test-call-args.cpp b/test/gjs-test-call-args.cpp
index 49563ee..e1806e2 100644
--- a/test/gjs-test-call-args.cpp
+++ b/test/gjs-test-call-args.cpp
@@ -108,7 +108,7 @@ JSNATIVE_TEST_FUNC_BEGIN(one_of_each_type)
     g_assert_cmpint(uintval, ==, 1);
     g_assert_cmpint(int64val, ==, 1);
     g_assert_cmpfloat(dblval, ==, 1.0);
-    g_assert_nonnull(objval);
+    g_assert_true(objval);
 JSNATIVE_TEST_FUNC_END
 
 JSNATIVE_TEST_FUNC_BEGIN(optional_args_all)
@@ -164,7 +164,7 @@ JSNATIVE_TEST_FUNC_BEGIN(one_of_each_nullable_type)
                                  "objval", &objval);
     g_assert_null(strval);
     g_assert_null(fileval);
-    g_assert_null(objval);
+    g_assert_false(objval);
 JSNATIVE_TEST_FUNC_END
 
 JSNATIVE_TEST_FUNC_BEGIN(unwind_free_test)
@@ -175,7 +175,7 @@ JSNATIVE_TEST_FUNC_BEGIN(unwind_free_test)
                                  "objval", &objval,
                                  "intval", &intval,
                                  "error", &uval);
-    g_assert_null(objval);
+    g_assert_false(objval);
 JSNATIVE_TEST_FUNC_END
 
 #define JSNATIVE_BAD_NULLABLE_TEST_FUNC(type, fmt)                 \


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