-
Notifications
You must be signed in to change notification settings - Fork 129
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
Convert test code to kotlin #179
Conversation
Codecov Report
@@ Coverage Diff @@
## master #179 +/- ##
=========================================
Coverage 14.67% 14.67%
Complexity 442 442
=========================================
Files 125 125
Lines 8459 8459
Branches 1434 1434
=========================================
Hits 1241 1241
Misses 7062 7062
Partials 156 156 Continue to review full report at Codecov.
|
@farmerbb could you help to review this PR? Thanks. |
The generated kotlin project by Android Studio uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please change the variables in each test from private var
to private lateinit var
? That way we don't have to worry about overriding the null safety with !!
when accessing these variables. I personally prefer to avoid using !!
wherever possible, only using it as a very last resort.
1. Use Android Studio tool to convert test code to kotlin. 2. Fix null checking error, just adding !! and remove some ?. 3. Fix incompatibility of type between Int and Long in assert. Test: ./gradlew test Signed-off-by: utzcoz <utzcoz@outlook.com>
Test: ./gradlew test Signed-off-by: utzcoz <utzcoz@outlook.com>
It will help to reduce many !!. Test: ./gradlew test Signed-off-by: utzcoz <utzcoz@outlook.com>
75dc29e
to
2f9a714
Compare
The new commit processes it. |
The new commit also rebases on |
Thanks for doing that! Do you happen to know how we can add Kotlin support to the main codebase while still being able to compile on Android-x86? I think it involves converting our |
Yes, The |
Test:
./gradlew test
Close #177