aboutsummaryrefslogtreecommitdiffstats
path: root/src/google/protobuf/unittest_accessors_nano.proto
Commit message (Collapse)AuthorAgeFilesLines
* Correctness: floating point equality using bits instead of ==.Max Cai2014-01-101-0/+2
| | | | | | | | | | | Special values for float and double make it inaccurate to test the equality with ==. The main Java library uses the standard Object.equals() implementation for all fields, which for floating point fields means Float.equals() or Double.equals(). They define equality as bitwise equality, with all NaN representations normalized to the same bit sequence (and therefore equal to each other). This test checks that the nano implementation complies with Object.equals(), so NaN == NaN and +0.0 != -0.0. Change-Id: I97bb4a3687223d8a212c70cd736436b9dd80c1d7
* Accessor style for optional fields.Max Cai2013-09-231-0/+116
This CL implements the 'optional_field_style=accessors' option. All optional fields will now be 1 Java field and 1 bit in a shared bitfield behind get/set/has/clear accessor methods. The setter performs null check for reference types (Strings and byte[]s). Also decentralized the clear code generation. Change-Id: I60ac78329e352e76c2f8139fba1f292383080ad3