Skip to content

Commit

Permalink
pass stackoverflow scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Feb 22, 2018
1 parent 4a65ab8 commit 1ddd49a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions features/stackoverflow.feature
Expand Up @@ -2,11 +2,15 @@ Feature: Android support

Scenario: Stack Overflow
When I run "StackOverflowScenario" with the defaults
# Need to wait a while to trigger this in release mode
And I wait for 1 seconds
Then I should receive a request
And the request is a valid for the error reporting API
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa"
And the payload field "notifier.name" equals "Android Bugsnag Notifier"
And the payload field "events" is an array with 1 element
And the exception "errorClass" equals "java.lang.OutOfMemoryError"
And the "method" of stack frame 0 equals "java.lang"
#method, file, lineNumber
And the exception "errorClass" equals "java.lang.StackOverflowError"
And the "method" of stack frame 0 equals "com.bugsnag.android.mazerunner.scenarios.StackOverflowScenario.calculateValue"
And the "method" of stack frame 1 equals "com.bugsnag.android.mazerunner.scenarios.StackOverflowScenario.calculateValue"
And the "method" of stack frame 2 equals "com.bugsnag.android.mazerunner.scenarios.StackOverflowScenario.calculateValue"
And the "method" of stack frame 3 equals "com.bugsnag.android.mazerunner.scenarios.StackOverflowScenario.calculateValue"
Expand Up @@ -6,7 +6,10 @@ package com.bugsnag.android.mazerunner.scenarios
internal class StackOverflowScenario : Scenario() {

override fun run() {
run()
calculateValue(0)
}

private fun calculateValue(count: Long): Long {
return calculateValue(count + 1) + calculateValue(count - 1)
}
}

0 comments on commit 1ddd49a

Please sign in to comment.