aboutsummaryrefslogtreecommitdiffstats
path: root/prog
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-12-31 11:27:03 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-12-31 12:32:14 +0100
commitc5499485c222520773e6b48c0345f2d7b09c9015 (patch)
tree41a1b46a44a602bca6246406b0eec305d9343536 /prog
parent21cdbb61b86dcb6daced39274c6e8eaf81bf708d (diff)
prog: speed up TestResourceCtors
We check each resource multiple times. Check each resource once.
Diffstat (limited to 'prog')
-rw-r--r--prog/decl_test.go10
-rw-r--r--prog/mutation_test.go2
2 files changed, 4 insertions, 8 deletions
diff --git a/prog/decl_test.go b/prog/decl_test.go
index ac353e66a..29cacddd9 100644
--- a/prog/decl_test.go
+++ b/prog/decl_test.go
@@ -13,13 +13,9 @@ func TestResourceCtors(t *testing.T) {
t.Skip("too slow")
}
testEachTarget(t, func(t *testing.T, target *Target) {
- for _, c := range target.Syscalls {
- for _, res := range target.inputResources(c) {
- if len(target.calcResourceCtors(res.Kind, true)) == 0 {
- t.Errorf("call %v requires input resource %v,"+
- " but there are no calls that can create this resource",
- c.Name, res.Name)
- }
+ for _, res := range target.Resources {
+ if len(target.calcResourceCtors(res.Kind, true)) == 0 {
+ t.Errorf("resource %v can't be created", res.Name)
}
}
})
diff --git a/prog/mutation_test.go b/prog/mutation_test.go
index a29191539..100820dd7 100644
--- a/prog/mutation_test.go
+++ b/prog/mutation_test.go
@@ -106,7 +106,7 @@ mutate1()
{`
mutate4(&(0x7f0000000000)="11223344", 0x4)
`, `
-mutate4(&(0x7f0000000000)="112244", 0x3)
+mutate4(&(0x7f0000000000)="113344", 0x3)
`},
// Mutate data (insert byte and update size).
// TODO: this is not working, because Mutate constantly tends