Add regression tests for R
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11057 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ecdd24a508
commit
2854ceef44
4 changed files with 35 additions and 0 deletions
|
|
@ -85,8 +85,10 @@ SWIG_STD_VECTOR_SPECIALIZE(SWIGTYPE_p_int, const int *)
|
|||
%template(StructureConstPtrVector) std::vector<const Structure *>;
|
||||
#endif
|
||||
|
||||
#if !defined(SWIGR)
|
||||
%template(IntPtrVector) std::vector<int *>;
|
||||
%template(IntConstPtrVector) std::vector<const int *>;
|
||||
#endif
|
||||
%template(StructVector) std::vector<Struct>;
|
||||
%template(StructPtrVector) std::vector<Struct *>;
|
||||
%template(StructConstPtrVector) std::vector<const Struct *>;
|
||||
|
|
|
|||
20
Examples/test-suite/r/arrays_dimensionless_runme.R
Normal file
20
Examples/test-suite/r/arrays_dimensionless_runme.R
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
source("unittest.R")
|
||||
dyn.load(paste("arrays_dimensionless", .Platform$dynlib.ext, sep=""))
|
||||
source("arrays_dimensionless.R")
|
||||
cacheMetaData(1)
|
||||
|
||||
unittest(arr_short(1:4, 3), 6)
|
||||
unittest(arr_ushort(1:4, 3), 6)
|
||||
unittest(arr_int(1:4, 3), 6)
|
||||
unittest(arr_uint(1:4, 3), 6)
|
||||
unittest(arr_long(1:4, 3), 6)
|
||||
unittest(arr_ulong(1:4, 3), 6)
|
||||
unittest(arr_ll(1:4, 3), 6)
|
||||
unittest(arr_ull(1:4, 3), 6)
|
||||
unittest(arr_float(as.numeric(1:4), 3), 6)
|
||||
unittest(arr_double(as.numeric(1:4), 3), 6)
|
||||
|
||||
q(save="no")
|
||||
|
||||
|
||||
|
||||
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
//Bug #1832613
|
||||
|
||||
#if !defined(SWIGR)
|
||||
// R Swig fails on this test. Because it tries to return a nil SEXP in
|
||||
// an error
|
||||
|
||||
%include <std_string.i>
|
||||
|
||||
%inline %{
|
||||
|
|
@ -46,3 +50,4 @@ typedef MCContractPtr* ContractPtrPtr;
|
|||
// Plain pointers were also causing problems...
|
||||
%template(MCContractFactory2) ContractFactory<MCContract, std::string, ContractPtrPtr>;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
%module types_directive
|
||||
|
||||
#if defined(SWIGR)
|
||||
// Avoid conflict with Date class in R
|
||||
#define Date DateSwig
|
||||
%inline %{
|
||||
#define Date DateSwig
|
||||
%}
|
||||
#endif
|
||||
|
||||
%ignore Time2::operator Date *;
|
||||
|
||||
%inline %{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue