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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 12 04:46:04 CEST 2010


Author: edd
Date: 2010-06-12 04:46:03 +0200 (Sat, 12 Jun 2010)
New Revision: 1522

Modified:
   pkg/Rcpp/DESCRIPTION
   pkg/Rcpp/inst/unitTests/runit.RcppDate.R
   pkg/Rcpp/inst/unitTests/runit.RcppDatetime.R
Log:
add wrap() tests for RcppDate and RcppDatetime -- currently we still need an explicit wrap()
increase minor release so that RQuantLib can depend upon it


Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION	2010-06-12 00:52:14 UTC (rev 1521)
+++ pkg/Rcpp/DESCRIPTION	2010-06-12 02:46:03 UTC (rev 1522)
@@ -1,6 +1,6 @@
 Package: Rcpp
 Title: Rcpp R/C++ interface package
-Version: 0.8.2.1
+Version: 0.8.2.2
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois, with contributions 
  by Simon Urbanek, David Reiss and Douglas Bates; based on code written during 

Modified: pkg/Rcpp/inst/unitTests/runit.RcppDate.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppDate.R	2010-06-12 00:52:14 UTC (rev 1521)
+++ pkg/Rcpp/inst/unitTests/runit.RcppDate.R	2010-06-12 02:46:03 UTC (rev 1522)
@@ -44,16 +44,10 @@
     checkEquals(funx(), list(diff=1, bigger=1, smaller=0, equal=0, ge=1, le=0), msg = "RcppDate.operators")
 }
 
+test.RcppDate.wrap <- function() {
+    src <- 'RcppDate dt = RcppDate(12,31,1999);
+	    return wrap(dt);';
+    funx <- cppfunction(signature(), src)
+    checkEquals(funx(), as.Date("1999-12-31"), msg = "RcppDate.wrap")
+}
 
-
-
-
-
-
-
-
-
-
-
-
-

Modified: pkg/Rcpp/inst/unitTests/runit.RcppDatetime.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.RcppDatetime.R	2010-06-12 00:52:14 UTC (rev 1521)
+++ pkg/Rcpp/inst/unitTests/runit.RcppDatetime.R	2010-06-12 02:46:03 UTC (rev 1522)
@@ -52,16 +52,11 @@
                       list(diff=3600, bigger=1, smaller=0, equal=0, ge=1, le=0), msg = "RcppDatetime.operators")
 }
 
+test.RcppDatetime.wrap <- function() {
+    src <- 'RcppDatetime dt = RcppDatetime(981183723.123456);
+	    return wrap(dt);';
+    funx <- cppfunction(signature(), src)
+    checkEquals(as.numeric(funx()), as.numeric(as.POSIXct("2001-02-03 01:02:03.123456")),
+                msg = "RcppDatetime.wrap")
+}
 
-
-
-
-
-
-
-
-
-
-
-
-



More information about the Rcpp-commits mailing list