JesusFreke / smali

smali/baksmali
6.34k stars 1.07k forks source link

Assert failed when building smalidea #537

Open shizhx opened 7 years ago

shizhx commented 7 years ago
cd smalidea
../gradew build

failed:

org.jf.smalidea.dexlib.SmalideaMethodTest > testPackedSwitch FAILED
    java.lang.RuntimeException
        Caused by: java.lang.AssertionError at SmalideaMethodTest.java:373

org.jf.smalidea.dexlib.SmalideaMethodTest > testSparseSwitch FAILED
    java.lang.RuntimeException
        Caused by: java.lang.AssertionError at SmalideaMethodTest.java:373

124 tests completed, 2 failed
:smalidea:test FAILED

stacktrace is too many, here is the key fragment:

Caused by: java.lang.AssertionError: expected:<6> but was:<3>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:645)
    at org.junit.Assert.assertEquals(Assert.java:631)
    at org.jf.smalidea.dexlib.SmalideaMethodTest.checkSwitchElement(SmalideaMethodTest.java:373)
    at org.jf.smalidea.dexlib.SmalideaMethodTest.testPackedSwitch(SmalideaMethodTest.java:431)
Caused by: java.lang.AssertionError: expected:<6> but was:<3>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:645)
    at org.junit.Assert.assertEquals(Assert.java:631)
    at org.jf.smalidea.dexlib.SmalideaMethodTest.checkSwitchElement(SmalideaMethodTest.java:373)
    at org.jf.smalidea.dexlib.SmalideaMethodTest.testSparseSwitch(SmalideaMethodTest.java:497)
JesusFreke commented 7 years ago

Might be some IDEA version incompatibility or something. The quick workaround is to add -x test to the gradle command to skip the tests