treewide: use Fatal in tests instead of Error
Error doesn't return the goroutine, but these cases are final and should end the test case.
Change-Id: I9d87e268b56acd7d1ff5883bb82bf3d74c309176
Reviewed-on: https://review.monogon.dev/c/monogon/+/4044
Reviewed-by: Jan Schär <jan@monogon.tech>
Tested-by: Jenkins CI
diff --git a/osbase/kmod/radix_test.go b/osbase/kmod/radix_test.go
index 6185beb..fa31f67 100644
--- a/osbase/kmod/radix_test.go
+++ b/osbase/kmod/radix_test.go
@@ -45,7 +45,7 @@
}
diff := cmp.Diff(c.expectedNodes, out, protocmp.Transform())
if diff != "" {
- t.Error(diff)
+ t.Fatal(diff)
}
})
}
@@ -56,18 +56,18 @@
Type: kmodpb.RadixNode_TYPE_LITERAL,
}
if err := AddPattern(root, "usb:v0B95p1790d*dc*dsc*dp*icFFiscFFip00in*", 2); err != nil {
- t.Error(err)
+ t.Fatal(err)
}
if err := AddPattern(root, "usb:v0B95p178Ad*dc*dsc*dp*icFFiscFFip00in*", 3); err != nil {
- t.Error(err)
+ t.Fatal(err)
}
if err := AddPattern(root, "acpi*:PNP0C14:*", 10); err != nil {
- t.Error(err)
+ t.Fatal(err)
}
matches := make(map[uint32]bool)
lookupModulesRec(root, "acpi:PNP0C14:asdf", matches)
if !matches[10] {
- t.Error("value should match pattern 10")
+ t.Fatal("value should match pattern 10")
}
}