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

Commit d2cecfd3 authored by Vasu Nori's avatar Vasu Nori
Browse files

fix broken-test

Change-Id: I3d33cda2e4f1ba68843d6a81b8c624ce4af8519f
parent 0829f0d5
Loading
Loading
Loading
Loading
+3 −21
Original line number Diff line number Diff line
@@ -1385,8 +1385,8 @@ public class DatabaseGeneralTest extends AndroidTestCase implements PerformanceT
        assertTrue(statementIds.contains(stmt0Id));
        assertEquals(1, statementIds.size());

        // close the database. native method dbclose() will finalize all statements
        // before closing the database.
        // close the database. everything from mClosedStatementIds in mDatabase
        // should be finalized and cleared from the list
        // again do it in a separate thread
        Thread t3 = new Thread() {
            @Override public void run() {
@@ -1396,25 +1396,7 @@ public class DatabaseGeneralTest extends AndroidTestCase implements PerformanceT
        t3.start();
        t3.join();

        // check mClosedStatementIds in mDatabase. it should still have 'stmt0Id'
        statementIds = mDatabase.getQueuedUpStmtList();
        assertTrue(statementIds.contains(stmt0Id));

        // try to finalize the pending statements. and there should be no exceptions from anywhere
        // just for the heck of it, do it in a separate thread
        Thread t4 = new Thread() {
            @Override public void run() {
                try {
                    mDatabase.closePendingStatements();
                } catch (Exception e) {
                    fail("not expected");
                }
            }
        };
        t4.start();
        t4.join();

        // mClosedStatementIds in mDatabase should be empty
        // check mClosedStatementIds in mDatabase. it should be empty
        statementIds = mDatabase.getQueuedUpStmtList();
        assertEquals(0, statementIds.size());
    }