Loading tests/telephonytests/src/com/android/internal/telephony/CellIdentityNrTest.java +9 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.telephony; import static com.google.common.truth.Truth.assertThat; import android.os.Parcel; import android.telephony.AccessNetworkConstants; import android.telephony.CellIdentityNr; import android.telephony.CellInfo; import android.test.AndroidTestCase; Loading @@ -38,12 +39,13 @@ public class CellIdentityNrTest extends AndroidTestCase { private static final int PCI = 123; private static final int TAC = 32767; private static final int NCI = 8675309; private static final int BAND = AccessNetworkConstants.NgranBands.BAND_1; @Test public void testGetMethod() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN the get method should return correct value Loading @@ -63,10 +65,10 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_sameParameters() { // GIVEN an instance of CellIdentityNr, and create another object with the same parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are equivalent Loading @@ -77,10 +79,10 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_differentParameters() { // GIVEN an instance of CellIdentityNr, and create another object with different parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are different Loading @@ -91,7 +93,7 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testParcel() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // WHEN write the object to parcel and create another object with that parcel Loading @@ -106,6 +108,7 @@ public class CellIdentityNrTest extends AndroidTestCase { assertThat(anotherCellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getPci()).isEqualTo(PCI); assertThat(anotherCellIdentityNr.getTac()).isEqualTo(TAC); assertThat(anotherCellIdentityNr.getBand()).isEqualTo(BAND); assertThat(anotherCellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); assertThat(anotherCellIdentityNr.getOperatorAlphaShort()).isEqualTo(ALPHAS); assertThat(anotherCellIdentityNr.getMccString()).isEqualTo(MCC); Loading tests/telephonytests/src/com/android/internal/telephony/RILTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -1619,8 +1619,9 @@ public class RILTest extends TelephonyTest { CellSignalStrengthNr signalStrengthNr = (CellSignalStrengthNr) cellInfoNr.getCellSignalStrength(); CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList()); CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, CellInfo.UNAVAILABLE, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList()); CellSignalStrengthNr expectedSignalStrength = new CellSignalStrengthNr(-RSRP, -RSRQ, SIGNAL_NOISE_RATIO, -RSRP, -RSRQ, SIGNAL_NOISE_RATIO); Loading Loading
tests/telephonytests/src/com/android/internal/telephony/CellIdentityNrTest.java +9 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.telephony; import static com.google.common.truth.Truth.assertThat; import android.os.Parcel; import android.telephony.AccessNetworkConstants; import android.telephony.CellIdentityNr; import android.telephony.CellInfo; import android.test.AndroidTestCase; Loading @@ -38,12 +39,13 @@ public class CellIdentityNrTest extends AndroidTestCase { private static final int PCI = 123; private static final int TAC = 32767; private static final int NCI = 8675309; private static final int BAND = AccessNetworkConstants.NgranBands.BAND_1; @Test public void testGetMethod() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN the get method should return correct value Loading @@ -63,10 +65,10 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_sameParameters() { // GIVEN an instance of CellIdentityNr, and create another object with the same parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are equivalent Loading @@ -77,10 +79,10 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testEquals_differentParameters() { // GIVEN an instance of CellIdentityNr, and create another object with different parameters CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); CellIdentityNr anotherCellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI + 1, ALPHAL, ALPHAS, Collections.emptyList()); // THEN this two objects are different Loading @@ -91,7 +93,7 @@ public class CellIdentityNrTest extends AndroidTestCase { public void testParcel() { // GIVEN an instance of CellIdentityNr CellIdentityNr cellIdentityNr = new CellIdentityNr(PCI, TAC, NRARFCN, MCC, MNC, NCI, ALPHAL, ALPHAS, new CellIdentityNr(PCI, TAC, NRARFCN, BAND, MCC, MNC, NCI, ALPHAL, ALPHAS, Collections.emptyList()); // WHEN write the object to parcel and create another object with that parcel Loading @@ -106,6 +108,7 @@ public class CellIdentityNrTest extends AndroidTestCase { assertThat(anotherCellIdentityNr.getNrarfcn()).isEqualTo(NRARFCN); assertThat(anotherCellIdentityNr.getPci()).isEqualTo(PCI); assertThat(anotherCellIdentityNr.getTac()).isEqualTo(TAC); assertThat(anotherCellIdentityNr.getBand()).isEqualTo(BAND); assertThat(anotherCellIdentityNr.getOperatorAlphaLong()).isEqualTo(ALPHAL); assertThat(anotherCellIdentityNr.getOperatorAlphaShort()).isEqualTo(ALPHAS); assertThat(anotherCellIdentityNr.getMccString()).isEqualTo(MCC); Loading
tests/telephonytests/src/com/android/internal/telephony/RILTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -1619,8 +1619,9 @@ public class RILTest extends TelephonyTest { CellSignalStrengthNr signalStrengthNr = (CellSignalStrengthNr) cellInfoNr.getCellSignalStrength(); CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList()); CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, CellInfo.UNAVAILABLE, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList()); CellSignalStrengthNr expectedSignalStrength = new CellSignalStrengthNr(-RSRP, -RSRQ, SIGNAL_NOISE_RATIO, -RSRP, -RSRQ, SIGNAL_NOISE_RATIO); Loading