mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-04-05 05:47:36 +03:00
fix: Sort
This commit is contained in:
parent
587bfdc162
commit
4723fb39e9
3 changed files with 28 additions and 2 deletions
|
@ -204,6 +204,11 @@ class NodesAdapter (
|
||||||
&& oldItem.type == newItem.type
|
&& oldItem.type == newItem.type
|
||||||
&& oldItem.title == newItem.title
|
&& oldItem.title == newItem.title
|
||||||
&& oldItem.icon == newItem.icon
|
&& oldItem.icon == newItem.icon
|
||||||
|
&& oldItem.creationTime == newItem.creationTime
|
||||||
|
&& oldItem.lastModificationTime == newItem.lastModificationTime
|
||||||
|
&& oldItem.lastAccessTime == newItem.lastAccessTime
|
||||||
|
&& oldItem.expiryTime == newItem.expiryTime
|
||||||
|
&& oldItem.expires == newItem.expires
|
||||||
&& oldItem.isCurrentlyExpires == newItem.isCurrentlyExpires
|
&& oldItem.isCurrentlyExpires == newItem.isCurrentlyExpires
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,8 +229,8 @@ class DateInstant : Parcelable {
|
||||||
return this.mInstant.isAfter(dateInstant.mInstant)
|
return this.mInstant.isAfter(dateInstant.mInstant)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun compareTo(other: DateInstant?): Int {
|
fun compareTo(other: DateInstant): Int {
|
||||||
return mInstant.compareTo(other?.mInstant)
|
return mInstant.compareTo(other.mInstant)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Type {
|
enum class Type {
|
||||||
|
|
|
@ -165,6 +165,27 @@ class ValuesTest : TestCase() {
|
||||||
assertTrue("jDate $jDate and cDate $cDate not equal", cDate == jDate)
|
assertTrue("jDate $jDate and cDate $cDate not equal", cDate == jDate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun testDateCompare() {
|
||||||
|
val dateInstantA = DateInstant().apply {
|
||||||
|
setDate(2024, 12, 2)
|
||||||
|
setTime(5, 13)
|
||||||
|
}
|
||||||
|
val dateInstantB = DateInstant().apply {
|
||||||
|
setDate(2024, 12, 2)
|
||||||
|
setTime(5, 10)
|
||||||
|
}
|
||||||
|
val dateInstantC = DateInstant().apply {
|
||||||
|
setDate(2024, 12, 2)
|
||||||
|
setTime(5, 10)
|
||||||
|
}
|
||||||
|
assertTrue(dateInstantA.compareTo(dateInstantB) > 0)
|
||||||
|
assertTrue(dateInstantB.compareTo(dateInstantA) < 0)
|
||||||
|
assertTrue(dateInstantB.compareTo(dateInstantC) == 0)
|
||||||
|
assertTrue(dateInstantA.isAfter(dateInstantB))
|
||||||
|
assertTrue(dateInstantB.isBefore(dateInstantA))
|
||||||
|
assertFalse(dateInstantB.isBefore(dateInstantC))
|
||||||
|
}
|
||||||
|
|
||||||
fun testUUID() {
|
fun testUUID() {
|
||||||
val bUUID = ByteArray(16)
|
val bUUID = ByteArray(16)
|
||||||
Random().nextBytes(bUUID)
|
Random().nextBytes(bUUID)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue