From c5499485c222520773e6b48c0345f2d7b09c9015 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 31 Dec 2018 11:27:03 +0100 Subject: prog: speed up TestResourceCtors We check each resource multiple times. Check each resource once. --- prog/decl_test.go | 10 +++------- prog/mutation_test.go | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'prog') 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 -- cgit mrf-deployment