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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 27 23:22:23 CET 2010


Author: edd
Date: 2010-01-27 23:22:22 +0100 (Wed, 27 Jan 2010)
New Revision: 493

Modified:
   pkg/inst/unitTests/runit.RcppResultSet.R
Log:
now pass down a double created on the fly as as.numeric(as.POSIXct(txt))
and compare that -- much better approach


Modified: pkg/inst/unitTests/runit.RcppResultSet.R
===================================================================
--- pkg/inst/unitTests/runit.RcppResultSet.R	2010-01-27 22:18:52 UTC (rev 492)
+++ pkg/inst/unitTests/runit.RcppResultSet.R	2010-01-27 22:22:22 UTC (rev 493)
@@ -107,16 +107,15 @@
     checkEquals(funx(v)[[1]], v, msg = "RcppResultSet.RcppDateVector")
 }
 
-## test.RcppResultSet.RcppDatetime <- function() {
-##     src <- 'RcppDatetime y(x);
-##             RcppResultSet rs;
-##             rs.add("foo", y);
-## 	    return rs.getReturnList();';
-##     funx <- cfunction(signature(x="ANY"), src, Rcpp=TRUE)
-##     posixt <- as.POSIXct(strptime("2000-01-01 01:02:03.456", "%Y-%m-%d %H:%M:%OS"))
-##     attr(posixt, "tzone") <- NULL  # no attribute gets set at the C++ level
-##     checkEquals(funx(as.numeric(posixt))[[1]], posixt, msg = "RcppResultSet.RcppDatetime")
-## }
+test.RcppResultSet.RcppDatetime <- function() {
+     src <- 'RcppDatetime y(x);
+             RcppResultSet rs;
+             rs.add("foo", y);
+  	     return rs.getReturnList();';
+     funx <- cfunction(signature(x="numeric"), src, Rcpp=TRUE)
+     posixt <- as.POSIXct("2000-01-01 01:02:03.456", "%Y-%m-%d %H:%M:%OS")
+     checkEquals(funx(as.numeric(posixt))[[1]], posixt, msg = "RcppResultSet.RcppDatetime")
+}
 
 test.RcppResultSet.RcppDatetimeVector <- function() {
     src <- 'RcppDatetimeVector y(x);



More information about the Rcpp-commits mailing list