Fix runtime panics being suppressed

fatalLog was matching runtime errors, and essentially hiding them.

Test: m blueprint_tools
Change-Id: Ib48e7e142fc096998bc14b21fb717392adcff0ec
This commit is contained in:
Dan Willemsen
2019-01-28 20:00:01 -08:00
parent 62f6fcbbb9
commit ef661b7f18
2 changed files with 20 additions and 4 deletions

View File

@@ -196,3 +196,17 @@ func TestRecoverNonFatal(t *testing.T) {
log.Panic("Test")
t.Errorf("Should not get here")
}
func TestRuntimePanic(t *testing.T) {
defer func() {
if p := recover(); p == nil {
t.Errorf("Panic not thrown")
}
}()
defer Recover(func(err error) {
t.Errorf("Recover function should not be called")
})
var i *int
*i = 0
t.Errorf("Should not get here")
}