-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This requires adding `col` to any function using it, recursively, until finding another function with `col` in its context. `Reviewer.onResume` has moved to `launchWithCol`, as otherwise tests crash with the following trace: ``` java.lang.NullPointerException at com.ichi2.anki.AnkiActivity.getCol(AnkiActivity.kt:151) at com.ichi2.anki.Reviewer.onResume(Reviewer.kt:191) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1476) at org.robolectric.android.internal.RoboMonitoringInstrumentation.callActivityOnResume(RoboMonitoringInstrumentation.java:321) at android.app.Activity.performResume(Activity.java:8191) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.robolectric.shadows._Activity_$$Reflector19.performResume(Unknown Source) at org.robolectric.android.controller.ActivityController.lambda$resume$5(ActivityController.java:197) at org.robolectric.shadows.ShadowPausedLooper.runPaused(ShadowPausedLooper.java:204) at org.robolectric.android.controller.ComponentController.invokeWhilePaused(ComponentController.java:64) at org.robolectric.android.controller.ActivityController.resume(ActivityController.java:192) at org.robolectric.android.internal.RoboMonitoringInstrumentation.startActivitySyncInternal(RoboMonitoringInstrumentation.java:121) at org.robolectric.android.internal.LocalActivityInvoker.startActivity(LocalActivityInvoker.java:35) at org.robolectric.android.internal.LocalActivityInvoker.startActivity(LocalActivityInvoker.java:40) at androidx.test.core.app.ActivityScenario.launchInternal(ActivityScenario.java:362) at androidx.test.core.app.ActivityScenario.launch(ActivityScenario.java:202) at com.ichi2.anki.ReviewerTest.verifyStartupNoCollection(ReviewerTest.kt:67) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:589) at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$2(SandboxTestRunner.java:290) at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:99) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Suppressed: org.robolectric.android.internal.AndroidTestEnvironment$UnExecutedRunnablesException: Main looper has queued unexecuted runnables. This might be the cause of the test failure. You might need a shadowOf(Looper.getMainLooper()).idle() call. ``` In the worst case, this slightly delays when the time starts again, which is acceptable. ---- Revived from 5f01180 Co-authored-by: Arthur Milchior <[email protected]>
- Loading branch information
1 parent
274a6bc
commit 65c9f91
Showing
30 changed files
with
241 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.