[gjs] Add test case for G_SIGNAL_TYPE_STATIC_SCOPE



commit e659d81b424a593f2444b16267d9b2642411a79d
Author: Johan Bilien <jobi litl com>
Date:   Tue Mar 24 11:15:56 2009 +0000

    Add test case for G_SIGNAL_TYPE_STATIC_SCOPE
    
    (failing for now)
---
 test/js/testEverythingBasic.js |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/test/js/testEverythingBasic.js b/test/js/testEverythingBasic.js
index 1fb064f..ab16906 100644
--- a/test/js/testEverythingBasic.js
+++ b/test/js/testEverythingBasic.js
@@ -183,4 +183,19 @@ function testSignal() {
     assertEquals('disconnected handler not called', 1, handlerCounter);
 }
 
+function testSignalWithStaticScopeArg() {
+    let o = new Everything.TestObj();
+    let b = new Everything.TestSimpleBoxedA({ some_int: 42,
+                                              some_int8: 43,
+                                              some_double: 42.5,
+                                              some_enum: Everything.TestEnum.VALUE3 });
+
+    o.connect('test-with-static-scope-arg', function(signalObject, signalArg) {
+                                                signalArg.some_int = 44;
+                                            });
+
+    o.emit('test-with-static-scope-arg', b);
+    assertEquals('signal handler was passed arg as reference', 44, b.some_int);
+}
+
 gjstestRun();



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