add support files and regression tests for #1124
This commit is contained in:
parent
0b97170f1d
commit
5525abfea8
2 changed files with 45 additions and 0 deletions
11
Examples/test-suite/r/r_use_isnull_runme.R
Normal file
11
Examples/test-suite/r/r_use_isnull_runme.R
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
clargs <- commandArgs(trailing=TRUE)
|
||||
source(file.path(clargs[1], "unittest.R"))
|
||||
|
||||
dyn.load(paste("r_use_isnull", .Platform$dynlib.ext, sep=""))
|
||||
source("r_use_isnull.R")
|
||||
cacheMetaData(1)
|
||||
|
||||
tp <- pointerTest()
|
||||
circ1 <- tp$getCircle(1)
|
||||
circ1
|
||||
unittest(is.null(circ1), TRUE)
|
||||
34
Examples/test-suite/r_use_isnull.i
Normal file
34
Examples/test-suite/r_use_isnull.i
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
%module r_use_isnull
|
||||
|
||||
%inline %{
|
||||
// C++ code
|
||||
class circle {
|
||||
public:
|
||||
circle(double radius)
|
||||
{
|
||||
m_radius = radius;
|
||||
}
|
||||
double getArea() const
|
||||
{
|
||||
return (3.14 * m_radius * m_radius);
|
||||
}
|
||||
|
||||
private:
|
||||
double m_radius;
|
||||
};
|
||||
|
||||
class pointerTest {
|
||||
public:
|
||||
pointerTest() : m_circle(2) {}
|
||||
const circle * getCircle(int index) const {
|
||||
if (index == 0)
|
||||
return & m_circle;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
circle m_circle;
|
||||
|
||||
};
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue