[R-gregmisc-users] SF.net SVN: r-gregmisc:[1834] trunk/SASxport
Brought to you by:
warnes
From: <wa...@us...> - 2014-07-18 12:08:06
|
Revision: 1834 http://sourceforge.net/p/r-gregmisc/code/1834 Author: warnes Date: 2014-07-18 12:08:03 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Remove SASxport:::assert() and replace all uses with stopifnot() Modified Paths: -------------- trunk/SASxport/DESCRIPTION trunk/SASxport/inst/NEWS trunk/SASxport/tests/Alfalfa_Test.R trunk/SASxport/tests/Theoph.R trunk/SASxport/tests/cars.R trunk/SASxport/tests/testNegative.R trunk/SASxport/tests/testNumeric.R trunk/SASxport/tests/testUnnamedComponents.R trunk/SASxport/tests/test_as_is.R trunk/SASxport/tests/test_fields.R trunk/SASxport/tests/xxx.R Removed Paths: ------------- trunk/SASxport/R/assert.R Modified: trunk/SASxport/DESCRIPTION =================================================================== --- trunk/SASxport/DESCRIPTION 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/DESCRIPTION 2014-07-18 12:08:03 UTC (rev 1834) @@ -1,8 +1,8 @@ Package: SASxport Type: Package Title: Read and Write SAS XPORT Files -Version: 1.4.1 -Date: 2014-07-16 +Version: 1.4.2 +Date: 2014-07-17 Description: This package provides functions for reading, listing the contents of, and writing SAS xport format files. The functions support reading and writing of either Deleted: trunk/SASxport/R/assert.R =================================================================== --- trunk/SASxport/R/assert.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/R/assert.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -1,6 +0,0 @@ -## useful function, raises an error if the FLAG expression is FALSE -assert <- function( FLAG ) - { - if(!all(FLAG)) - stop("Failed Assertion") - } Modified: trunk/SASxport/inst/NEWS =================================================================== --- trunk/SASxport/inst/NEWS 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/inst/NEWS 2014-07-18 12:08:03 UTC (rev 1834) @@ -1,3 +1,15 @@ +Version 1.4.2 - 2014-07-17 +-------------------------- + +Bug fixes: + +- Explicitly cast left shifts in ibm2ieee.c to avoid undefined + behavior. (Reported by Brian Ripley) + +- Resolve problem in accessing "Hmisc::label.default<-" if + SASxport::read.xport is called without loading SASxport. (Reported + by Dominic Comtois) + Version 1.4.1 - 2014-07-16 -------------------------- @@ -4,10 +16,10 @@ Bug fixes: - 'read.xport' now preserves '$' at the beginning of SAS character - format and iformat strings. + format and iformat strings. (Reported by Dominic Comtois) -- 'read.xport' argument names.tolower was not being honored for dataset - names. +- 'read.xport' argument names.tolower was not being honored for + dataset names. (Reported by Dominic Comtois) Version 1.4.0 - 2014-04-09 -------------------------- Modified: trunk/SASxport/tests/Alfalfa_Test.R =================================================================== --- trunk/SASxport/tests/Alfalfa_Test.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/Alfalfa_Test.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -21,4 +21,4 @@ a.2 <- readBin( con="Alfalfa2.xpt", what=raw(), n=3600 ) ## Test that the files are identical -SASxport:::assert( all(a.1 == a.2) ) +stopifnot( all(a.1 == a.2) ) Modified: trunk/SASxport/tests/Theoph.R =================================================================== --- trunk/SASxport/tests/Theoph.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/Theoph.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -15,6 +15,6 @@ ## Test equality, handling the ordered factor Subject separately because ## SAS xport files don't provide a mechanism for storing factor orders -SASxport:::assert( all( as.character(Theoph$Subject) == as.character(Theoph.2$Subject) )) -SASxport:::assert( all(Theoph[,-1] == Theoph.2[,-1]) ) +stopifnot( all( as.character(Theoph$Subject) == as.character(Theoph.2$Subject) )) +stopifnot( all(Theoph[,-1] == Theoph.2[,-1]) ) Modified: trunk/SASxport/tests/cars.R =================================================================== --- trunk/SASxport/tests/cars.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/cars.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -24,4 +24,4 @@ a.2 <- readBin( con="cars2.xpt", what=raw(), n=1e5) ## Test that the files are identical -SASxport:::assert( all(a.1 == a.2) ) +stopifnot( all(a.1 == a.2) ) Modified: trunk/SASxport/tests/testNegative.R =================================================================== --- trunk/SASxport/tests/testNegative.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/testNegative.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -8,10 +8,10 @@ print(df1) print(df2) -SASxport:::assert(all(df1==df2)) +stopifnot(all(df1==df2)) df3 <- data.frame(x.continuous=seq(-100,100,by=0.5), x.integer=as.integer(seq(-100,100,by=0.5)) ) write.xport(df3, file='df3.xpt') df4 <- read.xport(file='df3.xpt') -SASxport:::assert(all(df3==df4)) +stopifnot(all(df3==df4)) Modified: trunk/SASxport/tests/testNumeric.R =================================================================== --- trunk/SASxport/tests/testNumeric.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/testNumeric.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -16,7 +16,7 @@ write.xport(df, file='testNumeric.xpt') df.2 <- read.xport(file='testNumeric.xpt') -SASxport:::assert( all(df == df.2, na.rm=TRUE) ) +stopifnot( all(df == df.2, na.rm=TRUE) ) df.2 # this gets properly handled @@ -25,6 +25,6 @@ df.2 <- read.xport(file='testNumeric.xpt') -SASxport:::assert(all(df==df.2,na.rm=TRUE)) +stopifnot(all(df==df.2,na.rm=TRUE)) df.2 Modified: trunk/SASxport/tests/testUnnamedComponents.R =================================================================== --- trunk/SASxport/tests/testUnnamedComponents.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/testUnnamedComponents.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -48,11 +48,11 @@ ### Check that we catch invalid parameters failure <- try( write.xport(5,"a.xpt") ) #10.a -SASxport:::assert( "try-error" %in% class(failure) ) #10.b +stopifnot( "try-error" %in% class(failure) ) #10.b (tmp <- read.xport("a.xpt")) #10.c failure <- try( write.xport(list(a=5,b=6),"a.xpt") ) #11.a -SASxport:::assert( "try-error" %in% class(failure) ) #11.b +stopifnot( "try-error" %in% class(failure) ) #11.b (tmp <- read.xport("a.xpt")) #10.c # Check with different list construction function *name* Modified: trunk/SASxport/tests/test_as_is.R =================================================================== --- trunk/SASxport/tests/test_as_is.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/test_as_is.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -8,7 +8,7 @@ x <- read.xport('puromycin.xpt') str(x) -SASxport:::assert( class(x$STATE)=="factor" ) +stopifnot( class(x$STATE)=="factor" ) ## When as.is=TRUE, character variable "STATE" should be preserved as ## a character variable. @@ -16,6 +16,6 @@ x <- read.xport('puromycin.xpt',as.is=TRUE) str(x) -SASxport:::assert( class(x$STATE)=="character" ) +stopifnot( class(x$STATE)=="character" ) Modified: trunk/SASxport/tests/test_fields.R =================================================================== --- trunk/SASxport/tests/test_fields.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/test_fields.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -5,4 +5,4 @@ .C("doTest",PACKAGE="SASxport") -## Successful completion means all SASxport:::assertions have been met +## Successful completion means all assertions have been met Modified: trunk/SASxport/tests/xxx.R =================================================================== --- trunk/SASxport/tests/xxx.R 2014-07-18 11:32:48 UTC (rev 1833) +++ trunk/SASxport/tests/xxx.R 2014-07-18 12:08:03 UTC (rev 1834) @@ -50,7 +50,7 @@ a.1[1089] <- as.raw("0x2e") ## Test that the files are otherwise identical -SASxport:::assert( all(a.1 == a.2) ) -SASxport:::assert( all(a.1 == a.3) ) +stopifnot( all(a.1 == a.2) ) +stopifnot( all(a.1 == a.3) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |