[Rprotobuf-commits] r435 - in pkg: . inst inst/unitTests src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Mar 21 04:08:41 CET 2012
Author: edd
Date: 2012-03-21 04:08:40 +0100 (Wed, 21 Mar 2012)
New Revision: 435
Modified:
pkg/ChangeLog
pkg/DESCRIPTION
pkg/inst/NEWS
pkg/inst/unitTests/runit.golden.message.R
pkg/src/mutators.cpp
Log:
new patch by Murray
Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog 2011-11-07 14:20:24 UTC (rev 434)
+++ pkg/ChangeLog 2012-03-21 03:08:40 UTC (rev 435)
@@ -1,3 +1,9 @@
+2012-03-20 Dirk Eddelbuettel <edd at debian.org>
+
+ * Applied another patch by Murray:
+ - src/mutators.cpp: Deal with case of repeated strings
+ - inst/unitTests/runit.golden.message.R: test for this case
+
2011-07-17 Dirk Eddelbuettel <edd at debian.org>
* Applied another patch by Murray:
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2011-11-07 14:20:24 UTC (rev 434)
+++ pkg/DESCRIPTION 2012-03-21 03:08:40 UTC (rev 435)
@@ -1,5 +1,5 @@
Package: RProtoBuf
-Version: 0.2.4
+Version: 0.2.4.1
Date: $Date$
Author: Romain Francois <romain at r-enthusiasts.com> and Dirk Eddelbuettel <edd at debian.org>
Maintainer: Romain and Dirk <RomainAndDirk at r-enthusiasts.com>
Modified: pkg/inst/NEWS
===================================================================
--- pkg/inst/NEWS 2011-11-07 14:20:24 UTC (rev 434)
+++ pkg/inst/NEWS 2012-03-21 03:08:40 UTC (rev 435)
@@ -1,8 +1,8 @@
0.2.4 future
- o changes to handle int64, etc ... fields better. Based on the new
- int64 package and related changes in Rcpp. This work has been sponsored by
- the Google Open Source Programs Office
+ o changes to handle int64, etc ... fields better. Based on the new
+ int64 package and related changes in Rcpp. This work has been
+ sponsored by the Google Open Source Programs Office
0.2.3 2011-04-12
Modified: pkg/inst/unitTests/runit.golden.message.R
===================================================================
--- pkg/inst/unitTests/runit.golden.message.R 2011-11-07 14:20:24 UTC (rev 434)
+++ pkg/inst/unitTests/runit.golden.message.R 2012-03-21 03:08:40 UTC (rev 435)
@@ -60,4 +60,9 @@
test <- new(protobuf_unittest.TestAllTypes)
test$add("repeated_int32", c(1:5))
checkEquals(test$repeated_int32, c(1:5))
+
+ # Prior to RProtoBuf v0.2.5, this was not handled properly.
+ test.2 <- new(protobuf_unittest.TestAllTypes,
+ repeated_string=c("foo", "bar"))
+ checkEquals(test.2$repeated_string, c("foo", "bar"))
}
Modified: pkg/src/mutators.cpp
===================================================================
--- pkg/src/mutators.cpp 2011-11-07 14:20:24 UTC (rev 434)
+++ pkg/src/mutators.cpp 2012-03-21 03:08:40 UTC (rev 435)
@@ -396,6 +396,8 @@
if( field_type == TYPE_STRING || field_type == TYPE_BYTES ){
if( TYPEOF(value) == RAWSXP ){
value_size = 1 ;
+ } else if( TYPEOF(value) == STRSXP ){
+ value_size = LENGTH(value);
} else if( TYPEOF(value) == S4SXP && Rf_inherits( value, "Message") ){
value_size = 1 ; /* we will store the message payload */
} else if( TYPEOF(value) == VECSXP && allAreMessages( value ) ){
@@ -1159,4 +1161,3 @@
}
} // namespace rprotobuf
-
More information about the Rprotobuf-commits
mailing list