diff options
| -rw-r--r-- | prog/encoding_test.go | 12 | ||||
| -rw-r--r-- | sys/test/test.txt | 15 |
2 files changed, 27 insertions, 0 deletions
diff --git a/prog/encoding_test.go b/prog/encoding_test.go index daa2ac0cb..677375d7f 100644 --- a/prog/encoding_test.go +++ b/prog/encoding_test.go @@ -261,6 +261,18 @@ func TestDeserialize(t *testing.T) { Err: `wrong type *prog.IntType for AUTO`, }, { + In: `test$auto1(AUTO, &AUTO=AUTO, AUTO, 0x0)`, + Out: `test$auto1(0x42, &(0x7f0000000040)={0xc, 0x43, 0x0}, 0xc, 0x0)`, + }, + { + In: `test$auto2(AUTO, &AUTO=AUTO, AUTO, 0x0)`, + Out: `test$auto2(0x42, &(0x7f0000000040)={0x10, {0xc, 0x43, 0x0}}, 0x10, 0x0)`, + }, + { + In: `test$auto0(AUTO, &AUTO=AUTO, AUTO, 0x0)`, + Err: `wrong type *prog.IntType for AUTO`, + }, + { In: `test$str0(&AUTO="303100090a0d7022273a")`, Out: `test$str0(&(0x7f0000000040)='01\x00\t\n\rp\"\':')`, }, diff --git a/sys/test/test.txt b/sys/test/test.txt index fed8d0f47..768b7b584 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -811,6 +811,21 @@ auto_struct0 { f2 int32 } +test$auto1(a const[0x42], b ptr[in, auto_struct1], c len[b], d int32) + +auto_struct1 { + f0 len[parent, int32] + f1 const[0x43, int32] + f2 const[0, int32] +} + +test$auto2(a const[0x42], b ptr[in, auto_struct2], c len[b], d int32) + +auto_struct2 { + f0 len[parent, int32] + f1 auto_struct1 +} + # Attributes resource disabled_resource[int32] |
