-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1721 from bugsnag/release/v5.25.0
v5.25.0
- Loading branch information
Showing
33 changed files
with
333 additions
and
224 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
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
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
47 changes: 47 additions & 0 deletions
47
bugsnag-android-core/src/test/java/com/bugsnag/android/internal/JsonHelperTest.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.bugsnag.android.internal | ||
|
||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
|
||
internal class JsonHelperTest { | ||
fun assertBidirectional(longValue: Long?, stringValue: String?) { | ||
assertEquals(stringValue, JsonHelper.ulongToHex(longValue)) | ||
assertEquals(longValue, JsonHelper.jsonToLong(stringValue)) | ||
} | ||
|
||
fun assertDecode(stringValue: String?, longValue: Long?) { | ||
assertEquals(longValue, JsonHelper.jsonToLong(stringValue)) | ||
} | ||
|
||
@Test | ||
fun jsonLongConversions() { | ||
assertBidirectional(null, null) | ||
assertBidirectional(0, "0x0") | ||
assertBidirectional(1, "0x1") | ||
assertBidirectional(0x7fffffffffffffff, "0x7fffffffffffffff") | ||
assertBidirectional(-1, "0xffffffffffffffff") | ||
assertBidirectional(-0x7fffffffffffffff, "0x8000000000000001") | ||
assertBidirectional(-0x7fffffffffffffff - 1, "0x8000000000000000") | ||
|
||
assertDecode("", null) | ||
assertDecode("0", 0) | ||
assertDecode("1", 1) | ||
assertDecode("-1", -1) | ||
assertDecode("9223372036854775807", 9223372036854775807) | ||
assertDecode("-9223372036854775807", -9223372036854775807) | ||
assertDecode("-9223372036854775808", -9223372036854775807 - 1) | ||
assertDecode("9223372036854775808", -9223372036854775807 - 1) | ||
assertDecode("0x8000000000000000", -9223372036854775807 - 1) | ||
assertDecode("18446744073709551615", -1) | ||
assertDecode("0xffffffffffffffff", -1) | ||
|
||
var didThrow = false | ||
try { | ||
JsonHelper.jsonToLong(false) | ||
} catch (e: IllegalArgumentException) { | ||
didThrow = true | ||
} finally { | ||
assert(didThrow, { "Expected to throw IllegalArgumentException" }) | ||
} | ||
} | ||
} |
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
6 changes: 3 additions & 3 deletions
6
bugsnag-android-core/src/test/resources/feature_flags_serialization_1.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[ | ||
{ | ||
"featureFlag": "sample_group", | ||
"variant": "b" | ||
"featureFlag": "demo_mode" | ||
}, | ||
{ | ||
"featureFlag": "demo_mode" | ||
"featureFlag": "sample_group", | ||
"variant": "b" | ||
} | ||
] |
Oops, something went wrong.