add extra logic to the octave_swig_type::dims(void) method: it checks if the user has defined a __dims__ method and uses this in stead of returning (1,1) (patch from jgillis, sf 3425993)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12955 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Xavier Delacour 2012-03-26 15:45:02 +00:00
commit b0ea5581c3
4 changed files with 231 additions and 2 deletions

View file

@ -12,7 +12,8 @@ top_builddir = @top_builddir@
CPP_TEST_CASES += \
li_std_pair_extra \
li_std_string_extra \
octave_cell_deref
octave_cell_deref\
octave_dim
CPP_TEST_BROKEN += \
implicittest \

View file

@ -0,0 +1,18 @@
octave_dim
assert(all(size(Foo45a())==[4 5]));
assert(all(size(Foo456a())==[4 5 6]));
assert(all(size(Foo4a())==[4 1]));
assert(all(size(Foo4b())==[4 1]));
assert(all(size(Foo())==[1 1]));
assert(all(size(Bar1())==[1 1]));
assert(all(size(Bar2())==[1 1]));
assert(all(size(Baz1())==[3 4]));
assert(all(size(Baz2())==[3 4]));
assert(all(size(Baz3())==[3 4]));
assert(all(size(Baz4())==[3 4]));
% Assertions will not work, but kept for future reference.
%assert(all(size(Baz5())==[3 4]));
%assert(all(size(Baz6())==[3 4]));
%assert(all(size(Baz7())==[3 4]));