[Rcpp-commits] r2649 - pkg/Rcpp/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 2 10:01:34 CET 2010


Author: romain
Date: 2010-12-02 10:01:33 +0100 (Thu, 02 Dec 2010)
New Revision: 2649

Modified:
   pkg/Rcpp/inst/unitTests/runit.RObject.R
   pkg/Rcpp/inst/unitTests/runit.RcppDate.R
   pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R
   pkg/Rcpp/inst/unitTests/runit.RcppMisc.R
   pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R
Log:
adding deprecation hooks (7)

Modified: pkg/Rcpp/inst/unitTests/runit.RObject.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RObject.R	2010-12-02 08:56:08 UTC (rev 2648)
+++ pkg/Rcpp/inst/unitTests/runit.RObject.R	2010-12-02 09:01:33 UTC (rev 2649)
@@ -50,16 +50,6 @@
                    'bool b = as<bool>(x);
 					return(wrap( !b ));')
 
-                  ,"asStdVectorIntResultsSet"=list(
-                   signature(x="numeric"),
-                   'std::vector<int> iv = as<std::vector<int> >( x );
-					for (size_t i=0; i<iv.size(); i++) {
-    	    			iv[i] = 2*iv[i];
-    				}
-			    	RcppResultSet rs;
-    				rs.add("", iv);
-    				return(rs.getSEXP());')
-
                   ,"asStdVectorInt"=list(
                    signature(x="numeric"),
                    'std::vector<int> iv = as< std::vector<int> >(x);
@@ -236,23 +226,6 @@
 	checkException( funx(raw(0)), msg = "as<bool>(0 raw) -> exception" )
 }
 
-test.RObject.asStdVectorIntResultsSet <- function(){
-	funx <- .Rcpp.RObject$asStdVectorIntResultsSet
-	foo <- '
-		std::vector<int> iv = as<std::vector<int> >( x );
-		for (size_t i=0; i<iv.size(); i++) {
-    	    iv[i] = 2*iv[i];
-    	}
-    	RcppResultSet rs;
-    	rs.add("", iv);
-    	return(rs.getSEXP());'
-    funx <- cppfunction(signature(x="numeric"), foo )
-	checkEquals( funx(x=2:5), 2:5*2L, msg = "as<std::vector<int> >(integer) via RcppResultSet" )
-    checkEquals( funx(x=2:5+.1), 2:5*2L, msg = "as<std::vector<int> >(numeric) via RcppResultSet" )
-    checkEquals( funx(x=as.raw(2:5)), 2:5*2L, msg = "as<std::vector<int> >(raw) via RcppResultSet" )
-    checkException( funx("foo"), msg = "as<std::vector<int> >(character) -> exception" )
-}
-
 test.RObject.asStdVectorInt <- function(){
 	funx <- .Rcpp.RObject$asStdVectorInt
     checkEquals( funx(x=2:5), 2:5*2L, msg = "as< std::vector<int> >(integer)" )

Modified: pkg/Rcpp/inst/unitTests/runit.RcppDate.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppDate.R	2010-12-02 08:56:08 UTC (rev 2648)
+++ pkg/Rcpp/inst/unitTests/runit.RcppDate.R	2010-12-02 09:01:33 UTC (rev 2649)
@@ -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/>.
 
-if( Rcpp::capabilities()["classic api"] ){
+if( Rcpp:::capabilities()["classic api"] ){
 
 .setUp <- function() {
     if( ! exists( ".rcpp.RcppDate", globalenv() )) {

Modified: pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R	2010-12-02 08:56:08 UTC (rev 2648)
+++ pkg/Rcpp/inst/unitTests/runit.RcppMatrix.R	2010-12-02 09:01:33 UTC (rev 2649)
@@ -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/>.
 
-if( Rcpp::capabilities()["classic api"] ){
+if( Rcpp:::capabilities()["classic api"] ){
 
 .setUp <- function() {
 

Modified: pkg/Rcpp/inst/unitTests/runit.RcppMisc.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppMisc.R	2010-12-02 08:56:08 UTC (rev 2648)
+++ pkg/Rcpp/inst/unitTests/runit.RcppMisc.R	2010-12-02 09:01:33 UTC (rev 2649)
@@ -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/>.
 
-if( Rcpp::capabilities()["classic api"] ){
+if( Rcpp:::capabilities()["classic api"] ){
 
 .setUp <- function() {
 

Modified: pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R	2010-12-02 08:56:08 UTC (rev 2648)
+++ pkg/Rcpp/inst/unitTests/runit.RcppResultSet.R	2010-12-02 09:01:33 UTC (rev 2649)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
 
-if( Rcpp::capabilities()["classic api"] ){
+if( Rcpp:::capabilities()["classic api"] ){
 
 .setUp <- function() {
     if( ! exists( ".rcpp.RcppResultSet", globalenv() )) {
@@ -350,5 +350,22 @@
     checkEquals( fun(x)[[1]], x, msg = "RcppResultSet.SEXP")
 }
 
+test.RObject.asStdVectorIntResultsSet <- function(){
+	funx <- .Rcpp.RObject$asStdVectorIntResultsSet
+	foo <- '
+		std::vector<int> iv = as<std::vector<int> >( x );
+		for (size_t i=0; i<iv.size(); i++) {
+    	    iv[i] = 2*iv[i];
+    	}
+    	RcppResultSet rs;
+    	rs.add("", iv);
+    	return(rs.getSEXP());'
+    funx <- cppfunction(signature(x="numeric"), foo )
+	checkEquals( funx(x=2:5), 2:5*2L, msg = "as<std::vector<int> >(integer) via RcppResultSet" )
+    checkEquals( funx(x=2:5+.1), 2:5*2L, msg = "as<std::vector<int> >(numeric) via RcppResultSet" )
+    checkEquals( funx(x=as.raw(2:5)), 2:5*2L, msg = "as<std::vector<int> >(raw) via RcppResultSet" )
+    checkException( funx("foo"), msg = "as<std::vector<int> >(character) -> exception" )
 }
 
+}
+



More information about the Rcpp-commits mailing list