From 38f7f18ea979939d7221851bf2e455b00cdc3c40 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Tue, 12 Jan 2021 16:56:13 +0100 Subject: syz-manager: fix endianess for covfilter test Support little as well as big endian architectures. Fixes this on s390x arch: === RUN TestCreateBitmap 2021/01/12 16:42:44 coverage filter from 0x81000000 to 0x81200020, size 0x200020, pcs 2 covfilter_test.go:22: bad region 0x81/0x20002000 --- FAIL: TestCreateBitmap (0.18s) Signed-off-by: Alexander Egorenkov --- syz-manager/covfilter_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/syz-manager/covfilter_test.go b/syz-manager/covfilter_test.go index d3f52b3e2..0df988e56 100644 --- a/syz-manager/covfilter_test.go +++ b/syz-manager/covfilter_test.go @@ -4,7 +4,6 @@ package main import ( - "encoding/binary" "testing" "github.com/google/syzkaller/sys/targets" @@ -15,9 +14,11 @@ func TestCreateBitmap(t *testing.T) { 0x81000002: 1, 0x8120001d: 1, } - bitmap := createCoverageBitmap(targets.Get("test", "64"), pcs) - start := binary.LittleEndian.Uint32(bitmap[0:]) - size := binary.LittleEndian.Uint32(bitmap[4:]) + target := targets.Get("test", "64") + order := target.HostEndian + bitmap := createCoverageBitmap(target, pcs) + start := order.Uint32(bitmap[0:]) + size := order.Uint32(bitmap[4:]) if start != 0x81000000 || size != 0x200020 { t.Fatalf("bad region 0x%x/0x%x", start, size) } -- cgit mrf-deployment