File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
compiler/src/test/java/org/capnproto/test Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -943,4 +943,21 @@ public void testZeroPointerUnderflow() throws DecodeException {
943943 Assert .assertEquals (0L , outputSegments [0 ].getLong ((2 + ii ) * 8 ));
944944 }
945945 }
946+
947+ // This test fails on https://github.com/capnproto/capnproto-java/pull/143,
948+ // illustrating why https://github.com/capnproto/capnproto-java/commit/28ab5ced
949+ // is needed.
950+ @ org .junit .Test
951+ public void setDataPointer () {
952+ MessageBuilder message1 = new MessageBuilder ();
953+ Test .TestAllTypes .Builder allTypes1 = message1 .initRoot (Test .TestAllTypes .factory );
954+ TestUtil .initTestMessage (allTypes1 );
955+ MessageBuilder message2 = new MessageBuilder ();
956+ Test .TestAllTypes .Builder allTypes2 = message2 .initRoot (Test .TestAllTypes .factory );
957+ TestUtil .initTestMessage (allTypes2 );
958+
959+ allTypes1 .setDataField (allTypes2 .asReader ().getDataField ());
960+ TestUtil .checkTestMessage (allTypes1 );
961+ TestUtil .checkTestMessage (allTypes1 .asReader ());
962+ }
946963}
You can’t perform that action at this time.
0 commit comments