[Rcpp-commits] r450 - pkg/inst/unitTests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jan 25 13:10:17 CET 2010
Author: edd
Date: 2010-01-25 13:10:16 +0100 (Mon, 25 Jan 2010)
New Revision: 450
Modified:
pkg/inst/unitTests/runit.RcppResultSet.R
Log:
make RcppDatetime test more defensive vis-a-vis timezone
Modified: pkg/inst/unitTests/runit.RcppResultSet.R
===================================================================
--- pkg/inst/unitTests/runit.RcppResultSet.R 2010-01-25 10:42:10 UTC (rev 449)
+++ pkg/inst/unitTests/runit.RcppResultSet.R 2010-01-25 12:10:16 UTC (rev 450)
@@ -108,14 +108,14 @@
}
test.RcppResultSet.RcppDatetime <- function() {
- src <- 'RcppDatetime y(946710123.456); // aka print(as.numeric(as.POSIXct(strptime("2000-01-01 01:02:03.456", "%Y-%m-%d %H:%M:%OS"))), digits=12)
+ src <- 'RcppDatetime y(x);
RcppResultSet rs;
rs.add("foo", y);
return rs.getReturnList();';
- funx <- cfunction(signature(), src, Rcpp=TRUE)
+ 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()[[1]], posixt, msg = "RcppResultSet.RcppDatetime")
+ checkEquals(funx(posixt)[[1]], posixt, msg = "RcppResultSet.RcppDatetime")
}
test.RcppResultSet.RcppDatetimeVector <- function() {
More information about the Rcpp-commits
mailing list