Changeset 775188a3


Ignore:
Timestamp:
Aug 4, 2018 4:31:10 PM (20 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0b3abb3
Parents:
21fe962
Message:

I2NP: Fix DI test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/test/junit/net/i2p/data/i2np/DeliveryInstructionsTest.java

    r21fe962 r775188a3  
    1010
    1111import net.i2p.data.DataFormatException;
     12import net.i2p.data.DataHelper;
    1213import net.i2p.data.DataStructure;
    1314import net.i2p.data.Hash;
    1415import net.i2p.data.StructureTest;
    1516import net.i2p.data.TunnelId;
     17
     18import org.junit.Test;
    1619
    1720/**
     
    2124 */
    2225public class DeliveryInstructionsTest extends StructureTest {
     26
     27    /**
     28     *  Override because DI doesn't support input/output streams any more
     29     */
     30    @Override
     31    @Test
     32    public void testStructure() throws Exception{
     33        DeliveryInstructions orig = (DeliveryInstructions) createDataStructure();
     34        byte[] temp = new byte[100];
     35        int len = orig.writeBytes(temp, 0);
     36
     37        DeliveryInstructions ds = (DeliveryInstructions) createStructureToRead();
     38        ds.readBytes(temp, 0);
     39        byte[] temp2 = new byte[100];
     40        int len2 = ds.writeBytes(temp2, 0);
     41        assert(len2 == len);
     42        assert(DataHelper.eq(temp, 0, temp2, 0, len));
     43    }
     44
    2345    public DataStructure createDataStructure() throws DataFormatException {
    2446        DeliveryInstructions instructions = new DeliveryInstructions();
Note: See TracChangeset for help on using the changeset viewer.