diff options
author | satok <satok@google.com> | 2011-03-03 16:52:43 -0800 |
---|---|---|
committer | satok <satok@google.com> | 2011-03-03 17:42:40 -0800 |
commit | 656f7a729f8a01d42de610579e8cc2ba1f208076 (patch) | |
tree | d9a43555af62f4c5607ccf6b15033384ad6db289 /core/tests/systemproperties | |
parent | 6e71c954faff34b78a2952436b4f48d84a8c20cd (diff) | |
download | frameworks_base-656f7a729f8a01d42de610579e8cc2ba1f208076.zip frameworks_base-656f7a729f8a01d42de610579e8cc2ba1f208076.tar.gz frameworks_base-656f7a729f8a01d42de610579e8cc2ba1f208076.tar.bz2 |
Add a test for persist properties settings
Change-Id: I7bf70104a8cadc739a79d3d855d276628655883c
Diffstat (limited to 'core/tests/systemproperties')
-rw-r--r-- | core/tests/systemproperties/src/android/os/SystemPropertiesTest.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java b/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java index 243ac38..544a967 100644 --- a/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java +++ b/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java @@ -23,8 +23,19 @@ import android.test.suitebuilder.annotation.SmallTest; public class SystemPropertiesTest extends TestCase { private static final String KEY = "sys.testkey"; + private static final String PERSIST_KEY = "persist.sys.testkey"; + + @SmallTest + public void testStressPersistPropertyConsistency() throws Exception { + for (int i = 0; i < 100; ++i) { + SystemProperties.set(PERSIST_KEY, Long.toString(i)); + long ret = SystemProperties.getLong(PERSIST_KEY, -1); + assertEquals(i, ret); + } + } + @SmallTest - public void testLongSequencialProperties() throws Exception { + public void testStressMemoryPropertyConsistency() throws Exception { for (int i = 0; i < 100; ++i) { SystemProperties.set(KEY, Long.toString(i)); long ret = SystemProperties.getLong(KEY, -1); |