diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-07 18:09:21 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-07 18:09:21 -0700 |
| commit | a83bef597430e9336566ca38330cc0f4e793abe1 (patch) | |
| tree | 1e833dcb8f7bdcd38804ee2964b17fe9c5bcd2c9 /tests | |
| parent | 108fd1c08a1a679886c987e1f62a9ba6be962235 (diff) | |
| parent | 75efd5d5259eb348074159436bd51aa56792df14 (diff) | |
| download | frameworks_base-a83bef597430e9336566ca38330cc0f4e793abe1.zip frameworks_base-a83bef597430e9336566ca38330cc0f4e793abe1.tar.gz frameworks_base-a83bef597430e9336566ca38330cc0f4e793abe1.tar.bz2 | |
Merge change 6396 into donut
* changes:
Add unit test for NeighboringCellInfo.
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()); + } +} |
