Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c86b464 authored by Colin Cross's avatar Colin Cross
Browse files

Fix Error Prone errors

Soong wasn't including android_app or android_test sources in the
javac-check target used for the Error Prone build, which allowed
some Error Prone errors to get in.  Fix them so Error Prone can be
re-enabled for these targets.

Fixes:
frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/CellIdentityNrTest.java:96: error: [TruthSelfEquals] The arguments to the isEqualTo method are the same object, so it always passes. Please change the arguments to point to different objects or consider using EqualsTester.
frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/DeviceStateMonitorTest.java:115: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility.
frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/DeviceStateMonitorTest.java:66: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility.
frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/DeviceStateMonitorTest.java:90: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility.
frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneTest.java:711: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility.

Bug: 146455923
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: Ic6cb167adfed7342f366523952b25813ddd60c9e
parent 8bf56e9e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ public class CellIdentityNrTest extends AndroidTestCase {
        CellIdentityNr anotherCellIdentityNr = CellIdentityNr.CREATOR.createFromParcel(parcel);

        // THEN the new object is equal to the old one
        assertThat(anotherCellIdentityNr).isEqualTo(anotherCellIdentityNr);
        assertThat(anotherCellIdentityNr).isEqualTo(cellIdentityNr);
        assertThat(anotherCellIdentityNr.getType()).isEqualTo(CellInfo.TYPE_NR);
        assertThat(anotherCellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN);
        assertThat(anotherCellIdentityNr.getPci()).isEqualTo(PCI);
+3 −3
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ public class DeviceStateMonitorTest extends TelephonyTest {
        super.tearDown();
    }

    @FlakyTest
    @Test @FlakyTest
    public void testTethering() {
        // Turn tethering on
        Intent intent = new Intent(ConnectivityManager.ACTION_TETHER_STATE_CHANGED);
@@ -86,7 +86,7 @@ public class DeviceStateMonitorTest extends TelephonyTest {
                eq(true), nullable(Message.class));
    }

    @FlakyTest
    @Test @FlakyTest
    public void testCharging() {
        // Charging
        Intent intent = new Intent(BatteryManager.ACTION_CHARGING);
@@ -111,7 +111,7 @@ public class DeviceStateMonitorTest extends TelephonyTest {
                eq(false), nullable(Message.class));
    }

    @FlakyTest
    @Test @FlakyTest
    public void testReset() {
        mDSM.obtainMessage(6).sendToTarget();

+2 −0
Original line number Diff line number Diff line
@@ -708,6 +708,8 @@ public class ImsPhoneTest extends TelephonyTest {
        assertEquals(RegistrationManager.REGISTRATION_STATE_NOT_REGISTERED, regResult.intValue());
    }

    @Test
    @SmallTest
    public void testGetImsRegistrationTech() throws Exception {
        LinkedBlockingQueue<Integer> queue = new LinkedBlockingQueue<>(1);
        Consumer<Integer> regTechCallback = queue::offer;