[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10455: Test that method name in Net
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10455: Test that method name in NetConnection.call first arg doesn't *need* to be a string but is always converted to one. Fix gnash to do that. |
Date: |
Wed, 17 Dec 2008 21:28:28 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10455
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Wed 2008-12-17 21:28:28 +0100
message:
Test that method name in NetConnection.call first arg doesn't *need* to be a
string but is always converted to one. Fix gnash to do that.
modified:
libcore/asobj/NetConnection_as.cpp
testsuite/misc-ming.all/remoting.as
=== modified file 'libcore/asobj/NetConnection_as.cpp'
--- a/libcore/asobj/NetConnection_as.cpp 2008-12-15 17:15:25 +0000
+++ b/libcore/asobj/NetConnection_as.cpp 2008-12-17 20:28:28 +0000
@@ -870,14 +870,7 @@
}
const as_value& methodName_as = fn.arg(0);
- if (!methodName_as.is_string()) {
- IF_VERBOSE_ASCODING_ERRORS(
- std::stringstream ss; fn.dump_args(ss);
- log_aserror(_("NetConnection.call(%s): first argument "
- "(methodName) must be a string"), ss.str());
- );
- return as_value();
- }
+ std::string methodName = methodName_as.to_string();
std::stringstream ss; fn.dump_args(ss);
#ifdef GNASH_DEBUG_REMOTING
@@ -899,7 +892,6 @@
);
}
}
- std::string methodName = methodName_as.to_string();
static int call_number = 0;
=== modified file 'testsuite/misc-ming.all/remoting.as'
--- a/testsuite/misc-ming.all/remoting.as 2008-12-17 20:05:25 +0000
+++ b/testsuite/misc-ming.all/remoting.as 2008-12-17 20:28:28 +0000
@@ -24,7 +24,7 @@
endOfTest = function()
{
//note("END OF TEST");
- check_totals(89);
+ check_totals(104);
play();
};
@@ -327,6 +327,40 @@
check_equals(res.message, 'multiarg');
check_equals(res.arg_count, '5');
check_equals(res.hex,
'0a:00:00:00:05:0a:00:00:00:00:02:00:01:61:03:00:01:64:00:3f:f0:00:00:00:00:00:00:00:01:62:02:00:01:63:00:00:09:05:06');
+ };
+
+ o={onStatus:handleOnStatus};
+ nc.call(25.53, o);
+ o.onResult = function(res) {
+ //note(printInfo(res));
+ check_equals(res.remote_port, connectionPort);
+ xcheck_equals(res.request_id, '/5');
+ check_equals(res.message, '25.53');
+ check_equals(res.arg_count, '0');
+ check_equals(res.hex, '0a:00:00:00:00');
+ };
+
+ o={onStatus:handleOnStatus};
+ nc.call(true, o);
+ o.onResult = function(res) {
+ //note(printInfo(res));
+ check_equals(res.remote_port, connectionPort);
+ xcheck_equals(res.request_id, '/6');
+ check_equals(res.message, 'true');
+ check_equals(res.arg_count, '0');
+ check_equals(res.hex, '0a:00:00:00:00');
+ };
+
+ o={onStatus:handleOnStatus};
+ n={}; n.toString=function() { return 'toString'; };
+ nc.call(n, o);
+ o.onResult = function(res) {
+ //note(printInfo(res));
+ check_equals(res.remote_port, connectionPort);
+ xcheck_equals(res.request_id, '/7');
+ check_equals(res.message, 'toString');
+ check_equals(res.arg_count, '0');
+ check_equals(res.hex, '0a:00:00:00:00');
test17();
};
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10455: Test that method name in NetConnection.call first arg doesn't *need* to be a string but is always converted to one. Fix gnash to do that.,
Sandro Santilli <=