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

Commit 7b6cdc9e authored by Nathan Harold's avatar Nathan Harold
Browse files

Test Invalid Lat/Long Values for CellIdentityCdma

Update the CellIdentityCdma constructor to test
both that the longitude is correct when valid
and that when the lat/long are wrong, the values
are coerced to INT_MAX.

Bug: 32364031
Test: this - runtest frameworks-telephony
Change-Id: I2d88bad783784ff4f9d047f3de8d4db0bf4cb4a1
parent a8af56d7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -48,10 +48,21 @@ public class CellIdentityCdmaTest extends AndroidTestCase {

        assertEquals(NETWORK_ID, ci.getNetworkId());
        assertEquals(LATITUDE, ci.getLatitude());
        assertEquals(LONGITUDE, ci.getLongitude());
        assertEquals(ALPHA_LONG, ci.getOperatorAlphaLong());
        assertEquals(ALPHA_SHORT, ci.getOperatorAlphaShort());
    }

    @SmallTest
    public void testNullIsland() {
        CellIdentityCdma  ci =
                new CellIdentityCdma(NETWORK_ID, SYSTEM_ID, BASESTATION_ID, -1, 0,
                        ALPHA_LONG, ALPHA_SHORT);

        assertEquals(Integer.MAX_VALUE, ci.getLatitude());
        assertEquals(Integer.MAX_VALUE, ci.getLongitude());
    }

    @SmallTest
    public void testEquals() {
        CellIdentityCdma  ciA =