~ubuntu-branches/debian/experimental/protobuf/experimental

« back to all changes in this revision

Viewing changes to java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java

  • Committer: Package Import Robot
  • Author(s): Robert S. Edmonds, Micah Anderson, Colin Watson, Steve Langasek, Robert S. Edmonds
  • Date: 2013-10-12 18:32:37 UTC
  • mfrom: (1.3.1) (10.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20131012183237-jz6tvmj9tn68atrf
Tags: 2.5.0-1
[ Micah Anderson ]
* New upstream version. (Closes: #704731.)
* Update debian/watch.
* Refresh patches.

[ Colin Watson ]
* Use the autotools-dev dh addon to update config.guess/config.sub for
  arm64. (Closes: #725976.)

[ Steve Langasek ]
* Don't recommend protobuf-compiler from the bindings, it's not used and
  this doesn't need to be pulled in at runtime. (Closes: #703628.)
* Mark protobuf-compiler Multi-Arch: foreign; the output of this command
  is architecture-independent source, we don't need the version of the
  compiler to match the target arch.
* Bump to debhelper compat 9, so that our libs get installed to the
  multiarch locations.
* Mark the library packages Multi-Arch: same.
* Fix debian/rules to support cross-building of the python bindings.
* Build-depend on libpython-dev, not python-dev, for cross-build
  compatibility.
* (Closes: #726083.)

[ Robert S. Edmonds ]
* Upload to experimental.
* Bump ABI version from 7 to 8.
* Bump Standards-Version to 3.9.4.
* Convert from python-support to dh-python.
* Drop support for python2.6.
* python-protobuf: switch back to the pure Python implementation, as
  upstream appears to no longer be maintaining the current C++ based Python
  binding. See the following upstream issues for details:
  - https://code.google.com/p/protobuf/issues/detail?id=434
  - https://code.google.com/p/protobuf/issues/detail?id=503

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
package com.google.protobuf;
32
32
 
 
33
import protobuf_unittest.UnittestProto.SparseEnumMessage;
33
34
import protobuf_unittest.UnittestProto.TestAllTypes;
34
35
import protobuf_unittest.UnittestProto.TestPackedTypes;
 
36
import protobuf_unittest.UnittestProto.TestSparseEnum;
35
37
 
36
38
import junit.framework.TestCase;
37
39
 
300
302
    assertEqualBytes(TestUtil.getGoldenPackedFieldsMessage().toByteArray(),
301
303
                     rawBytes);
302
304
  }
 
305
 
 
306
  /** Test writing a message containing a negative enum value. This used to
 
307
   * fail because the size was not properly computed as a sign-extended varint.
 
308
   */
 
309
  public void testWriteMessageWithNegativeEnumValue() throws Exception {
 
310
    SparseEnumMessage message = SparseEnumMessage.newBuilder()
 
311
        .setSparseEnum(TestSparseEnum.SPARSE_E) .build();
 
312
    assertTrue(message.getSparseEnum().getNumber() < 0);
 
313
    byte[] rawBytes = message.toByteArray();
 
314
    SparseEnumMessage message2 = SparseEnumMessage.parseFrom(rawBytes);
 
315
    assertEquals(TestSparseEnum.SPARSE_E, message2.getSparseEnum());
 
316
  }
303
317
}