Fix runtime panics being suppressed
fatalLog was matching runtime errors, and essentially hiding them.
Test: m blueprint_tools
Change-Id: Ib48e7e142fc096998bc14b21fb717392adcff0ec
diff --git a/ui/logger/logger_test.go b/ui/logger/logger_test.go
index bdf0231..044e6f0 100644
--- a/ui/logger/logger_test.go
+++ b/ui/logger/logger_test.go
@@ -196,3 +196,17 @@
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")
+}