[Rcpp-commits] r2921 - in pkg/RcppArmadillo: . inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 2 15:42:53 CET 2011


Author: edd
Date: 2011-03-02 15:42:53 +0100 (Wed, 02 Mar 2011)
New Revision: 2921

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R
Log:
added simple unit test suggested by Conrad


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-03-02 13:26:50 UTC (rev 2920)
+++ pkg/RcppArmadillo/ChangeLog	2011-03-02 14:42:53 UTC (rev 2921)
@@ -4,9 +4,11 @@
 
 	* inst/include/*: Updated to Armadillo 1.1.6 “Baby Carpet Shark”
 
-	* inst/include/RcppArmadillo/Row_meat.h: Support RTTI via vec_stat
-	* inst/include/RcppArmadillo/Col_meat.h: Support RTTI via vec_stat
+	* inst/include/RcppArmadillo/Row_meat.h: Support RTTI via vec_state
+	* inst/include/RcppArmadillo/Col_meat.h: Support RTTI via vec_state
 
+	* inst/unitTests/runit.RcppArmadillo.R: Added unit test for above
+
 2011-02-28  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/doc/Makefile: Call R and Rscript relative to R_HOME/bin

Modified: pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R
===================================================================
--- pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R	2011-03-02 13:26:50 UTC (rev 2920)
+++ pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R	2011-03-02 14:42:53 UTC (rev 2921)
@@ -329,3 +329,19 @@
 
 }
 
+test.armadillo.rtti.check <- function() {
+
+    inc <- '
+    void blah(arma::mat& X) {
+         X.set_size(5,5);
+    }
+    '
+    src <- '
+    arma::vec V;
+    blah(V); // if blah() worked, we have a problem
+    '
+    fun <- cxxfunction(signature(), body=src, inc=inc, plugin = "RcppArmadillo")
+
+    checkException(fun(), msg="RTTI check on matrix constructor exception")
+
+}



More information about the Rcpp-commits mailing list