[gjs] tests: Fix a few bad jsval compares



commit 8bb712b01f3c9c3f3cf6d81d44000f1d30e8c4ec
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Dec 11 23:58:45 2012 -0500

    tests: Fix a few bad jsval compares
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678410

 gjs/jsapi-util-error.c  |    2 +-
 gjs/jsapi-util-string.c |    1 -
 2 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gjs/jsapi-util-error.c b/gjs/jsapi-util-error.c
index c008b8c..39f32e3 100644
--- a/gjs/jsapi-util-error.c
+++ b/gjs/jsapi-util-error.c
@@ -246,7 +246,7 @@ gjstest_test_func_gjs_jsapi_util_error_throw(void)
     exc = JSVAL_VOID;
     JS_GetPendingException(context, &exc);
     g_assert(!JSVAL_IS_VOID(exc));
-    g_assert(exc == previous);
+    g_assert(JSVAL_TO_OBJECT(exc) == JSVAL_TO_OBJECT(previous));
 
     JS_RemoveValueRoot(context, &previous);
 
diff --git a/gjs/jsapi-util-string.c b/gjs/jsapi-util-string.c
index d94ae69..60bbebb 100644
--- a/gjs/jsapi-util-string.c
+++ b/gjs/jsapi-util-string.c
@@ -501,7 +501,6 @@ gjstest_test_func_gjs_jsapi_util_string_js_string_utf8(void)
     context = fixture.context;
 
     g_assert(gjs_string_from_utf8(context, utf8_string, -1, &js_string) == JS_TRUE);
-    g_assert(js_string);
     g_assert(JSVAL_IS_STRING(js_string));
     g_assert(gjs_string_to_utf8(context, js_string, &utf8_result) == JS_TRUE);
 



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