aboutsummaryrefslogtreecommitdiff
path: root/javanano/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of https://github.com/zsurocking/protobufXiao Hang2015-08-0420-28/+28
|\
* | Generate a package name suffix ".nano" for nano messagesXiao Hang2015-07-291-5/+5
|/ | | | Also introducing an option javanano_use_deprecated_package to allow users to disable the suffix
* Throw OutOfSpaceException instead of IllegalArgumentException.Charles Munger2015-04-281-0/+18
| | | | | | | | | | | | | When a MessageNano containing a String is serialized into a buffer that is too small to contain it, and the buffer's boundary happens to be where the string field's length delimiting varint is serialized, and the string's length and 3*length have the same length when encoded as a varint, an IllegalArgumentException is thrown rather than an OutOfSpaceException. Github issue: https://github.com/google/protobuf/issues/292 Change-Id: If478d68cf15bfd0662252d008e42b2bf1ff1c75e
* Add clone() method support for nano.Brian Duff2015-04-282-0/+21
| | | | | | Upstreamed from Another Place (cr/57247854). Change-Id: I2aaf59544c0f5ae21a51891d8a5eeda1dc722c90
* When no clear() is generated, still initialize fields.Brian Duff2015-04-281-0/+6
| | | | | | | | | | | | | | | | https://android-review.googlesource.com/#/c/67890/ removed field initialization from the ctor, making it just call clear() instead. When I added the generate_clear option back (as part of the reftypes compat mode) in https://android-review.googlesource.com/#/c/109530/, I forgot to ensure that what clear() used to do was inlined in the constructor. This change fixes NPEs that are happening for users of reftypes_compat_mode who rely on unset repeated fields being empty arrays rather than null. Change-Id: Idb58746c60f4a4054b7ebb5c3b0e76b16ff88184
* Optimize measurement and serialization of nano protos.Charles Munger2015-04-281-0/+36
| | | | | | | Measuring the serialized size of nano protos is now a zero-alloc operation, and serializing a proto now allocates no memory (other than the output buffer) instead of O(total length of strings). Change-Id: Id5e2ac3bdc4ac56c0bf13d725472da3a00c9baec Signed-off-by: Charles Munger <clm@google.com>
* Fix bug with large extension field numbers.Brian Duff2015-04-281-0/+3
| | | | | | | | | | | | | | | | | | | Previously, extensions with field numbers greater than 268435455 would result in a compile time error in generated code that looks something like this: Foo.java:3178: error: integer number too large: 3346754610 3346754610); This is because we were trying to represent the tag number (an unsigned int) using a java int constant, but java int constants are signed, and can't exceed Integer.MAX_VALUE. Fixed by declaring it as a long instead, and casting it down to an int in the implementation. This is safe, because the tag value always fits in 32 bis. Change-Id: If2017bacb4e20af667eaeaf9b65ddc2c30a7709f
* DRY: Use `Charset` statics to eliminate exceptionsTamir Duberstein2015-04-021-11/+11
|
* Add test for debug string for oneofJisi Liu2015-02-191-0/+2
| | | | Change-Id: I6a51a35c69ac24a60dd96ef69d556b1e68bc37d6
* Fix review comments.Jisi Liu2015-02-191-1/+1
| | | | Change-Id: Iafd4a3aa9d55e31478bf070311eeadfe95ece4d7
* Add tests for oneofs.Jisi Liu2015-02-191-6/+142
|
* partial oneof tests.Jisi Liu2015-02-191-0/+38
|
* Add tests for oneof equals and hash.Jisi Liu2015-02-192-0/+81
|
* Uncomment string/bytes fields in oneof nano.Jisi Liu2015-02-191-2/+2
|
* Oneof message level elements (consts, case getter/clear) and messsage type ↵Jisi Liu2015-02-191-1/+1
| | | | field oneof support.
* Initial check in for primitive oneof fields.Jisi Liu2015-02-191-0/+8
|
* Support maps in NanoPrinter.Jisi Liu2015-02-191-0/+39
|
* Implement Equals for nano.Jisi Liu2015-02-061-2/+121
|
* Rename empty bytes in JavaNano.Jisi Liu2015-02-051-1/+0
|
* Add tests merging empty entries in JavaNano mapJisi Liu2015-02-051-0/+30
|
* Fix the behavior when merging conflicting keys, the new value alwaysJisi Liu2015-02-052-1/+28
| | | | override the existing one even for message types.
* Test keys and values cannot be null.Jisi Liu2015-02-051-1/+23
|
* Basic serialization/parsing test.Jisi Liu2015-02-052-1/+130
|
* parsing and serialzation for maps in JavaNano.Jisi Liu2015-02-031-22/+7
|
* Add package for map test for nano.Jisi Liu2015-02-021-1/+4
|
* Add tests for JavaNano maps.Jisi Liu2015-02-021-0/+52
|
* Replace links in nano proto code.Feng Xiao2014-11-2615-15/+15
|
* Prepare nano proto code to be merged into protobuf repository.Feng Xiao2014-11-1921-0/+5031