Merge branch 'devel' of https://github.com/Neha03/gsoc2012-javascript into devel
Conflicts: .project COPYRIGHT Doc/Manual/style.css Examples/Makefile.in Examples/test-suite/common.mk Lib/typemaps/strings.swg Makefile.in Source/DOH/fio.c Source/Makefile.am Source/Modules/emit.cxx Source/Modules/javascript.cxx configure.in git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13764 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
360ef44e09
commit
050219d998
136 changed files with 7987 additions and 141 deletions
36
Examples/test-suite/javascript/char_binary_runme.js
Normal file
36
Examples/test-suite/javascript/char_binary_runme.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
var t = new char_binary.Test();
|
||||
if (t.strlen('hile') != 4) {
|
||||
print(t.strlen('hile'));
|
||||
throw("bad multi-arg typemap 1");
|
||||
}
|
||||
|
||||
if (t.strlen('hil\0') != 4) {
|
||||
throw("bad multi-arg typemap 2");
|
||||
}
|
||||
|
||||
/*
|
||||
* creating a raw char*
|
||||
*/
|
||||
var pc = char_binary.new_pchar(5);
|
||||
char_binary.pchar_setitem(pc, 0, 'h');
|
||||
char_binary.pchar_setitem(pc, 1, 'o');
|
||||
char_binary.pchar_setitem(pc, 2, 'l');
|
||||
char_binary.pchar_setitem(pc, 3, 'a');
|
||||
char_binary.pchar_setitem(pc, 4, 0);
|
||||
|
||||
|
||||
if (t.strlen(pc) != 4) {
|
||||
throw("bad multi-arg typemap (3)");
|
||||
}
|
||||
|
||||
char_binary.var_pchar = pc;
|
||||
if (char_binary.var_pchar != "hola") {
|
||||
print(char_binary.var_pchar);
|
||||
throw("bad pointer case (1)");
|
||||
}
|
||||
|
||||
char_binary.var_namet = pc;
|
||||
if (char_binary.var_namet != "hola") {
|
||||
throw("bad pointer case (2)");
|
||||
}
|
||||
char_binary.delete_pchar(pc);
|
||||
Loading…
Add table
Add a link
Reference in a new issue