[Rcpp-commits] r4050 - in pkg/Rcpp: . inst/unitTests inst/unitTests/cpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 29 14:32:13 CET 2012


Author: romain
Date: 2012-11-29 14:32:12 +0100 (Thu, 29 Nov 2012)
New Revision: 4050

Modified:
   pkg/Rcpp/DESCRIPTION
   pkg/Rcpp/inst/unitTests/cpp/reg_tests_0_10_1.cpp
   pkg/Rcpp/inst/unitTests/cpp/sugar.cpp
   pkg/Rcpp/inst/unitTests/runit.reg_0_10_1.R
   pkg/Rcpp/inst/unitTests/runit.sugar.R
Log:
moving sugar tests to runit.sugar.R

Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION	2012-11-29 10:21:33 UTC (rev 4049)
+++ pkg/Rcpp/DESCRIPTION	2012-11-29 13:32:12 UTC (rev 4050)
@@ -1,6 +1,6 @@
 Package: Rcpp
 Title: Seamless R and C++ Integration
-Version: 0.10.1
+Version: 0.10.1.1
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois, with contributions 
  by Douglas Bates, John Chambers and JJ Allaire

Modified: pkg/Rcpp/inst/unitTests/cpp/reg_tests_0_10_1.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/cpp/reg_tests_0_10_1.cpp	2012-11-29 10:21:33 UTC (rev 4049)
+++ pkg/Rcpp/inst/unitTests/cpp/reg_tests_0_10_1.cpp	2012-11-29 13:32:12 UTC (rev 4050)
@@ -6,36 +6,3 @@
     return df.nrows() ;
 }
 
-// [[Rcpp::export]]
-double RangeIndexer_sugar( NumericVector x ){
-    return max( x[ seq(0, 4) ] ) ;    
-}
-
-// [[Rcpp::export]]
-IntegerVector test_self_match( CharacterVector x){
-    return self_match( x ) ;
-}
-
-// [[Rcpp::export]]
-IntegerVector test_table( CharacterVector x){
-    return table( x ) ;
-}
-
-// [[Rcpp::export]]
-LogicalVector test_duplicated( CharacterVector x){
-    return duplicated( x ) ;
-}
-
-// [[Rcpp::export]]
-IntegerVector test_union( IntegerVector x, IntegerVector y){
-    return union_( x, y) ;
-}
-// [[Rcpp::export]]
-IntegerVector test_setdiff( IntegerVector x, IntegerVector y){
-    return setdiff( x, y) ;
-}
-// [[Rcpp::export]]
-IntegerVector test_intersect( IntegerVector x, IntegerVector y){
-    return intersect( x, y ) ;
-}
-

Modified: pkg/Rcpp/inst/unitTests/cpp/sugar.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/cpp/sugar.cpp	2012-11-29 10:21:33 UTC (rev 4049)
+++ pkg/Rcpp/inst/unitTests/cpp/sugar.cpp	2012-11-29 13:32:12 UTC (rev 4050)
@@ -541,3 +541,37 @@
     return res ;
 }
 
+// [[Rcpp::export]]
+double runit_RangeIndexer( NumericVector x ){
+    return max( x[ seq(0, 4) ] ) ;    
+}
+
+// [[Rcpp::export]]
+IntegerVector runit_self_match( CharacterVector x){
+    return self_match( x ) ;
+}
+
+// [[Rcpp::export]]
+IntegerVector runit_table( CharacterVector x){
+    return table( x ) ;
+}
+
+// [[Rcpp::export]]
+LogicalVector runit_duplicated( CharacterVector x){
+    return duplicated( x ) ;
+}
+
+// [[Rcpp::export]]
+IntegerVector runit_union( IntegerVector x, IntegerVector y){
+    return union_( x, y) ;
+}
+// [[Rcpp::export]]
+IntegerVector runit_setdiff( IntegerVector x, IntegerVector y){
+    return setdiff( x, y) ;
+}
+// [[Rcpp::export]]
+IntegerVector runit_intersect( IntegerVector x, IntegerVector y){
+    return intersect( x, y ) ;
+}
+
+

Modified: pkg/Rcpp/inst/unitTests/runit.reg_0_10_1.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.reg_0_10_1.R	2012-11-29 10:21:33 UTC (rev 4049)
+++ pkg/Rcpp/inst/unitTests/runit.reg_0_10_1.R	2012-11-29 13:32:12 UTC (rev 4050)
@@ -25,37 +25,6 @@
     checkEquals( DataFrame_nrows( iris ), nrow(iris) )  
 }
 
-test.RangeIndexer <- function(){
-    x <- rnorm(10)
-    checkEquals( RangeIndexer_sugar(x), max(x[1:5]) )    
-}
-
-test.self_match <- function(){
-    x <- sample( letters, 1000, replace = TRUE )
-    checkEquals( test_self_match(x), match(x,unique(x)) )    
-}
-
-test.table <- function(){
-    x <- sample( letters, 1000, replace = TRUE )
-    checkTrue( all( test_table(x) == table(x) ) )
-    checkTrue( all( names(test_table(x)) == names(table(x)) ) )
-}
-
-test.duplicated <- function(){
-    x <- sample( letters, 1000, replace = TRUE )
-    checkEquals( test_duplicated(x), duplicated(x) )
-}
-
-test.setdiff <- function(){
-    checkEquals( test_setdiff( 1:10, 1:5 ), setdiff( 1:10, 1:5 ) )
-}
-test.union <- function(){
-    checkEquals( test_union( 1:10, 1:5 ), union( 1:10, 1:5 ) )
-}
-test.intersect <- function(){
-    checkEquals( test_intersect( 1:10, 1:5 ), intersect( 1:10, 1:5 ) )
-}
-
 test.AreMacrosDefined <- function(){
     checkTrue( Rcpp:::areMacrosDefined( "__cplusplus" ) )    
 }

Modified: pkg/Rcpp/inst/unitTests/runit.sugar.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugar.R	2012-11-29 10:21:33 UTC (rev 4049)
+++ pkg/Rcpp/inst/unitTests/runit.sugar.R	2012-11-29 13:32:12 UTC (rev 4050)
@@ -662,4 +662,37 @@
     checkEquals( fx(x, 3), signif(x, 3) )
 }
 
+test.RangeIndexer <- function(){
+    x <- rnorm(10)
+    checkEquals( runit_RangeIndexer(x), max(x[1:5]) )    
 }
+
+test.self_match <- function(){
+    x <- sample( letters, 1000, replace = TRUE )
+    checkEquals( runit_self_match(x), match(x,unique(x)) )    
+}
+
+test.table <- function(){
+    x <- sample( letters, 1000, replace = TRUE )
+    checkTrue( all( runit_table(x) == table(x) ) )
+    checkTrue( all( names(runit_table(x)) == names(table(x)) ) )
+}
+
+test.duplicated <- function(){
+    x <- sample( letters, 1000, replace = TRUE )
+    checkEquals( runit_duplicated(x), duplicated(x) )
+}
+
+test.setdiff <- function(){
+    checkEquals( runit_setdiff( 1:10, 1:5 ), setdiff( 1:10, 1:5 ) )
+}
+
+test.union <- function(){
+    checkEquals( runit_union( 1:10, 1:5 ), union( 1:10, 1:5 ) )
+}
+
+test.intersect <- function(){
+    checkEquals( runit_intersect( 1:10, 1:5 ), intersect( 1:10, 1:5 ) )
+}
+
+}



More information about the Rcpp-commits mailing list