public final long long_literal() throws RecognitionException { long value = 0; CommonTree LONG_LITERAL225=null; try { // smaliTreeWalker.g:1345:3: ( LONG_LITERAL ) // smaliTreeWalker.g:1345:5: LONG_LITERAL { LONG_LITERAL225=(CommonTree)match(input,LONG_LITERAL,FOLLOW_LONG_LITERAL_in_long_literal3706); value = LiteralTools.parseLong((LONG_LITERAL225!=null?LONG_LITERAL225.getText():null)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } return value; } // $ANTLR end "long_literal"
@Test(expected=NumberFormatException.class) public void FaileDecTest1() { LiteralTools.parseLong("-9223372036854775809"); }
@Test(expected=NumberFormatException.class) public void FailDecTest3() { LiteralTools.parseLong("18446744073709551617"); }
@Test(expected=NumberFormatException.class) public void FailOctTest2() { LiteralTools.parseLong("-01777777777777777777777"); }
@Test(expected=NumberFormatException.class) public void FaileHexTest1() { LiteralTools.parseLong("-0x8000000000000001"); }
@Test(expected=NumberFormatException.class) public void FailOctTest3() { LiteralTools.parseLong("02000000000000000000000"); } }
@Test(expected=NumberFormatException.class) public void FailHexTest2() { LiteralTools.parseLong("-0xFFFFFFFFFFFFFFFF"); }
@Test(expected=NumberFormatException.class) public void FailDecTest2() { LiteralTools.parseLong("-18446744073709551616"); }
@Test(expected=NumberFormatException.class) public void FailHexTest3() { LiteralTools.parseLong("0x10000000000000000"); }
@Test(expected=NumberFormatException.class) public void FailDecTest4() { LiteralTools.parseLong("18446744073709551700"); }
@Test(expected=NumberFormatException.class) public void FaileOctTest1() { LiteralTools.parseLong("-01000000000000000000001"); }
@Test public void SuccessDecTests() { Assert.assertTrue(LiteralTools.parseLong("0L") == 0); Assert.assertTrue(LiteralTools.parseLong("1") == 1); Assert.assertTrue(LiteralTools.parseLong("1234567890123456789") == 1234567890123456789L); Assert.assertTrue(LiteralTools.parseLong("9223372036854775807") == 9223372036854775807L); Assert.assertTrue(LiteralTools.parseLong("9223372036854775808") == Long.MIN_VALUE); Assert.assertTrue(LiteralTools.parseLong("18446744073709551615L") == -1); Assert.assertTrue(LiteralTools.parseLong("-0") == 0); Assert.assertTrue(LiteralTools.parseLong("-1") == -1); Assert.assertTrue(LiteralTools.parseLong("-1234567890123456789") == -1234567890123456789L); Assert.assertTrue(LiteralTools.parseLong("-9223372036854775807") == -9223372036854775807L); Assert.assertTrue(LiteralTools.parseLong("-9223372036854775808") == Long.MIN_VALUE); }
@Test public void SuccessOctTests() { Assert.assertTrue(LiteralTools.parseLong("00") == 00); Assert.assertTrue(LiteralTools.parseLong("01") == 01); Assert.assertTrue(LiteralTools.parseLong("0123456701234567012345") == 0123456701234567012345L); Assert.assertTrue(LiteralTools.parseLong("0777777777777777777777") == Long.MAX_VALUE); Assert.assertTrue(LiteralTools.parseLong("01000000000000000000000") == Long.MIN_VALUE); Assert.assertTrue(LiteralTools.parseLong("01777777777777777777777") == -1); Assert.assertTrue(LiteralTools.parseLong("-00") == 0); Assert.assertTrue(LiteralTools.parseLong("-01") == -1); Assert.assertTrue(LiteralTools.parseLong("-0123456701234567012345") == -0123456701234567012345L); Assert.assertTrue(LiteralTools.parseLong("-0777777777777777777777") == -0777777777777777777777L); Assert.assertTrue(LiteralTools.parseLong("-01000000000000000000000") == Long.MIN_VALUE); }
@Test public void SuccessHexTests() { Assert.assertTrue(LiteralTools.parseLong("0x0L") == 0x0); Assert.assertTrue(LiteralTools.parseLong("0x00L") == 0x0); Assert.assertTrue(LiteralTools.parseLong("0x1L") == 0x1); Assert.assertTrue(LiteralTools.parseLong("0x1234567890123456L") == 0x1234567890123456L); Assert.assertTrue(LiteralTools.parseLong("0x7fffffffffffffffL") == 0x7fffffffffffffffL); Assert.assertTrue(LiteralTools.parseLong("0x8000000000000000L") == Long.MIN_VALUE); Assert.assertTrue(LiteralTools.parseLong("0xFFFFFFFFFFFFFFFFL") == -1); Assert.assertTrue(LiteralTools.parseLong("-0x00L") == 0); Assert.assertTrue(LiteralTools.parseLong("-0x01L") == -1); Assert.assertTrue(LiteralTools.parseLong("-0x1234567890123456L") == -0x1234567890123456L); Assert.assertTrue(LiteralTools.parseLong("-0x8000000000000000L") == Long.MIN_VALUE); Assert.assertTrue(LiteralTools.parseLong("-0x1fffffffffffffffL") == -0x1fffffffffffffffL); }
public final long long_literal() throws RecognitionException { long value = 0; CommonTree LONG_LITERAL225=null; try { // smaliTreeWalker.g:1345:3: ( LONG_LITERAL ) // smaliTreeWalker.g:1345:5: LONG_LITERAL { LONG_LITERAL225=(CommonTree)match(input,LONG_LITERAL,FOLLOW_LONG_LITERAL_in_long_literal3706); value = LiteralTools.parseLong((LONG_LITERAL225!=null?LONG_LITERAL225.getText():null)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } return value; } // $ANTLR end "long_literal"
public final long long_literal() throws RecognitionException { long value = 0; CommonTree LONG_LITERAL192=null; try { // D:\\decomplier_tools\\smali\\smali\\smali\\src\\main\\antlr3\\smaliTreeWalker.g:1187:3: ( LONG_LITERAL ) // D:\\decomplier_tools\\smali\\smali\\smali\\src\\main\\antlr3\\smaliTreeWalker.g:1187:5: LONG_LITERAL { LONG_LITERAL192=(CommonTree)match(input,LONG_LITERAL,FOLLOW_LONG_LITERAL_in_long_literal3262); value = LiteralTools.parseLong((LONG_LITERAL192!=null?LONG_LITERAL192.getText():null)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } return value; } // $ANTLR end "long_literal"