[Rprotobuf-commits] r632 - pkg/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 30 19:21:08 CET 2013


Author: murray
Date: 2013-12-30 19:21:07 +0100 (Mon, 30 Dec 2013)
New Revision: 632

Modified:
   pkg/inst/unitTests/runit.extremevalues.R
Log:
Also test that fixed32 types can handle large unsigned values like
2^32 - 1.



Modified: pkg/inst/unitTests/runit.extremevalues.R
===================================================================
--- pkg/inst/unitTests/runit.extremevalues.R	2013-12-30 18:03:13 UTC (rev 631)
+++ pkg/inst/unitTests/runit.extremevalues.R	2013-12-30 18:21:07 UTC (rev 632)
@@ -30,3 +30,12 @@
                 "4294967295")
     checkEquals(foo$optional_uint32,
                 foo$repeated_uint32[[1]])
+
+    # fixed32 are a more efficient representation of uint32
+    foo$optional_fixed32 <- 2^32 - 1
+    foo$repeated_fixed32 <- c(foo$optional_fixed32, foo$optional_fixed32)
+    checkEquals(as.character(foo$optional_fixed32),
+                "4294967295")
+    checkEquals(foo$optional_fixed32,
+                foo$repeated_fixed32[[1]])
+}



More information about the Rprotobuf-commits mailing list