Skip to content

Commit

Permalink
Resolve segfault when running embeddedR test (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsch authored and eddelbuettel committed Jun 15, 2018
1 parent 1b33aad commit a6ae672
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/unitTests/runit.embeddedR.R
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.

.runThisTest <- FALSE #Sys.getenv("RunAllRcppTests") == "yes"
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"

if (.runThisTest) {

Expand All @@ -27,13 +27,13 @@ if (.runThisTest) {
expectedVars <- c("foo", "x")

# embeddedR.cpp exposes the function foo, R snippet calls foo
newEnv <- new.env()
newEnv <- new.env(parent = baseenv())
Rcpp::sourceCpp(file.path(path, "embeddedR.cpp"),
env = newEnv)
checkEquals(ls(newEnv), expectedVars, msg = " sourcing code in custom env")

# R snippet in embeddedR2.cpp also contains a call to foo from previous cpp
newEnv2 <- new.env()
newEnv2 <- new.env(parent = baseenv())
checkException(Rcpp::sourceCpp(file.path(path, "embeddedR2.cpp"), env = newEnv2),
" not available in other env")
}
Expand Down

0 comments on commit a6ae672

Please sign in to comment.