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

Commit 556627ca authored by Nathan Harold's avatar Nathan Harold
Browse files

Update unit tests for CellInfo Code Cleanup

The initialize() methods were removed from the
CellSignalStrengthXYZ functions, so instead the
unit tests are updated to use the appropriate
constructors rather than a two-step construct-then
initialize pattern.

Bug: 72742517
Test: runtest frameworks-telephony
Change-Id: Ic6e76a2c71b2aab3a25d8ed680e0a099e51145b4
parent 4ce44fde
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -42,8 +42,7 @@ public class NetworkScanResultTest {
        ArrayList<CellInfo> infos = new ArrayList<CellInfo>();

        CellIdentityGsm cig = new CellIdentityGsm(310, 310, 1, 2, 3, 4);
        CellSignalStrengthGsm cssg = new CellSignalStrengthGsm();
        cssg.initialize(5, 6, 7);
        CellSignalStrengthGsm cssg = new CellSignalStrengthGsm(5, 6, 7);
        CellInfoGsm gsm = new CellInfoGsm();
        gsm.setRegistered(true);
        gsm.setTimeStampType(8);
@@ -53,8 +52,7 @@ public class NetworkScanResultTest {
        infos.add(gsm);

        CellIdentityLte cil = new CellIdentityLte(320, 320, 11, 12, 13, 14);
        CellSignalStrengthLte cssl = new CellSignalStrengthLte();
        cssl.initialize(15, 16, 17, 18, 19, 20);
        CellSignalStrengthLte cssl = new CellSignalStrengthLte(15, 16, 17, 18, 19, 20);
        CellInfoLte lte = new CellInfoLte();
        lte.setRegistered(false);
        lte.setTimeStampType(21);
+8 −8
Original line number Diff line number Diff line
@@ -1119,8 +1119,8 @@ public class RILTest extends TelephonyTest {
        expected.setTimeStampType(RIL_TIMESTAMP_TYPE_OEM_RIL);
        CellIdentityGsm ci = new CellIdentityGsm(
                LAC, CID, ARFCN, BSIC, MCC_STR, MNC_STR, EMPTY_ALPHA_LONG, EMPTY_ALPHA_SHORT);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm();
        cs.initialize(SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm(
                SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        expected.setCellIdentity(ci);
        expected.setCellSignalStrength(cs);
        expected.setCellConnectionStatus(CellInfo.CONNECTION_UNKNOWN);
@@ -1285,8 +1285,8 @@ public class RILTest extends TelephonyTest {
        expected.setTimeStampType(RIL_TIMESTAMP_TYPE_OEM_RIL);
        CellIdentityGsm ci = new CellIdentityGsm(
                LAC, CID, ARFCN, BSIC, MCC_STR, MNC_STR, ALPHA_LONG, ALPHA_SHORT);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm();
        cs.initialize(SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm(
                SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        expected.setCellIdentity(ci);
        expected.setCellSignalStrength(cs);
        expected.setCellConnectionStatus(CellInfo.CONNECTION_NONE);
@@ -1306,8 +1306,8 @@ public class RILTest extends TelephonyTest {
        expected.setTimeStampType(RIL_TIMESTAMP_TYPE_OEM_RIL);
        CellIdentityGsm ci = new CellIdentityGsm(
                LAC, CID, ARFCN, BSIC, MCC_STR, MNC_STR, EMPTY_ALPHA_LONG, EMPTY_ALPHA_SHORT);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm();
        cs.initialize(SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm(
                SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        expected.setCellIdentity(ci);
        expected.setCellSignalStrength(cs);
        expected.setCellConnectionStatus(CellInfo.CONNECTION_NONE);
@@ -1329,8 +1329,8 @@ public class RILTest extends TelephonyTest {
        expected.setTimeStampType(RIL_TIMESTAMP_TYPE_OEM_RIL);
        CellIdentityGsm ci = new CellIdentityGsm(
                LAC, CID, ARFCN, BSIC, null, null, ALPHA_LONG, ALPHA_SHORT);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm();
        cs.initialize(SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        CellSignalStrengthGsm cs = new CellSignalStrengthGsm(
                SIGNAL_STRENGTH, BIT_ERROR_RATE, TIME_ADVANCE);
        expected.setCellIdentity(ci);
        expected.setCellConnectionStatus(CellInfo.CONNECTION_NONE);
        expected.setCellSignalStrength(cs);