diff options
| author | John Wang <johnwang@google.com> | 2009-07-07 13:53:24 -0700 |
|---|---|---|
| committer | John Wang <johnwang@google.com> | 2009-07-07 14:02:11 -0700 |
| commit | 75efd5d5259eb348074159436bd51aa56792df14 (patch) | |
| tree | 55696ebd684833695e5d51f42c21280961119d98 /tests | |
| parent | a54755962ca7725d1e2b6cacbbaece6f1cbf5af4 (diff) | |
| download | frameworks_base-75efd5d5259eb348074159436bd51aa56792df14.zip frameworks_base-75efd5d5259eb348074159436bd51aa56792df14.tar.gz frameworks_base-75efd5d5259eb348074159436bd51aa56792df14.tar.bz2 | |
Add unit test for NeighboringCellInfo.
Add small unit test for NeighboringCellInfo in AndroidTests. The old telephony unit test directory, CoreTest/android, is marked as deprecated in AndroidTestHowto.
new file: tests/AndroidTests/src/com/android/unit_tests/NeighboringCellInfoTest.java
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/AndroidTests/src/com/android/unit_tests/NeighboringCellInfoTest.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/AndroidTests/src/com/android/unit_tests/NeighboringCellInfoTest.java b/tests/AndroidTests/src/com/android/unit_tests/NeighboringCellInfoTest.java new file mode 100644 index 0000000..2bdf1dd --- /dev/null +++ b/tests/AndroidTests/src/com/android/unit_tests/NeighboringCellInfoTest.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.unit_tests; + +import android.test.AndroidTestCase; +import android.telephony.NeighboringCellInfo; +import android.test. suitebuilder.annotation.SmallTest; + +public class NeighboringCellInfoTest extends AndroidTestCase { + @SmallTest + public void testConstructor() { + NeighboringCellInfo empty = new NeighboringCellInfo(); + assertEquals(NeighboringCellInfo.UNKNOWN_RSSI, empty.getRssi()); + assertEquals(NeighboringCellInfo.UNKNOWN_CID, empty.getCid()); + + int rssi = 31; + int cid = 0xffffffff; + NeighboringCellInfo max = new NeighboringCellInfo(rssi, cid); + assertEquals(rssi, max.getRssi()); + assertEquals(cid, max.getCid()); + } + + @SmallTest + public void testGetAndSet() { + int rssi = 16; + int cid = 0x12345678; + NeighboringCellInfo nc = new NeighboringCellInfo(); + nc.setRssi(rssi); + nc.setCid(cid); + assertEquals(rssi, nc.getRssi()); + assertEquals(cid, nc.getCid()); + } + + @SmallTest + public void testToString() { + NeighboringCellInfo empty = new NeighboringCellInfo(); + assertEquals("[/ at /]", empty.toString()); + + NeighboringCellInfo nc = new NeighboringCellInfo(16, 0x12345678); + assertEquals("[12345678 at 16]", nc.toString()); + } +} |
