Changeset db9555d


Ignore:
Timestamp:
Jul 27, 2015 6:49:07 AM (5 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
e704bad
Parents:
4b34b49
Message:

Fix test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/test/junit/net/i2p/client/streaming/impl/MessageInputStreamTest.java

    r4b34b49 rdb9555d  
    182182        byte orig[] = new byte[_options.getInboundBufferSize()];
    183183        _context.random().nextBytes(orig);
    184         for (int i = 0; i < numMsgs - 1; i++) {
    185             byte msg[] = new byte[_options.getMaxMessageSize()];
    186             System.arraycopy(orig, i*_options.getMaxMessageSize(), msg, 0, _options.getMaxMessageSize());
    187             in.messageReceived(i, new ByteArray(msg));
    188         }
    189         // Add one half-size msg
     184        for (int i = 0; i < numMsgs - 2; i++) {
     185            byte msg[] = new byte[_options.getMaxMessageSize()];
     186            System.arraycopy(orig, i*_options.getMaxMessageSize(), msg, 0, _options.getMaxMessageSize());
     187            in.messageReceived(i, new ByteArray(msg));
     188        }
     189        // Add two half-size messages (to get past shortcut)
    190190        byte msg[] = new byte[_options.getMaxMessageSize()/2];
    191191        System.arraycopy(orig, (numMsgs-1)*_options.getMaxMessageSize(), msg, 0, _options.getMaxMessageSize()/2);
     192        in.messageReceived(numMsgs - 2, new ByteArray(msg));
    192193        in.messageReceived(numMsgs - 1, new ByteArray(msg));
    193194        // Check that it predicts only one more msgId will be accepted
Note: See TracChangeset for help on using the changeset viewer.