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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 25 11:00:55 CEST 2013


Author: romain
Date: 2013-07-25 11:00:54 +0200 (Thu, 25 Jul 2013)
New Revision: 4406

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/unitTests/cpp/dates.cpp
   pkg/Rcpp/inst/unitTests/runit.Date.R
Log:
remove the ignoreme useless parameters

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-07-25 08:15:34 UTC (rev 4405)
+++ pkg/Rcpp/ChangeLog	2013-07-25 09:00:54 UTC (rev 4406)
@@ -4,6 +4,8 @@
         DatetimeVector
         * include/Rcpp/Date.h : added is_na method
         * include/Rcpp/Datetime.h : added is_na method
+        * unitTests/cpp/dates.cpp : removed the ignoreme useless parameters
+        * unitTests/runit.Date.R : idem
         
 2013-07-24  Romain Francois <romain at r-enthusiasts.com>
 

Modified: pkg/Rcpp/inst/unitTests/cpp/dates.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/cpp/dates.cpp	2013-07-25 08:15:34 UTC (rev 4405)
+++ pkg/Rcpp/inst/unitTests/cpp/dates.cpp	2013-07-25 09:00:54 UTC (rev 4406)
@@ -29,13 +29,13 @@
 }
 
 // [[Rcpp::export]]
-SEXP ctor_mdy(int ignoreme) {
+SEXP ctor_mdy() {
     Date dt = Date(12,31,2005);
     return wrap(dt);
 }
 
 // [[Rcpp::export]]
-SEXP ctor_ymd(int ignoreme) {
+SEXP ctor_ymd() {
     Date dt = Date(2005,12,31);
     return wrap(dt);
 }
@@ -53,7 +53,7 @@
 }
 
 // [[Rcpp::export]]
-List operators(int ignoreme) {
+List operators() {
     Date d1 = Date(2005,12,31);
     Date d2 = d1 + 1;
     return List::create(Named("diff") = d1 - d2,
@@ -66,7 +66,7 @@
 }
 
 // [[Rcpp::export]]
-List components(int ignoreme) {
+List components() {
     Date d = Date(2005,12,31);
     return List::create(Named("day") = d.getDay(),
                         Named("month") = d.getMonth(),
@@ -76,7 +76,7 @@
 }
 
 // [[Rcpp::export]]
-SEXP vector_Date(int ignoreme) {
+SEXP vector_Date() {
     std::vector<Date> v(2) ;
     v[0] = Date(2005,12,31) ;
     v[1] = Date(12,31,2005) ;
@@ -84,7 +84,7 @@
 }
 
 // [[Rcpp::export]]
-SEXP Datevector_wrap(int ignoreme) {
+SEXP Datevector_wrap() {
     DateVector v(2) ;
     v[0] = Date(2005,12,31) ;
     v[1] = Date(12,31,2005) ;
@@ -92,7 +92,7 @@
 }
 
 // [[Rcpp::export]]
-SEXP Datevector_sexp(int ignoreme) {
+SEXP Datevector_sexp() {
     DateVector v(2) ;
     v[0] = Date(2005,12,31) ;
     v[1] = Date(12,31,2005) ;
@@ -123,7 +123,7 @@
 }
 
 // [[Rcpp::export]]
-List Datetime_operators(int ignoreme) {
+List Datetime_operators() {
     Datetime d1 = Datetime(946774923.123456);
     Datetime d2 = d1 + 60*60;
     return List::create(Named("diff") = d1 - d2,
@@ -136,7 +136,7 @@
 }
 
 // [[Rcpp::export]]
-SEXP Datetime_wrap(int ignoreme) {
+SEXP Datetime_wrap() {
     Datetime dt = Datetime(981162123.123456);
     return wrap(dt);
 }

Modified: pkg/Rcpp/inst/unitTests/runit.Date.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.Date.R	2013-07-25 08:15:34 UTC (rev 4405)
+++ pkg/Rcpp/inst/unitTests/runit.Date.R	2013-07-25 09:00:54 UTC (rev 4406)
@@ -49,13 +49,11 @@
 }
 
 test.Date.ctor.mdy <- function() {
-    fun <- ctor_mdy
-    checkEquals(fun(1), as.Date("2005-12-31"), msg = "Date.ctor.mdy")
+    checkEquals(ctor_mdy(), as.Date("2005-12-31"), msg = "Date.ctor.mdy")
 }
 
 test.Date.ctor.ymd <- function() {
-    fun <- ctor_ymd
-    checkEquals(fun(1), as.Date("2005-12-31"), msg = "Date.ctor.ymd")
+    checkEquals(ctor_ymd(), as.Date("2005-12-31"), msg = "Date.ctor.ymd")
 }
 
 test.Date.ctor.int <- function() {
@@ -77,32 +75,27 @@
 }
 
 test.Date.operators <- function() {
-    fun <- operators
-    checkEquals(fun(1),
+    checkEquals(operators(),
                 list(diff=-1, bigger=TRUE, smaller=FALSE, equal=FALSE, ge=TRUE, le=FALSE, ne=TRUE),
                 msg = "Date.operators")
 }
 
 test.Date.components <- function() {
-    fun <- components
-    checkEquals(fun(1),
+    checkEquals(components(),
                 list(day=31, month=12, year=2005, weekday=7, yearday=365),
                 msg = "Date.components")
 }
 
 test.vector.Date <- function(){
-    fun <- vector_Date
-    checkEquals(fun(1), rep(as.Date("2005-12-31"),2), msg = "Date.vector.wrap")
+    checkEquals(vector_Date(), rep(as.Date("2005-12-31"),2), msg = "Date.vector.wrap")
 }
 
 test.DateVector.wrap <- function(){
-    fun <- Datevector_wrap
-    checkEquals(fun(1), rep(as.Date("2005-12-31"),2), msg = "DateVector.wrap")
+    checkEquals(Datevector_wrap(), rep(as.Date("2005-12-31"),2), msg = "DateVector.wrap")
 }
 
 test.DateVector.operator.SEXP <- function(){
-    fun <- Datevector_sexp
-    checkEquals(fun(1), rep(as.Date("2005-12-31"),2), msg = "DateVector.SEXP")
+    checkEquals(Datevector_sexp(), rep(as.Date("2005-12-31"),2), msg = "DateVector.SEXP")
 }
 
 test.Date.getFunctions <- function(){
@@ -123,15 +116,13 @@
 }
 
 test.Datetime.operators <- function() {
-    fun <- Datetime_operators
-    checkEquals(fun(1),
+    checkEquals(Datetime_operators(),
                 list(diff=-60*60, bigger=TRUE, smaller=FALSE, equal=FALSE, ge=TRUE, le=FALSE, ne=TRUE),
                 msg = "Datetime.operators")
 }
 
 test.Datetime.wrap <- function() {
-    fun <- Datetime_wrap
-    checkEquals(as.numeric(fun(1)), as.numeric(as.POSIXct("2001-02-03 01:02:03.123456", tz="UTC")),
+    checkEquals(as.numeric(Datetime_wrap()), as.numeric(as.POSIXct("2001-02-03 01:02:03.123456", tz="UTC")),
                 msg = "Datetime.wrap")
 }
 



More information about the Rcpp-commits mailing list