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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 28 11:46:30 CEST 2010


Author: romain
Date: 2010-09-28 11:46:29 +0200 (Tue, 28 Sep 2010)
New Revision: 2226

Modified:
   pkg/Rcpp/inst/unitTests/runit.sugar.R
Log:
reenable runit.ifelse test (but it segfaults)

Modified: pkg/Rcpp/inst/unitTests/runit.sugar.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugar.R	2010-09-28 08:39:27 UTC (rev 2225)
+++ pkg/Rcpp/inst/unitTests/runit.sugar.R	2010-09-28 09:46:29 UTC (rev 2226)
@@ -237,10 +237,10 @@
 					NumericVector yy(y) ;
 					
 					return List::create( 
-						_["vec_vec" ]  = ifelse( xx < yy, xx*xx, -(yy*yy) ),  
-						_["vec_prim"]  = ifelse( xx < yy, 1.0  , -(yy*yy) ), 
-						_["prim_vec"]  = ifelse( xx < yy, xx*xx, 1.0      ),
-						_["prim_prim"] = ifelse( xx < yy, 1.0, 2.0        )
+						 _["vec_vec" ]  = ifelse( xx < yy, xx*xx, -(yy*yy) ),  
+						 _["vec_prim"]  = ifelse( xx < yy, 1.0  , -(yy*yy) ), 
+						 _["prim_vec"]  = ifelse( xx < yy, xx*xx, 1.0      ),
+						 _["prim_prim"] = ifelse( xx < yy, 1.0, 2.0        )
 						) ;
 				'				
 			), 
@@ -895,17 +895,17 @@
 }
 
 
-# test.sugar.ifelse <- function( ){
-# 	fx <- .rcpp.sugar$runit_ifelse
-# 	x <- as.numeric( 1:10 )
-# 	y <- as.numeric( 10:1 )
-# 	checkEquals( fx( x, y), list( 
-# 		"vec_vec"   = ifelse( x<y, x*x, -(y*y) ) ,
-# 		"vec_prim"  = ifelse( x<y, 1.0, -(y*y) ), 
-# 		"prim_vec"  = ifelse( x<y, x*x, 1.0    ), 
-# 		"prim_prim" = ifelse( x<y, 1.0, 2.0    )
-# 	) )
-# }
+test.sugar.ifelse <- function( ){
+	fx <- .rcpp.sugar$runit_ifelse
+	x <- 1:10
+	y <- 10:1
+	checkEquals( fx( x, y), list( 
+		"vec_vec"   = ifelse( x<y, x*x, -(y*y) ) ,
+		"vec_prim"  = ifelse( x<y, 1.0, -(y*y) ), 
+		"prim_vec"  = ifelse( x<y, x*x, 1.0    ), 
+		"prim_prim" = ifelse( x<y, 1.0, 2.0    )
+	) )
+}
 
 
 test.sugar.isna <- function( ){



More information about the Rcpp-commits mailing list