summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-07-07 18:10:38 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-07-07 18:10:38 -0700
commita0ad661fc94137bb010a36ec0403f8c8cadd7afb (patch)
treed58f6c4ecd9ae43a9e61825a28e34859c62879f7 /tests
parenta3d595e1a67506bfd86298516a95ee75f8a0d5d2 (diff)
parenta83bef597430e9336566ca38330cc0f4e793abe1 (diff)
downloadframeworks_base-a0ad661fc94137bb010a36ec0403f8c8cadd7afb.zip
frameworks_base-a0ad661fc94137bb010a36ec0403f8c8cadd7afb.tar.gz
frameworks_base-a0ad661fc94137bb010a36ec0403f8c8cadd7afb.tar.bz2
am a83bef59: Merge change 6396 into donut
Merge commit 'a83bef597430e9336566ca38330cc0f4e793abe1' * commit 'a83bef597430e9336566ca38330cc0f4e793abe1': Add unit test for NeighboringCellInfo.
Diffstat (limited to 'tests')
-rw-r--r--tests/AndroidTests/src/com/android/unit_tests/NeighboringCellInfoTest.java55
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());
+ }
+}