aboutsummaryrefslogtreecommitdiffstats
path: root/prog/size_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/size_test.go')
-rw-r--r--prog/size_test.go128
1 files changed, 64 insertions, 64 deletions
diff --git a/prog/size_test.go b/prog/size_test.go
index 7fed10fdc..f0bf6c2f0 100644
--- a/prog/size_test.go
+++ b/prog/size_test.go
@@ -29,134 +29,134 @@ func TestAssignSizeRandom(t *testing.T) {
func TestAssignSize(t *testing.T) {
// nolint: lll
- testDeserialize(t, func(target *Target, p *Prog) {
+ TestDeserializeHelper(t, "test", "64", func(target *Target, p *Prog) {
for _, call := range p.Calls {
target.assignSizesCall(call)
}
- }, []deserializeTest{
+ }, []DeserializeTest{
{
- input: "test$length0(&(0x7f0000000000)={0xff, 0x0})",
- output: "test$length0(&(0x7f0000000000)={0xff, 0x2})",
+ In: "test$length0(&(0x7f0000000000)={0xff, 0x0})",
+ Out: "test$length0(&(0x7f0000000000)={0xff, 0x2})",
},
{
- input: "test$length1(&(0x7f0000001000)={0xff, 0x0})",
- output: "test$length1(&(0x7f0000001000)={0xff, 0x4})",
+ In: "test$length1(&(0x7f0000001000)={0xff, 0x0})",
+ Out: "test$length1(&(0x7f0000001000)={0xff, 0x4})",
},
{
- input: "test$length2(&(0x7f0000001000)={0xff, 0x0})",
- output: "test$length2(&(0x7f0000001000)={0xff, 0x8})",
+ In: "test$length2(&(0x7f0000001000)={0xff, 0x0})",
+ Out: "test$length2(&(0x7f0000001000)={0xff, 0x8})",
},
{
- input: "test$length3(&(0x7f0000005000)={0xff, 0x0, 0x0})",
- output: "test$length3(&(0x7f0000005000)={0xff, 0x4, 0x2})",
+ In: "test$length3(&(0x7f0000005000)={0xff, 0x0, 0x0})",
+ Out: "test$length3(&(0x7f0000005000)={0xff, 0x4, 0x2})",
},
{
- input: "test$length4(&(0x7f0000003000)={0x0, 0x0})",
- output: "test$length4(&(0x7f0000003000)={0x2, 0x2})",
+ In: "test$length4(&(0x7f0000003000)={0x0, 0x0})",
+ Out: "test$length4(&(0x7f0000003000)={0x2, 0x2})",
},
{
- input: "test$length5(&(0x7f0000002000)={0xff, 0x0})",
- output: "test$length5(&(0x7f0000002000)={0xff, 0x4})",
+ In: "test$length5(&(0x7f0000002000)={0xff, 0x0})",
+ Out: "test$length5(&(0x7f0000002000)={0xff, 0x4})",
},
{
- input: "test$length6(&(0x7f0000002000)={[0xff, 0xff, 0xff, 0xff], 0x0})",
- output: "test$length6(&(0x7f0000002000)={[0xff, 0xff, 0xff, 0xff], 0x4})",
+ In: "test$length6(&(0x7f0000002000)={[0xff, 0xff, 0xff, 0xff], 0x0})",
+ Out: "test$length6(&(0x7f0000002000)={[0xff, 0xff, 0xff, 0xff], 0x4})",
},
{
- input: "test$length7(&(0x7f0000003000)={[0xff, 0xff, 0xff, 0xff], 0x0})",
- output: "test$length7(&(0x7f0000003000)={[0xff, 0xff, 0xff, 0xff], 0x8})",
+ In: "test$length7(&(0x7f0000003000)={[0xff, 0xff, 0xff, 0xff], 0x0})",
+ Out: "test$length7(&(0x7f0000003000)={[0xff, 0xff, 0xff, 0xff], 0x8})",
},
{
- input: "test$length8(&(0x7f000001f000)={0x00, {0xff, 0x0, 0x00, [0xff, 0xff, 0xff]}, [{0xff, 0x0, 0x00, [0xff, 0xff, 0xff]}], 0x00, 0x0, [0xff, 0xff]})",
- output: "test$length8(&(0x7f000001f000)={0x32, {0xff, 0x1, 0x10, [0xff, 0xff, 0xff]}, [{0xff, 0x1, 0x10, [0xff, 0xff, 0xff]}], 0x10, 0x1, [0xff, 0xff]})",
+ In: "test$length8(&(0x7f000001f000)={0x00, {0xff, 0x0, 0x00, [0xff, 0xff, 0xff]}, [{0xff, 0x0, 0x00, [0xff, 0xff, 0xff]}], 0x00, 0x0, [0xff, 0xff]})",
+ Out: "test$length8(&(0x7f000001f000)={0x32, {0xff, 0x1, 0x10, [0xff, 0xff, 0xff]}, [{0xff, 0x1, 0x10, [0xff, 0xff, 0xff]}], 0x10, 0x1, [0xff, 0xff]})",
},
{
- input: "test$length9(&(0x7f000001f000)={&(0x7f0000000000/0x5000)=nil, 0x0000})",
- output: "test$length9(&(0x7f000001f000)={&(0x7f0000000000/0x5000)=nil, 0x5000})",
+ In: "test$length9(&(0x7f000001f000)={&(0x7f0000000000/0x5000)=nil, 0x0000})",
+ Out: "test$length9(&(0x7f000001f000)={&(0x7f0000000000/0x5000)=nil, 0x5000})",
},
{
- input: "test$length10(&(0x7f0000000000/0x5000)=nil, 0x0000, 0x0000, 0x0000, 0x0000)",
- output: "test$length10(&(0x7f0000000000/0x5000)=nil, 0x5000, 0x5000, 0x2800, 0x1400)",
+ In: "test$length10(&(0x7f0000000000/0x5000)=nil, 0x0000, 0x0000, 0x0000, 0x0000)",
+ Out: "test$length10(&(0x7f0000000000/0x5000)=nil, 0x5000, 0x5000, 0x2800, 0x1400)",
},
{
- input: "test$length11(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x00)",
- output: "test$length11(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x30)",
+ In: "test$length11(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x00)",
+ Out: "test$length11(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x30)",
},
{
- input: "test$length12(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x00)",
- output: "test$length12(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x30)",
+ In: "test$length12(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x00)",
+ Out: "test$length12(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, 0x30)",
},
{
- input: "test$length13(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x00)",
- output: "test$length13(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x30)",
+ In: "test$length13(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x00)",
+ Out: "test$length13(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x30)",
},
{
- input: "test$length14(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x00)",
- output: "test$length14(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x30)",
+ In: "test$length14(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x00)",
+ Out: "test$length14(&(0x7f0000000000)={0xff, 0xff, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]}, &(0x7f0000001000)=0x30)",
},
{
- input: "test_length15(0xff, 0x0)",
- output: "test_length15(0xff, 0x2)",
+ In: "test_length15(0xff, 0x0)",
+ Out: "test_length15(0xff, 0x2)",
},
{
- input: "test$length16(&(0x7f0000000000)={[0x42, 0x42], 0xff, 0xff, 0xff, 0xff, 0xff})",
- output: "test$length16(&(0x7f0000000000)={[0x42, 0x42], 0x2, 0x10, 0x8, 0x4, 0x2})",
+ In: "test$length16(&(0x7f0000000000)={[0x42, 0x42], 0xff, 0xff, 0xff, 0xff, 0xff})",
+ Out: "test$length16(&(0x7f0000000000)={[0x42, 0x42], 0x2, 0x10, 0x8, 0x4, 0x2})",
},
{
- input: "test$length17(&(0x7f0000000000)={0x42, 0xff, 0xff, 0xff, 0xff})",
- output: "test$length17(&(0x7f0000000000)={0x42, 0x8, 0x4, 0x2, 0x1})",
+ In: "test$length17(&(0x7f0000000000)={0x42, 0xff, 0xff, 0xff, 0xff})",
+ Out: "test$length17(&(0x7f0000000000)={0x42, 0x8, 0x4, 0x2, 0x1})",
},
{
- input: "test$length18(&(0x7f0000000000)={0x42, 0xff, 0xff, 0xff, 0xff})",
- output: "test$length18(&(0x7f0000000000)={0x42, 0x8, 0x4, 0x2, 0x1})",
+ In: "test$length18(&(0x7f0000000000)={0x42, 0xff, 0xff, 0xff, 0xff})",
+ Out: "test$length18(&(0x7f0000000000)={0x42, 0x8, 0x4, 0x2, 0x1})",
},
{
- input: "test$length19(&(0x7f0000000000)={{0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0xff}, 0xff, 0xff, 0xff})",
- output: "test$length19(&(0x7f0000000000)={{0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x14}, 0x14, 0x14, 0x5})",
+ In: "test$length19(&(0x7f0000000000)={{0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0xff}, 0xff, 0xff, 0xff})",
+ Out: "test$length19(&(0x7f0000000000)={{0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x14}, 0x14, 0x14, 0x5})",
},
{
- input: "test$length20(&(0x7f0000000000)={{{0xff, 0xff, 0xff, 0xff}, 0xff, 0xff, 0xff}, 0xff, 0xff})",
- output: "test$length20(&(0x7f0000000000)={{{0x4, 0x4, 0x7, 0x9}, 0x7, 0x7, 0x9}, 0x9, 0x9})",
+ In: "test$length20(&(0x7f0000000000)={{{0xff, 0xff, 0xff, 0xff}, 0xff, 0xff, 0xff}, 0xff, 0xff})",
+ Out: "test$length20(&(0x7f0000000000)={{{0x4, 0x4, 0x7, 0x9}, 0x7, 0x7, 0x9}, 0x9, 0x9})",
},
{
- input: "test$length21(&(0x7f0000000000)=0x0, 0x0)",
- output: "test$length21(&(0x7f0000000000), 0x40)",
+ In: "test$length21(&(0x7f0000000000)=0x0, 0x0)",
+ Out: "test$length21(&(0x7f0000000000), 0x40)",
},
{
- input: "test$length22(&(0x7f0000000000)='12345', 0x0)",
- output: "test$length22(&(0x7f0000000000)='12345', 0x28)",
+ In: "test$length22(&(0x7f0000000000)='12345', 0x0)",
+ Out: "test$length22(&(0x7f0000000000)='12345', 0x28)",
},
{
- input: "test$length23(&(0x7f0000000000)={0x1, {0x2, 0x0}})",
- output: "test$length23(&(0x7f0000000000)={0x1, {0x2, 0x6}})",
+ In: "test$length23(&(0x7f0000000000)={0x1, {0x2, 0x0}})",
+ Out: "test$length23(&(0x7f0000000000)={0x1, {0x2, 0x6}})",
},
{
- input: "test$length24(&(0x7f0000000000)={{0x0, {0x0}}, {0x0, {0x0}}})",
- output: "test$length24(&(0x7f0000000000)={{0x0, {0x8}}, {0x0, {0x10}}})",
+ In: "test$length24(&(0x7f0000000000)={{0x0, {0x0}}, {0x0, {0x0}}})",
+ Out: "test$length24(&(0x7f0000000000)={{0x0, {0x8}}, {0x0, {0x10}}})",
},
{
- input: "test$length26(&(0x7f0000000000), 0x0)",
- output: "test$length26(&(0x7f0000000000), 0x8)",
+ In: "test$length26(&(0x7f0000000000), 0x0)",
+ Out: "test$length26(&(0x7f0000000000), 0x8)",
},
{
- input: "test$length27(&(0x7f0000000000), 0x0)",
- output: "test$length27(&(0x7f0000000000), 0x2a)",
+ In: "test$length27(&(0x7f0000000000), 0x0)",
+ Out: "test$length27(&(0x7f0000000000), 0x2a)",
},
{
- input: "test$length28(&(0x7f0000000000), 0x0)",
- output: "test$length28(&(0x7f0000000000), 0x2a)",
+ In: "test$length28(&(0x7f0000000000), 0x0)",
+ Out: "test$length28(&(0x7f0000000000), 0x2a)",
},
{
- input: "test$length29(&(0x7f0000000000)={'./a\\x00', './b/c\\x00', 0x0, 0x0, 0x0})",
- output: "test$length29(&(0x7f0000000000)={'./a\\x00', './b/c\\x00', 0xa, 0x14, 0x21})",
+ In: "test$length29(&(0x7f0000000000)={'./a\\x00', './b/c\\x00', 0x0, 0x0, 0x0})",
+ Out: "test$length29(&(0x7f0000000000)={'./a\\x00', './b/c\\x00', 0xa, 0x14, 0x21})",
},
{
- input: "test$length30(&(0x7f0000000000)={{{0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, {'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)=&(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, 0x0}, 0x0}, 0x0, &(0x7f0000000000)=0x0, 0x0)",
- output: "test$length30(&(0x7f0000000000)={{{0x0, 0x18, 0x1, 0x3, 0x5, 0x6}, {'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)=&(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, 0x2}, 0x4}, 0x40, &(0x7f0000000000)=0x18, 0x2)",
+ In: "test$length30(&(0x7f0000000000)={{{0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, {'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)=&(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, 0x0}, 0x0}, 0x0, &(0x7f0000000000)=0x0, 0x0)",
+ Out: "test$length30(&(0x7f0000000000)={{{0x0, 0x18, 0x1, 0x3, 0x5, 0x6}, {'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, &(0x7f0000000000)=&(0x7f0000000000)={'a', 'aaa', 'aaaaa', 'aaaaaa'}, 0x2}, 0x4}, 0x40, &(0x7f0000000000)=0x18, 0x2)",
},
{
- input: "test$offsetof0(&(0x7f0000000000)={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0})",
- output: "test$offsetof0(&(0x7f0000000000)={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x6, 0x8, 0x10, 0x18, 0x18, 0x20})",
+ In: "test$offsetof0(&(0x7f0000000000)={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0})",
+ Out: "test$offsetof0(&(0x7f0000000000)={0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x6, 0x8, 0x10, 0x18, 0x18, 0x20})",
},
})
}