Skip to content

Commit

Permalink
ktfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
growse committed Aug 30, 2024
1 parent ccbc708 commit c7a0ced
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import kotlinx.coroutines.CoroutineDispatcher
* [CountingIdlingResource] to track completion, and therefore makes it useful in an espresso
* context. From https://gist.github.com/jonreeve/6c6ea2cc5893c87cd0dabfb5d3d14eb3
*
* @constructor Create empty Espresso tracked dispatcher
* @property delegateDispatcher dispatcher to wrap
* @constructor Create empty Espresso tracked dispatcher
*/
class EspressoTrackedDispatcher(private val delegateDispatcher: CoroutineDispatcher) :
CoroutineDispatcher(), DispatcherWithIdlingResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import timber.log.Timber
* Idling resource that tracks data
*
* @param T
* @constructor Create empty Idling resource with data
* @property resourceName
* @constructor Create empty Idling resource with data
*/
class IdlingResourceWithData<T : MessageBase>(
private val resourceName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ open class ValidatingEditTextPreference : EditTextPreference {
/**
* An [InputFilter] that only allows characters in the supplied list to be input
*
* @constructor Create empty Specific chars input filter
* @property chars list of permitted [Char]
* @constructor Create empty Specific chars input filter
*/
class SpecificCharsInputFilter(private val chars: List<Char>) : InputFilter {
override fun filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ constructor(
get() {
return pubTopicBaseWithUserDetails + waypointTopicSuffix
}

// For status command
val pubTopicStatus: String
get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import org.owntracks.android.location.LatLng
/**
* Represents a camera view on a map. Location and zoom level. Zoom uses standrard (OSM) zoom units
*
* @constructor Create empty Map location and zoom level
* @property latLng location of the view
* @property zoom zoom level of the view
* @property rotation rotation angle of the view
* @constructor Create empty Map location and zoom level
*/
data class MapLocationZoomLevelAndRotation(
val latLng: LatLng,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import androidx.test.espresso.IdlingResource
* no-op version in release mode. This is the no-op implementation.
*
* @param debugCounting unused
* @constructor
* @property name Name of the idling resource
* @constructor
*/
class CountingIdlingResourceShim(
private val name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import org.owntracks.android.model.messages.MessageBase
* Idling resource that tracks data. Noop implementation
*
* @param T
* @constructor Create empty Idling resource with data
* @property resourceName
* @constructor Create empty Idling resource with data
*/
class IdlingResourceWithData<T : MessageBase>(
private val resourceName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import androidx.test.espresso.IdlingResource.ResourceCallback
* Simple idling resource. No-op version for release
*
* @param initialIdlingState
* @constructor
* @property resourceName
* @constructor
*/
class SimpleIdlingResource(
private val resourceName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ class ParserTest {
val secondMessageLocation = messages[1] as MessageLocation
assertEquals(1514455579L, secondMessageLocation.timestamp)
}

// endregion

// region Command Messages
Expand Down Expand Up @@ -567,6 +568,7 @@ class ParserTest {
.trimIndent()
parser.fromJson(input)
}

// endregion

// region Transition Messages
Expand Down Expand Up @@ -638,6 +640,7 @@ class ParserTest {
assertEquals(message.timestamp, jsonNode.get("tst").asLong())
assertEquals(message.waypointTimestamp, jsonNode.get("wtst").asLong())
}

// endregion

// region Configuration messages
Expand Down Expand Up @@ -755,6 +758,7 @@ class ParserTest {
assertEquals(13487, jsonNode.get("TestIntKey").asInt())
assertEquals("testString", jsonNode.get("TestStringKey").asText())
}

// endregion

// region Waypoint Messages
Expand Down Expand Up @@ -808,6 +812,7 @@ class ParserTest {
assertEquals(message.radius, jsonNode.get("rad").asInt())
assertEquals(message.timestamp, jsonNode.get("tst").asLong())
}

// endregion

// region Status Messages
Expand Down Expand Up @@ -836,6 +841,7 @@ class ParserTest {
assertEquals(message.android?.appHibernation, jsonNode.get("android").get("hib").asInt())
assertEquals(message.android?.locationPermission, jsonNode.get("android").get("loc").asInt())
}

// endregion

// region Clear Messages
Expand All @@ -856,6 +862,7 @@ class ParserTest {
val serialized = message.toJsonBytes(parser)
assertEquals(0, serialized.size)
}

// endregion

// Card Messages
Expand Down Expand Up @@ -902,6 +909,7 @@ class ParserTest {
assertEquals("MyName!", messageCard.name)
assertEquals("overridden-topic", messageCard.trackerId)
}

// endregion

// region Invalid messages
Expand Down Expand Up @@ -933,6 +941,7 @@ class ParserTest {
val parser = Parser(encryptionProvider)
parser.fromJson("not JSON")
}

// endregion

@Test
Expand Down

0 comments on commit c7a0ced

Please sign in to comment.