From 2ab437bb1e9f9f34d2e080ad11c944464a8bd944 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 22 Mar 2020 14:23:35 +0100 Subject: prog: improve TestDeserializeHelper 1. Allow to not provide Out if it's the same as In. 2. Always check Out. --- sys/linux/init_test.go | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'sys/linux/init_test.go') diff --git a/sys/linux/init_test.go b/sys/linux/init_test.go index fb3068295..ba6dd9462 100644 --- a/sys/linux/init_test.go +++ b/sys/linux/init_test.go @@ -21,8 +21,7 @@ func TestNeutralize(t *testing.T) { Out: `syslog(0x9, 0x0, 0x0)`, }, { - In: `syslog(0x1, 0x0, 0x0)`, - Out: `syslog(0x1, 0x0, 0x0)`, + In: `syslog(0x1, 0x0, 0x0)`, }, { @@ -34,16 +33,14 @@ func TestNeutralize(t *testing.T) { Out: `ptrace$peek(0xffffffffffffffff, 0x0, &(0x7f0000000000))`, }, { - In: `ptrace(0x1, 0x0)`, - Out: `ptrace(0x1, 0x0)`, + In: `ptrace(0x1, 0x0)`, }, { In: `arch_prctl$ARCH_SET_GS(0xf00000001002, 0x0)`, Out: `arch_prctl$ARCH_SET_GS(0x1001, 0x0)`, }, { - In: `arch_prctl$ARCH_SET_GS(0x1003, 0x0)`, - Out: `arch_prctl$ARCH_SET_GS(0x1003, 0x0)`, + In: `arch_prctl$ARCH_SET_GS(0x1003, 0x0)`, }, { In: `ioctl(0x0, 0x200000c0045877, 0x0)`, @@ -58,32 +55,27 @@ func TestNeutralize(t *testing.T) { Out: `fanotify_mark(0x1, 0x2, 0x4078e029, 0x3, 0x0)`, }, { - In: `fanotify_mark(0xffffffffffffffff, 0xffffffffffffffff, 0xfffffffffff8ffff, 0xffffffffffffffff, 0x0)`, - Out: `fanotify_mark(0xffffffffffffffff, 0xffffffffffffffff, 0xfffffffffff8ffff, 0xffffffffffffffff, 0x0)`, + In: `fanotify_mark(0xffffffffffffffff, 0xffffffffffffffff, 0xfffffffffff8ffff, 0xffffffffffffffff, 0x0)`, }, { In: `syz_init_net_socket$bt_hci(0x1, 0x0, 0x0)`, Out: `syz_init_net_socket$bt_hci(0xffffffffffffffff, 0x0, 0x0)`, }, { - In: `syz_init_net_socket$bt_hci(0x27, 0x0, 0x0)`, - Out: `syz_init_net_socket$bt_hci(0x27, 0x0, 0x0)`, + In: `syz_init_net_socket$bt_hci(0x27, 0x0, 0x0)`, }, { - In: `syz_init_net_socket$bt_hci(0x1a, 0x0, 0x0)`, - Out: `syz_init_net_socket$bt_hci(0x1a, 0x0, 0x0)`, + In: `syz_init_net_socket$bt_hci(0x1a, 0x0, 0x0)`, }, { - In: `syz_init_net_socket$bt_hci(0x1f, 0x0, 0x0)`, - Out: `syz_init_net_socket$bt_hci(0x1f, 0x0, 0x0)`, + In: `syz_init_net_socket$bt_hci(0x1f, 0x0, 0x0)`, }, { In: `mmap(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)`, Out: `mmap(0x0, 0x0, 0x0, 0x10, 0x0, 0x0)`, }, { - In: `mremap(0x0, 0x0, 0x0, 0xcc, 0x0)`, - Out: `mremap(0x0, 0x0, 0x0, 0xcc, 0x0)`, + In: `mremap(0x0, 0x0, 0x0, 0xcc, 0x0)`, }, { In: `mremap(0x0, 0x0, 0x0, 0xcd, 0x0)`, -- cgit mrf-deployment