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

Commit 9a797811 authored by Kweku Adams's avatar Kweku Adams Committed by Automerger Merge Worker
Browse files

Merge "Fix ScribeTest." into tm-dev am: 40ca086c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17184718

Change-Id: I5edfb65dcf2eb2b2287b123a1eaba379d957933e
parents 76c1de93 40ca086c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ public class ScribeTest {
        long lastReclamationTime = System.currentTimeMillis();
        long remainingConsumableNarcs = 2000L;
        long consumptionLimit = 500_000L;
        when(mIrs.getConsumptionLimitLocked()).thenReturn(consumptionLimit);

        Ledger ledger = mScribeUnderTest.getLedgerLocked(TEST_USER_ID, TEST_PACKAGE);
        ledger.recordTransaction(new Ledger.Transaction(0, 1000L, 1, null, 2000, 0));
@@ -119,8 +120,13 @@ public class ScribeTest {
        mScribeUnderTest.setConsumptionLimitLocked(consumptionLimit);
        mScribeUnderTest.adjustRemainingConsumableNarcsLocked(
                remainingConsumableNarcs - consumptionLimit);
        mScribeUnderTest.writeImmediatelyForTesting();

        assertEquals(lastReclamationTime, mScribeUnderTest.getLastReclamationTimeLocked());
        assertEquals(remainingConsumableNarcs,
                mScribeUnderTest.getRemainingConsumableNarcsLocked());
        assertEquals(consumptionLimit, mScribeUnderTest.getSatiatedConsumptionLimitLocked());

        mScribeUnderTest.writeImmediatelyForTesting();
        mScribeUnderTest.loadFromDiskLocked();

        assertEquals(lastReclamationTime, mScribeUnderTest.getLastReclamationTimeLocked());