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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 17 22:53:42 CEST 2010


Author: romain
Date: 2010-06-17 22:53:42 +0200 (Thu, 17 Jun 2010)
New Revision: 1583

Modified:
   pkg/Rcpp/inst/unitTests/runit.sugar.plus.R
Log:
some more tests

Modified: pkg/Rcpp/inst/unitTests/runit.sugar.plus.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugar.plus.R	2010-06-17 20:18:31 UTC (rev 1582)
+++ pkg/Rcpp/inst/unitTests/runit.sugar.plus.R	2010-06-17 20:53:42 UTC (rev 1583)
@@ -24,11 +24,12 @@
 		return List::create(
 			xx + 10, 
 			10 + xx, 
-			xx + xx
+			xx + xx, 
+			xx + xx + xx
 			) ;
 	', plugin = "Rcpp" )
 	
-	checkEquals( fx(1:10) , list( 11:20,11:20,1:10+1:10)  )
+	checkEquals( fx(1:10) , list( 11:20,11:20,1:10+1:10, 3*(1:10))  )
 }
 
 test.sugar.plus.seqlen <- function( ){
@@ -44,3 +45,13 @@
 	checkEquals( fx() , list( 11:20,11:20, 1:10+1:10)  )
 }
 
+test.sugar.plus.all <- function( ){
+
+	fx <- cxxfunction( signature( x = "integer" ), '
+		IntegerVector xx(x) ;
+		return all( (xx+xx) < 10 ) ;
+	', plugin = "Rcpp" )
+	
+	checkEquals( fx(1:10) , FALSE )
+}
+



More information about the Rcpp-commits mailing list