Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(#30): add unit/screenshot/instrumentation tests (SQUASH) #35

Merged
merged 52 commits into from
Dec 6, 2024

Conversation

iusmac
Copy link
Owner

@iusmac iusmac commented Dec 6, 2024

No description provided.

iusmac added 22 commits October 12, 2024 17:10
In order to fix warnings by CloseGuard need to close all the databases
involved in tests after completion.

---

System.logW: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
	at dalvik.system.CloseGuard.$$robo$$dalvik_system_CloseGuard$openWithCallSite(CloseGuard.java:288)
	at dalvik.system.CloseGuard.openWithCallSite(CloseGuard.java)
	at dalvik.system.CloseGuard.$$robo$$dalvik_system_CloseGuard$open(CloseGuard.java:257)
	at jdk.internal.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at org.robolectric.shadows.ShadowCloseGuard$CloseGuardReflector$$Reflector37.open(Unknown Source)
	at org.robolectric.shadows.ShadowCloseGuard.open(ShadowCloseGuard.java:38)
	at dalvik.system.CloseGuard.open(CloseGuard.java)
	at android.database.sqlite.SQLiteDatabase.$$robo$$android_database_sqlite_SQLiteDatabase$openInner(SQLiteDatabase.java:1088)
	at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java)
	at android.database.sqlite.SQLiteDatabase.$$robo$$android_database_sqlite_SQLiteDatabase$open(SQLiteDatabase.java:1067)
	at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java)
	at android.database.sqlite.SQLiteDatabase.$$robo$$android_database_sqlite_SQLiteDatabase$openDatabase(SQLiteDatabase.java:931)
	at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java)
	at android.database.sqlite.SQLiteDatabase.$$robo$$android_database_sqlite_SQLiteDatabase$createInMemory(SQLiteDatabase.java:1127)
	at android.database.sqlite.SQLiteDatabase.createInMemory(SQLiteDatabase.java)
	at android.database.sqlite.SQLiteOpenHelper.$$robo$$android_database_sqlite_SQLiteOpenHelper$getDatabaseLocked(SQLiteOpenHelper.java:368)
	at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java)
	at android.database.sqlite.SQLiteOpenHelper.$$robo$$android_database_sqlite_SQLiteOpenHelper$getWritableDatabase(SQLiteOpenHelper.java:316)
	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java)
	at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableOrReadableDatabase(FrameworkSQLiteOpenHelper.android.kt:223)
	at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.innerGetDatabase(FrameworkSQLiteOpenHelper.android.kt:170)
	at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getSupportDatabase(FrameworkSQLiteOpenHelper.android.kt:144)
	at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.android.kt:97)
	at androidx.room.RoomDatabase.inTransaction(RoomDatabase.android.kt:826)
	at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.android.kt:606)
	at com.github.iusmac.sevensim.telephony.SubscriptionsDao_Impl.findBySubscriptionId(SubscriptionsDao_Impl.java:113)
	at com.github.iusmac.sevensim.telephony.Subscriptions.createSubscription(Subscriptions.java:202)
	at com.github.iusmac.sevensim.telephony.SubscriptionsImplLegacy.createSubscription(SubscriptionsImplLegacy.java:145)
	at com.github.iusmac.sevensim.telephony.SubscriptionsImplLegacy$1.hasNext(SubscriptionsImplLegacy.java:105)
	at com.github.iusmac.sevensim.telephony.Subscriptions.getSubscription(Subscriptions.java:167)
	at com.github.iusmac.sevensim.telephony.SubscriptionsImplLegacy.getSubscriptionForSimSlotIndex(SubscriptionsImplLegacy.java:137)
	at com.github.iusmac.sevensim.telephony.SubscriptionsImplLegacyTest.lambda$test_getSubscriptionForSimSlotIndex_FoundMatchesForSlotIndex$4(SubscriptionsImplLegacyTest.java:177)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Most of these classes are imported from AOSP "as-is", so testing them is
out-of-scope. Others are is simply very tightly coupled with the app
itself, removing the need for extra testing.
@iusmac iusmac linked an issue Dec 6, 2024 that may be closed by this pull request
@iusmac iusmac merged commit 30853d0 into 14.0-dev Dec 6, 2024
1 check passed
@iusmac iusmac deleted the 30-add-tests branch December 6, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests
1 participant