[Rcpp-commits] r1252 - in pkg/Rcpp/inst: include/Rcpp/traits unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 17 09:39:30 CEST 2010


Author: romain
Date: 2010-05-17 09:39:29 +0200 (Mon, 17 May 2010)
New Revision: 1252

Modified:
   pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
   pkg/Rcpp/inst/unitTests/runit.macros.R
Log:
try to regression test long long support

Modified: pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-05-17 07:24:56 UTC (rev 1251)
+++ pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-05-17 07:39:29 UTC (rev 1252)
@@ -34,7 +34,7 @@
 /**
  * unknown. Implicit conversion to SEXP will be tried.
  */
-struct wrap_type_unknown_tag{};          // unknown, not sure what to do with this type
+struct wrap_type_unknown_tag{};
 
 /**
  * Type trait that helps the dispatch of wrap to the proper method

Modified: pkg/Rcpp/inst/unitTests/runit.macros.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.macros.R	2010-05-17 07:24:56 UTC (rev 1251)
+++ pkg/Rcpp/inst/unitTests/runit.macros.R	2010-05-17 07:39:29 UTC (rev 1252)
@@ -141,13 +141,12 @@
 	' )
 	checkEquals( f_back(xp), 5L, msg = "RCPP_XP_METHOD_0" )
 
-	info <- .getInfo( "get_back", f_size )
+	info <- .getInfo( "get_back", f_back )
 	checkEquals( info[["n"]], 0L )
 	checkEquals( info[["class"]], "std::vector<int>" )
 	checkEquals( info[["method"]], "back")
 	checkEquals( class(info), "rcppxpmethodinfo" )
-
-
+	
 	f_push_back <- cppfunction( signature( xp = "externalptr", x = "integer" ), '
 		vec_push_back( xp, x );
 		return R_NilValue ;
@@ -218,4 +217,18 @@
 
 }
 
+### regression test for long long support
+test.long.long <- function(){
+	
+	fx <- cppfunction( signature(), '
+		return foo() ;
+	', includes = '
+	RCPP_FUNCTION_0(size_t, foo){
+		std::vector<int> v(10) ;
+		return v.size() ;
+	}
+	')
+	checkEquals( as.integer(fx()), 10L, msg = "long long support" )
 
+}
+



More information about the Rcpp-commits mailing list