Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 656f7a72 authored by satok's avatar satok
Browse files

Add a test for persist properties settings

Change-Id: I7bf70104a8cadc739a79d3d855d276628655883c
parent 6e71c954
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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);