Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make codec missing value behaviour consistent with agrona updates
  • Loading branch information
RichardWarburton committed Sep 21, 2020
1 parent c530c17 commit dbed6fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -22,10 +22,10 @@
import uk.co.real_logic.artio.util.float_parsing.AsciiBufferCharReader;
import uk.co.real_logic.artio.util.float_parsing.DecimalFloatParser;


import java.nio.ByteBuffer;

import static java.nio.charset.StandardCharsets.US_ASCII;
import static uk.co.real_logic.artio.dictionary.generation.CodecUtil.MISSING_INT;

public final class MutableAsciiBuffer extends UnsafeBuffer implements AsciiBuffer
{
Expand Down Expand Up @@ -88,7 +88,14 @@ public long getNaturalLong(final int startInclusive, final int endExclusive)
@SuppressWarnings("FinalParameters")
public int getInt(int startInclusive, final int endExclusive)
{
return super.parseIntAscii(startInclusive, endExclusive - startInclusive);
try
{
return super.parseIntAscii(startInclusive, endExclusive - startInclusive);
}
catch (final AsciiNumberFormatException e)
{
return MISSING_INT;
}
}

public int getDigit(final int index)
Expand Down
Expand Up @@ -19,7 +19,6 @@
import org.agrona.collections.IntHashSet;
import org.agrona.generation.StringWriterOutputManager;
import org.hamcrest.Matcher;
import org.junit.Ignore;
import org.junit.Test;
import uk.co.real_logic.artio.builder.Decoder;
import uk.co.real_logic.artio.decoder.SessionHeaderDecoder;
Expand Down Expand Up @@ -843,7 +842,6 @@ public void shouldSkipUnknownFieldForMessageAndPassValidation() throws Exception
assertEquals(2, getIntField(decoder));
}

@Ignore
@Test
public void shouldValidateTagSpecifiedWithMissingValue() throws Exception
{
Expand Down Expand Up @@ -883,7 +881,6 @@ public void shouldValidateStringBasedEnum() throws Exception
assertEquals("Wrong reject reason", VALUE_IS_INCORRECT, decoder.rejectReason());
}

@Ignore
@Test
public void shouldValidateEnumMissingValueIfEnumValidationDisabled() throws Exception
{
Expand Down

0 comments on commit dbed6fb

Please sign in to comment.