diff options
author | Yorke Lee <yorkelee@google.com> | 2013-11-22 11:16:54 -0800 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-11-22 11:34:41 -0800 |
commit | 5c432033aed8c083f225b79c49c570d2b24618c1 (patch) | |
tree | f26bb5ca3815e47991b5d3cf2946e30acf499178 /tests | |
parent | 76af8945db9001aec63e6645a814d70d567f5729 (diff) |
Fix Smart dialing tests
Test contacts were being created without unique contact ids and lookup keys,
causing them to be mistakenly identified as duplicates.
Bug: 10346442
Change-Id: I47fd5bdae83346b6b2f620d7abe49326b1cfd23d
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/dialer/database/SmartDialPrefixTest.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/src/com/android/dialer/database/SmartDialPrefixTest.java b/tests/src/com/android/dialer/database/SmartDialPrefixTest.java index 23bda7cb2..558be265b 100644 --- a/tests/src/com/android/dialer/database/SmartDialPrefixTest.java +++ b/tests/src/com/android/dialer/database/SmartDialPrefixTest.java @@ -31,13 +31,10 @@ import com.android.dialer.dialpad.SmartDialNameMatcher; import com.android.dialer.dialpad.SmartDialPrefix; import java.lang.Exception; -import java.lang.FindBugsSuppressWarnings; import java.lang.Override; import java.lang.String; import java.util.ArrayList; -import junit.framework.TestCase; - /** * To run this test, use the command: * adb shell am instrument -w -e class com.android.dialer.dialpad.SmartDialPrefixTest / @@ -80,6 +77,7 @@ public class SmartDialPrefixTest extends AndroidTestCase { assertTrue(SmartDialPrefix.isCountryNanp("vi")); } + @Override protected void setUp() { mTestHelper = DialerDatabaseHelper.getNewInstanceForTest(getContext()); } @@ -136,8 +134,8 @@ public class SmartDialPrefixTest extends AndroidTestCase { private ContactNumber constructNewContactWithDummyIds(MatrixCursor contactCursor, MatrixCursor nameCursor, String number, int id, String displayName) { - return constructNewContact(contactCursor, nameCursor, id, number, 0, "", displayName, 0, 0, - 0, 0, 0, 0, 0); + return constructNewContact(contactCursor, nameCursor, id, number, id, String.valueOf(id), + displayName, 0, 0, 0, 0, 0, 0, 0); } private ContactNumber constructNewContact(MatrixCursor contactCursor, MatrixCursor nameCursor, |