Search in sources :

Example 1 with Recursive

use of com.squareup.wire.protos.edgecases.Recursive in project wire by square.

the class ParseTest method upToRecursionLimit.

@Test
public void upToRecursionLimit() throws Exception {
    // tag 2: nested message (64 times)
    // tag 1: signed varint32 456
    ByteString data = ByteString.decodeHex("127e127c127a12781276127412721270126e126c126a12681266126" + "412621260125e125c125a12581256125412521250124e124c124a12481246124412421240123e123c123a123" + "81236123412321230122e122c122a12281226122412221220121e121c121a12181216121412121210120e120" + "c120a1208120612041202120008c803");
    Recursive recursive = Recursive.ADAPTER.decode(data.toByteArray());
    assertThat(recursive.value.intValue()).isEqualTo(456);
}
Also used : ByteString(okio.ByteString) Recursive(com.squareup.wire.protos.edgecases.Recursive) Test(org.junit.Test)

Aggregations

Recursive (com.squareup.wire.protos.edgecases.Recursive)1 ByteString (okio.ByteString)1 Test (org.junit.Test)1