[Rcpp-commits] r4160 - in pkg/Rcpp: inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 15 23:12:38 CET 2012


Author: romain
Date: 2012-12-15 23:12:38 +0100 (Sat, 15 Dec 2012)
New Revision: 4160

Modified:
   pkg/Rcpp/inst/unitTests/runit.macros.R
   pkg/Rcpp/src/Rcpp_init.c
   pkg/Rcpp/src/api.cpp
   pkg/Rcpp/src/internal.h
Log:
remove rcpp_call_test bloat

Modified: pkg/Rcpp/inst/unitTests/runit.macros.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.macros.R	2012-12-15 22:06:56 UTC (rev 4159)
+++ pkg/Rcpp/inst/unitTests/runit.macros.R	2012-12-15 22:12:38 UTC (rev 4160)
@@ -44,23 +44,6 @@
 	info
 }
 
-test.macro.switch <- function(){
-	rcpp_typeof <- function(x){
-		.Call( "rcpp_call_test", x, PACKAGE = "Rcpp" )
-	}
-	sexp_types <- c( integer = 13L, double = 14L, raw = 24L,
-		complex = 15L, logical = 10L, list = 19L,
-		"expression" = 20L, character = 16L )
-	checkEquals( rcpp_typeof(1L ), sexp_types[[ "integer" ]], msg = "RCPP_RETURN_VECTOR <INTSXP> " )
-	checkEquals( rcpp_typeof(1.0), sexp_types[["double"]], msg = "RCPP_RETURN_VECTOR <REALSXP> " )
-	checkEquals( rcpp_typeof(as.raw(0)), sexp_types[["raw"]] , msg = "RCPP_RETURN_VECTOR <RAWSXP> " )
-	checkEquals( rcpp_typeof(1i), sexp_types[["complex"]], msg = "RCPP_RETURN_VECTOR <CPLXSXP> " )
-	checkEquals( rcpp_typeof(TRUE), sexp_types[["logical"]], msg = "RCPP_RETURN_VECTOR <LGLSXP> " )
-	checkEquals( rcpp_typeof(list(1)), sexp_types[["list"]] , msg = "RCPP_RETURN_VECTOR <VECSXP> " )
-	checkEquals( rcpp_typeof(expression(x)), sexp_types[["expression"]], msg = "RCPP_RETURN_VECTOR <EXPRSXP> " )
-	checkEquals( rcpp_typeof(""), sexp_types[["character"]], msg = "RCPP_RETURN_VECTOR <STRSXP> " )
-}
-
 test.RCPPFUNCTION <- function(){
 
 	fx <- cxxfunction( signature(), '

Modified: pkg/Rcpp/src/Rcpp_init.c
===================================================================
--- pkg/Rcpp/src/Rcpp_init.c	2012-12-15 22:06:56 UTC (rev 4159)
+++ pkg/Rcpp/src/Rcpp_init.c	2012-12-15 22:12:38 UTC (rev 4160)
@@ -57,7 +57,6 @@
     
     CALLDEF(rcpp_capabilities,0),
     CALLDEF(rcpp_can_use_cxx0x,0),
-    CALLDEF(rcpp_call_test,1),
     {NULL, NULL, 0}
 }; 
 

Modified: pkg/Rcpp/src/api.cpp
===================================================================
--- pkg/Rcpp/src/api.cpp	2012-12-15 22:06:56 UTC (rev 4159)
+++ pkg/Rcpp/src/api.cpp	2012-12-15 22:12:38 UTC (rev 4160)
@@ -1312,14 +1312,6 @@
 		return std::complex<float>(static_cast<float>(from.r), static_cast<float>(from.i) ) ;
 	}
 
-	// TODO: move these two things in testing
-	template <typename T> int rcpp_call_test(T t){
-        return T::r_type::value ;
-    }
-    int rcpp_call_test_(SEXP x){
-		RCPP_RETURN_VECTOR( rcpp_call_test, x );
-	}
-	
 	SEXP convert_using_rfunction(SEXP x, const char* const fun) {
         SEXP res = R_NilValue ;
         try{
@@ -1353,10 +1345,6 @@
 } // internal
 } // Rcpp
 
-SEXP rcpp_call_test(SEXP x){
-	return Rf_ScalarInteger( ::Rcpp::internal::rcpp_call_test_(x) ) ;
-}
-
 SEXP as_character_externalptr(SEXP xp){
 	char buffer[20] ;
 	sprintf( buffer, "%p", (void*)EXTPTR_PTR(xp) ) ;

Modified: pkg/Rcpp/src/internal.h
===================================================================
--- pkg/Rcpp/src/internal.h	2012-12-15 22:06:56 UTC (rev 4159)
+++ pkg/Rcpp/src/internal.h	2012-12-15 22:12:38 UTC (rev 4160)
@@ -60,6 +60,7 @@
     
     CALLFUN_0(get_rcpp_cache);
     CALLFUN_0(init_Rcpp_cache);
+    
     CALLFUN_0(reset_current_error);
     CALLFUN_1(rcpp_error_recorder);
     CALLFUN_1(rcpp_set_current_error);
@@ -74,8 +75,7 @@
 
     CALLFUN_0(rcpp_capabilities) ;
     CALLFUN_0(rcpp_can_use_cxx0x) ;
-    CALLFUN_1(rcpp_call_test) ;
-
+    
     /* .External functions */
     EXTFUN(CppMethod__invoke) ;
     EXTFUN(CppMethod__invoke_void) ;



More information about the Rcpp-commits mailing list