summaryrefslogtreecommitdiffstats
path: root/keystore
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2012-07-17 23:40:49 -0700
committerBrian Carlstrom <bdc@google.com>2012-07-27 22:41:42 -0700
commit5ea68db37fd5ad4e0ddc0745b4347e86f17f78db (patch)
tree9ff7f7392fa6a74f2304362f173092ec342dce99 /keystore
parentdfac68eacc60c130e54345d98bd45c99573cb627 (diff)
downloadframeworks_base-5ea68db37fd5ad4e0ddc0745b4347e86f17f78db.zip
frameworks_base-5ea68db37fd5ad4e0ddc0745b4347e86f17f78db.tar.gz
frameworks_base-5ea68db37fd5ad4e0ddc0745b4347e86f17f78db.tar.bz2
Improve test key names to reproduce public issue
Also fixes other unrelated test failures. Bug: http://code.google.com/p/android/issues/detail?id=34577 Bug: 6837950 (cherry-picked from f4019af04a1fc4b16aa5972cbcbba703caa5d78d) Change-Id: I5b32b5ccac80f04a4d0fd6b21b8caa11e42995a7
Diffstat (limited to 'keystore')
-rwxr-xr-xkeystore/tests/src/android/security/KeyStoreTest.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/keystore/tests/src/android/security/KeyStoreTest.java b/keystore/tests/src/android/security/KeyStoreTest.java
index 008d682..91c56d6 100755
--- a/keystore/tests/src/android/security/KeyStoreTest.java
+++ b/keystore/tests/src/android/security/KeyStoreTest.java
@@ -35,9 +35,9 @@ import java.util.HashSet;
public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
private static final String TEST_PASSWD = "12345678";
private static final String TEST_PASSWD2 = "87654321";
- private static final String TEST_KEYNAME = "testkey";
- private static final String TEST_KEYNAME1 = "testkey1";
- private static final String TEST_KEYNAME2 = "testkey2";
+ private static final String TEST_KEYNAME = "test-key";
+ private static final String TEST_KEYNAME1 = "test-key.1";
+ private static final String TEST_KEYNAME2 = "test-key.2";
private static final byte[] TEST_KEYVALUE = "test value".getBytes(Charsets.UTF_8);
// "Hello, World" in Chinese
@@ -45,10 +45,12 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
private static final byte[] TEST_I18N_VALUE = TEST_I18N_KEY.getBytes(Charsets.UTF_8);
// Test vector data for signatures
- private static final byte[] TEST_DATA = {
- (byte) 0x00, (byte) 0xA0, (byte) 0xFF, (byte) 0x0A, (byte) 0x00, (byte) 0xFF,
- (byte) 0xAA, (byte) 0x55, (byte) 0x05, (byte) 0x5A,
- };
+ private static final byte[] TEST_DATA = new byte[256];
+ static {
+ for (int i = 0; i < TEST_DATA.length; i++) {
+ TEST_DATA[i] = (byte) i;
+ }
+ }
private KeyStore mKeyStore = null;
@@ -155,9 +157,9 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
}
public void testDelete() throws Exception {
- assertTrue(mKeyStore.delete(TEST_KEYNAME));
+ assertFalse(mKeyStore.delete(TEST_KEYNAME));
mKeyStore.password(TEST_PASSWD);
- assertTrue(mKeyStore.delete(TEST_KEYNAME));
+ assertFalse(mKeyStore.delete(TEST_KEYNAME));
mKeyStore.put(TEST_KEYNAME, TEST_KEYVALUE);
assertTrue(Arrays.equals(TEST_KEYVALUE, mKeyStore.get(TEST_KEYNAME)));