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

Commit 2ca0aa70 authored by Jon Miranda's avatar Jon Miranda
Browse files

Fix testChangeDefaultColumnTest.

I split testMigrateProfileId into two tests: one testing the migration
and one testing changing the default column test.

Since testChangeDefaultColumnTest does not migrate any profile ids, the
correct answer is indeed 1 and not 6. Next time I will be sure to run the
tests first :).

Change-Id: I7557e198072ed134c8b42d6187afcb93d388c5a1
parent 652b9ab5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class RestoreDbTaskTest {
            values.put(Favorites.TITLE, "item " + i);
            db.insert(Favorites.TABLE_NAME, null, values);
        }
        // Verify item add
        // Verify default column is 42
        assertEquals(5, getCount(db, "select * from favorites where profileId = 42"));

        new RestoreDbTask().changeDefaultColumn(db, 33);
@@ -68,7 +68,7 @@ public class RestoreDbTaskTest {
        values.put(Favorites._ID, 100);
        values.put(Favorites.TITLE, "item 100");
        db.insert(Favorites.TABLE_NAME, null, values);
        assertEquals(6, getCount(db, "select * from favorites where profileId = 33"));
        assertEquals(1, getCount(db, "select * from favorites where profileId = 33"));
    }

    private int getCount(SQLiteDatabase db, String sql) {