|
| 1 | +#!/usr/bin/r -t |
| 2 | +# hey emacs, please make this use -*- tab-width: 4 -*- |
| 3 | +# |
| 4 | +# Copyright (C) 2014 Christian Authmann |
| 5 | +# |
| 6 | +# This file is part of Rcpp. |
| 7 | +# |
| 8 | +# Rcpp is free software: you can redistribute it and/or modify it |
| 9 | +# under the terms of the GNU General Public License as published by |
| 10 | +# the Free Software Foundation, either version 2 of the License, or |
| 11 | +# (at your option) any later version. |
| 12 | +# |
| 13 | +# Rcpp is distributed in the hope that it will be useful, but |
| 14 | +# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | +# GNU General Public License for more details. |
| 17 | +# |
| 18 | +# You should have received a copy of the GNU General Public License |
| 19 | +# along with Rcpp. If not, see <http://www.gnu.org/licenses/>. |
| 20 | + |
| 21 | +hasCXX11 <- grepl("-std=c\\+\\+1[1-9yz]", Sys.getenv("PKG_CXXFLAGS")) |
| 22 | + |
| 23 | +.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes" && hasCXX11 |
| 24 | + |
| 25 | +if( .runThisTest ) { |
| 26 | + |
| 27 | + .tearDown <- function(){ |
| 28 | + gc() |
| 29 | + } |
| 30 | + |
| 31 | + .setUp <- Rcpp:::unitTestSetup("InternalFunctionCPP11.cpp") |
| 32 | + |
| 33 | + test.internal_function_add <- function(){ |
| 34 | + fun <- getAdd4() |
| 35 | + checkEquals( fun(38), 42 ) |
| 36 | + } |
| 37 | + |
| 38 | + test.internal_function_concatenate <- function(){ |
| 39 | + fun <- getConcatenate() |
| 40 | + checkEquals( fun("Hello"," World"), "Hello World" ) |
| 41 | + } |
| 42 | + |
| 43 | +} |
0 commit comments