Add tests for a negitave hex numbers with an alpha (a-f) digit

git-svn-id: https://smali.googlecode.com/svn/trunk@741 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2010-06-13 20:32:36 +00:00
parent 4ccbb4e8bd
commit be6afd1812
4 changed files with 5 additions and 2 deletions

View File

@ -48,6 +48,7 @@ public class ByteLiteralTest
Assert.assertTrue(literalTools.parseByte("-0x01") == -1);
Assert.assertTrue(literalTools.parseByte("-0x12") == -0x12);
Assert.assertTrue(literalTools.parseByte("-0x80") == Byte.MIN_VALUE);
Assert.assertTrue(literalTools.parseByte("-0x1f") == -0x1f);
}
@Test(expected=NumberFormatException.class)

View File

@ -32,7 +32,6 @@ import org.junit.Test;
public class IntLiteralTest
{
@Test
public void SuccessHexTests() {
@ -48,6 +47,7 @@ public class IntLiteralTest
Assert.assertTrue(literalTools.parseInt("-0x01") == -1);
Assert.assertTrue(literalTools.parseInt("-0x12345678") == -0x12345678);
Assert.assertTrue(literalTools.parseInt("-0x80000000") == Integer.MIN_VALUE);
Assert.assertTrue(literalTools.parseInt("-0x1FFFFFFF") == -0x1FFFFFFF);
}
@Test(expected=NumberFormatException.class)

View File

@ -46,6 +46,7 @@ public class LongLiteralTest
Assert.assertTrue(literalTools.parseLong("-0x01L") == -1);
Assert.assertTrue(literalTools.parseLong("-0x1234567890123456L") == -0x1234567890123456L);
Assert.assertTrue(literalTools.parseLong("-0x8000000000000000") == Long.MIN_VALUE);
Assert.assertTrue(literalTools.parseLong("-0x1fffffffffffffffL") == -0x1fffffffffffffffL);
}
@Test(expected=NumberFormatException.class)

View File

@ -48,6 +48,7 @@ public class ShortLiteralTest
Assert.assertTrue(literalTools.parseShort("-0x01") == -1);
Assert.assertTrue(literalTools.parseShort("-0x1234") == -0x1234);
Assert.assertTrue(literalTools.parseShort("-0x8000") == Short.MIN_VALUE);
Assert.assertTrue(literalTools.parseShort("-0x1fff") == -0x1fff);
}
@Test(expected=NumberFormatException.class)
@ -104,7 +105,7 @@ public class ShortLiteralTest
literalTools.parseShort("65600");
}
@Test
public void SuccessOctTests() {
Assert.assertTrue(literalTools.parseShort("00") == 00);