Commit graph

3,122 commits

Author SHA1 Message Date
William S Fulton
0fb34cb019 Disable test not relevant for Python -builtin 2014-10-01 07:57:23 +01:00
Oliver Buchtala
53d7fc8a16 Merge branch 'Richie765-master'
Conflicts:
	CHANGES.current
2014-09-30 18:46:25 +02:00
Simon Marchetto
35ff88709e scilab: fix tests having too long identifier names 2014-09-29 17:32:49 +02:00
Simon Marchetto
7307d967d0 scilab: fix tests having too long identifier names 2014-09-29 14:52:05 +02:00
Simon Marchetto
78360b4d1b scilab: fix allprotected test 2014-09-26 17:23:41 +02:00
Simon Marchetto
8b998cb538 scilab: truncates too long (struct, class) member names 2014-09-26 17:23:27 +02:00
Simon Marchetto
fb1b9432ec scilab: add li_std_string_extra test 2014-09-25 16:08:36 +02:00
Simon Marchetto
3ca185197c scilab: truncates too long identifier names (in addition to display warnings) 2014-09-25 14:29:52 +02:00
Simon Marchetto
d421884a3b scilab: fix li_std_except test error codes 2014-09-25 09:33:53 +02:00
Simon Marchetto
b42375a257 scilab: fix tests returning wrong error code 2014-09-24 12:24:41 +02:00
Simon Marchetto
a2c2aaec80 scilab: fix test-suite (scripts were not executed) 2014-09-24 11:44:38 +02:00
Thomas Maslach
de6b433cb1 Fix Python crash when using -threads iterating containers
Also fixes li_std_vector_enum testcase when run with -threads.

Patch supplied on swig-devel mailing list on 12 Sep with details...

==============================================
I just wanted to mention that I found a crash issue in bug..

I am using SWIG 2.0.11 with python and have –threads enabled.  I have a C++ std::vector that I instantiate in SWIG with %template.  I also have a method in a class that returns this vector.  I also include std_vector.i, btw..

When I iterate like so:

children = Action.getActionList()
for child in children:
  pass

Everything is fine..

When I iterate like this:

for child in Action.getActionList()
  pass

Product crashes.

The problem is the following.  This code gets called first:

SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;

  if(!PyArg_UnpackTuple(args,(char *)"delete_SwigPyIterator",1,1,&obj0)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
  }
  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
  {
    SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    delete arg1;
    SWIG_PYTHON_THREAD_END_ALLOW;
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}

Note the SWIG_PYTHON_THREAD_BEGIN_ALLOW/END_ALLOW. In between those two statements, we delete arg1.  That in turn will eventually end up in this code:

namespace swig {
  class SwigPtr_PyObject {
  protected:
    PyObject *_obj;

  public:
    … snip! …
    ~SwigPtr_PyObject()
    {
      Py_XDECREF(_obj);
    }

Uh-oh!  We call Py_XDECREF when we aren’t supposed to because we are in a SWIG_PYTHON_THREAD_BEGIN_ALLOW/END_ALLOW section!

This takes care of the issue:

namespace swig {
  class SwigPtr_PyObject {
  protected:
    PyObject *_obj;

