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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 2 05:18:48 CEST 2011


Author: edd
Date: 2011-04-02 05:18:48 +0200 (Sat, 02 Apr 2011)
New Revision: 2932

Modified:
   pkg/RcppClassic/ChangeLog
   pkg/RcppClassic/inst/unitTests/runit.RcppDate.R
Log:
renamed 'wrap' test function which no longer passes (due to confusion with Rcpp's template 'wrap' I presume)
minor other cleanups


Modified: pkg/RcppClassic/ChangeLog
===================================================================
--- pkg/RcppClassic/ChangeLog	2011-03-24 16:23:44 UTC (rev 2931)
+++ pkg/RcppClassic/ChangeLog	2011-04-02 03:18:48 UTC (rev 2932)
@@ -1,3 +1,8 @@
+2011-04-01  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/unitTests/runit.RcppDate.R: renamed 'wrap' test function which
+	clashes with the templated function from Rcpp itself, minor cleanups
+
 2011-02-28  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/doc/Makefile: Call R and Rscript relative to R_HOME/bin

Modified: pkg/RcppClassic/inst/unitTests/runit.RcppDate.R
===================================================================
--- pkg/RcppClassic/inst/unitTests/runit.RcppDate.R	2011-03-24 16:23:44 UTC (rev 2931)
+++ pkg/RcppClassic/inst/unitTests/runit.RcppDate.R	2011-04-02 03:18:48 UTC (rev 2932)
@@ -31,7 +31,7 @@
                            rs.add("julian",dt.getJulian());
                            return rs.getReturnList();')
 
-                          ,"operators"=list(
+                          ,"RcppDate_operators"=list(
                            signature(),
                           'RcppDate d1 = RcppDate(12,31,1999);
                            RcppDate d2 = d1 + 1;
@@ -44,7 +44,7 @@
                            rs.add("le",      d2 <= d1);
                            return rs.getReturnList();')
 
-                          ,"wrap"=list(
+                          ,"RcppDate_wrap"=list(
                            signature(),
                           'RcppDate dt = RcppDate(12,31,1999);
                            return wrap(dt);')
@@ -67,7 +67,7 @@
                            signature(x="numeric"),
                            'RcppDatetime d1 = RcppDatetime(946774923.123456);
 				            //RcppDatetime d1 = RcppDatetime(1152338523.456789);
-							// as.POSIXct("2006-07-08 01:02:03.456789")
+						    // as.POSIXct("2006-07-08 01:02:03.456789")
 				            RcppDatetime d2 = d1 + 60*60;
 				            RcppResultSet rs;
         	    	        rs.add("diff",    d2 - d1);
@@ -100,23 +100,23 @@
 }
 
 test.RcppDate.operators <- function() {
-    fun <- .rcpp.RcppDate$operators
+    fun <- .rcpp.RcppDate$RcppDate_operators
     checkEquals(fun(), list(diff=1, bigger=TRUE, smaller=FALSE, equal=FALSE, ge=TRUE, le=FALSE),
                 msg = "RcppDate.operators")
 }
 
 test.RcppDate.wrap <- function() {
-    fun <- .rcpp.RcppDate$wrap
+    fun <- .rcpp.RcppDate$RcppDate_wrap
     checkEquals(fun(), as.Date("1999-12-31"), msg = "RcppDate.wrap")
 }
 
-#test.RcppDatetime.get.functions <- function() {
-#    fun <- .rcpp.RcppDate$RcppDatetime_functions
-#    checkEquals(#fun(as.numeric(as.POSIXct("2001-02-03 01:02:03.123456", tz="UTC"))),
-#                fun(981162123.123456),
-#                list(year=2001, month=2, day=3, wday=6, hour=1, minute=2, second=3, microsec=123456),
-#                msg = "RcppDate.get.functions")
-#}
+test.RcppDatetime.get.functions <- function() {
+    fun <- .rcpp.RcppDate$RcppDatetime_functions
+    checkEquals(#fun(as.numeric(as.POSIXct("2001-02-03 01:02:03.123456", tz="UTC"))),
+                fun(981162123.123456),
+                list(year=2001, month=2, day=3, wday=6, hour=1, minute=2, second=3, microsec=123456),
+                msg = "RcppDate.get.functions")
+}
 
 test.RcppDatetime.operators <- function() {
     fun <- .rcpp.RcppDate$RcppDatetime_operators



More information about the Rcpp-commits mailing list