[Rprotobuf-commits] r402 - in pkg: . inst/doc inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 20 23:21:24 CEST 2010


Author: edd
Date: 2010-10-20 23:21:24 +0200 (Wed, 20 Oct 2010)
New Revision: 402

Modified:
   pkg/ChangeLog
   pkg/inst/doc/Makefile
   pkg/inst/unitTests/runit.addressbook.R
Log:
do not clean pdf files 
minor improvement to addressbook test


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2010-10-18 14:57:42 UTC (rev 401)
+++ pkg/ChangeLog	2010-10-20 21:21:24 UTC (rev 402)
@@ -1,3 +1,9 @@
+2010-10-20  Dirk Eddelbuettel  <deddelbuettel at wolve.com>
+
+	* inst/doc/Makefile: do not remove the pdf in 'clean'
+
+	* inst/unitTests/runit.addressbook.R: stick 'book' into global env.
+
 2010-10-18  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.1

Modified: pkg/inst/doc/Makefile
===================================================================
--- pkg/inst/doc/Makefile	2010-10-18 14:57:42 UTC (rev 401)
+++ pkg/inst/doc/Makefile	2010-10-20 21:21:24 UTC (rev 402)
@@ -2,7 +2,7 @@
 all: clean RProtoBuf-unitTests.pdf RProtoBuf.pdf RProtoBuf-quickref.pdf
 
 clean:
-	rm -fr *.pdf
+        #rm -fr *.pdf
 
 RProtoBuf-unitTests.pdf: unitTests/RProtoBuf-unitTests.R
 	Rscript --default-packages="RProtoBuf,Rcpp,brew,RUnit,tools,utils" unitTests/RProtoBuf-unitTests.R
@@ -30,4 +30,4 @@
 	rm -fr RProtoBuf-quickref.log
 	rm -fr RProtoBuf-quickref.out
 	cp RProtoBuf-quickref/RProtoBuf-quickref-fake.Rnw RProtoBuf-quickref.Rnw
-	
+

Modified: pkg/inst/unitTests/runit.addressbook.R
===================================================================
--- pkg/inst/unitTests/runit.addressbook.R	2010-10-18 14:57:42 UTC (rev 401)
+++ pkg/inst/unitTests/runit.addressbook.R	2010-10-20 21:21:24 UTC (rev 402)
@@ -5,23 +5,18 @@
 
 # this is executed before each test function -- but somehow does not work
 .setUp <- function() {
-    #file <- system.file( "examples", "addressbook.pb", package = "RProtoBuf" )
-    #book <- read( tutorial.AddressBook, file )
+    file <- system.file( "examples", "addressbook.pb", package = "RProtoBuf" )
+    book <- read( tutorial.AddressBook, file )
+    assign("book", book, globalenv())
 }
 
 test.size <- function() {
-    # re-set file and book
-    file <- system.file( "examples", "addressbook.pb", package = "RProtoBuf" )
-    book <- read( tutorial.AddressBook, file )
     checkEquals(book$size("person"),        2,   msg="Number of persons")
     checkEquals(bytesize(book),             125, msg="Bytes in book")
     checkEquals(bytesize(book$person[[1]]), 60,  msg="Bytes of first person message")
 }
 
 test.personOne <- function() {
-    # re-set file and book
-    file <- system.file( "examples", "addressbook.pb", package = "RProtoBuf" )
-    book <- read( tutorial.AddressBook, file )
     checkEquals(book$person[[1]]$name,              "Romain Francois",   msg="First person name")
     checkEquals(book$person[[2]]$name,              "Dirk Eddelbuettel", msg="First person name")
     checkEquals(book$person[[1]]$id,                1,   		 msg="First person id")



More information about the Rprotobuf-commits mailing list