  public:
    … snip! …
    ~SwigPtr_PyObject()
    {
      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
      Py_XDECREF(_obj);
      SWIG_PYTHON_THREAD_END_BLOCK;
    }

There are several other methods in this class that use the Python API, but don’t have the BEGIN/END block defined.  I’m not sure if they are required for all of them, but I believe they are..

I have attached a modified pyclasses.swg with what I believe are the correct changes.  This code is from 2.0.11, but as far as I can tell, it’s the same as what is in 3.0.2…

Apologies for not doing more here (making/running tests, getting it in the code repository, etc..), but I’m under some pressure to get some unrelated things done…
2014-09-23 22:33:25 +01:00
William S Fulton
783e816d89 Testcase warning suppression 2014-09-23 19:54:13 +01:00
Olly Betts
1a99212c2c [PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator";
2014-09-12 12:48:37 -03:00
Olly Betts
e12322df86 [PHP] Fix throwing a PHP exception through C++ from a subclassed
director method - PHP NULL gets returned by the subclassed method
in this case, so the directorout typemap needs to allow that (at
least if an exception is active).
2014-09-11 13:09:08 -03:00
Olly Betts
fa94a29df4 Fix comment typo 2014-09-11 13:06:17 -03:00
Ian Lance Taylor
acaaa0f31f [Go] Add goargout typemap. 2014-09-09 11:28:04 -07:00
Olly Betts
0dd7b61c57 Fix segmentation faults with directors in PHP >= 5.4 2014-09-09 13:39:30 -03:00
Ian Lance Taylor
be145043df Add run test case for argout.i. 2014-09-07 15:44:12 -07:00
Ian Lance Taylor
1addbb46a8 [Go] Add imtype, goin, goout, godirectorin, and godirectorout
typemaps, to support writing Go code to convert between types.
2014-09-05 17:54:19 -07:00
Olly Betts
6eaec9ce7c Update expected output for pp_constant error test 2014-09-04 09:29:20 -03:00
Olly Betts
b9fe7b5f00 Disable case in pp_constant.i which never actually worked 2014-09-03 17:18:11 -03:00
William S Fulton
ae6782ea34 Suppress testcase warning 2014-09-03 20:07:50 +01:00
Olly Betts
d3b3ff2c78 Fix comment typo 2014-09-02 23:12:35 -03:00
William S Fulton
7acf8de21e Scilab overloaded method testcase warning suppression 2014-09-01 19:56:39 +01:00
Alexey Pelykh
abb888cfdd Clean-up test suite and fix issue with nspace, as well as keep the fix for Class::Struct::EnumClass being JNI-referenced as Struct_EnumClass 2014-08-31 12:14:29 +03:00
Alexey Pelykh
d318f03efe C++11 strongly-typed enums fix for Java only (proper) 2014-08-30 11:58:52 +03:00
Alexey Pelykh
d1b1925270 Additional test cases for C++11 strongly-typed enums 2014-08-30 09:08:04 +03:00
Richard
b8d7cc21b9 Use macros for V8 items 2014-08-28 19:46:52 -05:00
Richard
b0afc7a9a5 Allow to specify V8 version, for example:
V8_VERSION=0x031511 ENGINE=v8 make check-javascript-test-suite
2014-08-28 19:46:49 -05:00
William S Fulton
332c02ae2d Scilab minor build system improvement 2014-08-26 19:52:03 +01:00
Vadim Zeitlin
15b369028f Allow using enum elements as default values for Python functions.
Enum values are just (integer) constants in Python and so can be used as the
function default values just as well as literal numbers, account for this when
checking whether function parameters can be represented in Python.

Also rename is_primitive_defaultargs() to is_representable_as_pyargs() to
describe better what this function does.
2014-08-17 01:08:32 +02:00
Robert Stone
488aed4224 apply SF Patch #350 and add testcase 2014-08-15 21:47:10 -07:00
Simon Marchetto
bb4b6742eb scilab: hide too long identifier warnings 2014-07-24 11:14:07 +02:00
Yuval Kashtan
093fe2a556 Add support for java.nio.Buffer
including test-suite test case and documentation
2014-07-18 15:45:16 +03:00
Simon Marchetto
7ce1550664 scilab: fix missing include in li_std_container_typemaps test 2014-07-10 12:54:57 +02:00
Simon Marchetto
34db2b83c5 scilab: library stl.i include same libraries as in other languages 2014-07-10 09:22:32 +02:00
Simon Marchetto
8fdb67cace scilab: rollback INCLUDE 2014-07-03 15:03:34 +02:00
Simon Marchetto
5e7627c3f7 scilab: remove useless SCRIPTDIR 2014-07-03 11:58:47 +02:00
Simon Marchetto
d6cca41d3e scilab: simplify Examples makefile (removing INCLUDE stuff) 2014-07-03 11:32:59 +02:00
William S Fulton
83749b3937 Fix expansion of the $parentclassname special variable
It incorrectly contains brackets in the expanded name.
Fixes SF Bug 1375.
2014-07-01 20:27:48 +01:00
William S Fulton
70cee61c2a Cosmetic test case change 2014-06-26 20:30:25 +01:00
William S Fulton
daab0d748c Fix ancient bad merge from trunk 2014-06-26 20:30:25 +01:00
William S Fulton
0ebe64c041 Run overload_arrays testcase in all languages not just Scilab 2014-06-26 20:30:25 +01:00
William S Fulton
a40ab6a7d2 Better Scilab workaround for testcase 2014-06-26 20:30:24 +01:00
William S Fulton
2f01e5468f Fix ancient merge error
in 75d2abfddb
2014-06-26 20:30:24 +01:00
William S Fulton
8143e59d68 Revert "scilab: implement enum_var test"
This reverts commit fbe6c13267.

It looks like an accidental change to me
2014-06-26 20:30:24 +01:00
Simon Marchetto
821118de9b scilab: rename swig_this(), swig_ptr() to SWIG_this(), SWIG_ptr() 2014-06-26 09:44:49 +02:00
Simon Marchetto
9fc32cb866 scilab: fix test-suite: change to test dir before running test 2014-06-20 16:48:24 +02:00
Simon Marchetto
2aabb4527e scilab: fix test-suite clean 2014-06-20 12:34:33 +02:00