add regression tests for SEXP return values
This commit is contained in:
parent
93b63969f9
commit
e8c6384f77
3 changed files with 19 additions and 1 deletions
|
|
@ -16,7 +16,8 @@ C_TEST_CASES += \
|
||||||
|
|
||||||
CPP_TEST_CASES += \
|
CPP_TEST_CASES += \
|
||||||
r_double_delete \
|
r_double_delete \
|
||||||
r_overload_array
|
r_overload_array \
|
||||||
|
r_sexp
|
||||||
|
|
||||||
include $(srcdir)/../common.mk
|
include $(srcdir)/../common.mk
|
||||||
|
|
||||||
|
|
|
||||||
7
Examples/test-suite/r/r_sexp_runme.R
Normal file
7
Examples/test-suite/r/r_sexp_runme.R
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
source("unittest.R")
|
||||||
|
dyn.load(paste("r_sexp", .Platform$dynlib.ext, sep=""))
|
||||||
|
source("r_sexp.R")
|
||||||
|
cacheMetaData(1)
|
||||||
|
|
||||||
|
obj <- return_sexp(1);
|
||||||
|
unittest(obj, 1)
|
||||||
10
Examples/test-suite/r_sexp.i
Normal file
10
Examples/test-suite/r_sexp.i
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
%module r_sexp
|
||||||
|
|
||||||
|
extern "C" SEXP return_sexp(SEXP x);
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
SEXP return_sexp(SEXP x) {
|
||||||
|
return x; //Rcpp NumericVector is automatically casted to SEXP
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue