-
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.
- Loading branch information
Showing
26 changed files
with
259 additions
and
1,126 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
45 changes: 45 additions & 0 deletions
45
bugsnag-plugin-android-ndk/src/androidTest/java/com/bugsnag/android/ndk/UnwindTest.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,45 @@ | ||
package com.bugsnag.android.ndk | ||
|
||
import org.junit.Assert.assertEquals | ||
import org.junit.Assert.fail | ||
import org.junit.Test | ||
|
||
class UnwindTest { | ||
|
||
@Test | ||
fun testUnwindForNotify() { | ||
val frames = unwindForNotify() | ||
// the top of the stack includes the unwinder itself, etc, so first | ||
// scan for the expected contents, which must be a sequence | ||
var offset = frames.indexOf("unwind_func_four") | ||
if (offset == -1) { | ||
fail("did not find initial stack frame in list: $frames") | ||
} | ||
assertEquals("unwind_func_four", frames[offset]) | ||
assertEquals("unwind_func_three", frames[offset + 1]) | ||
assertEquals("unwind_func_two", frames[offset + 2]) | ||
assertEquals("unwind_func_one", frames[offset + 3]) | ||
assertEquals("Java_com_bugsnag_android_ndk_UnwindTest_unwindForNotify", frames[offset + 4]) | ||
} | ||
|
||
@Test | ||
fun testUnwindForCrash() { | ||
val frames = unwindForCrash() | ||
// the top of the stack includes the unwinder itself, etc, so first | ||
// scan for the expected contents, which must be a sequence | ||
var offset = frames.indexOf("unwind_func_four") | ||
if (offset == -1) { | ||
fail("did not find initial stack frame in list: $frames") | ||
} | ||
assertEquals("unwind_func_four", frames[offset]) | ||
assertEquals("unwind_func_three", frames[offset + 1]) | ||
assertEquals("unwind_func_two", frames[offset + 2]) | ||
assertEquals("unwind_func_one", frames[offset + 3]) | ||
assertEquals("Java_com_bugsnag_android_ndk_UnwindTest_unwindForCrash", frames[offset + 4]) | ||
} | ||
|
||
// unwind a known set of functions and validate the method names in the | ||
// stack | ||
external fun unwindForNotify(): List<String> | ||
external fun unwindForCrash(): List<String> | ||
} |
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
55 changes: 0 additions & 55 deletions
55
bugsnag-plugin-android-ndk/src/main/jni/external/libunwind/include/__libunwind_config.h
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.