Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aef8f96 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "PDL: Add array test packets" am: b15e1fbb

parents d341ae71 b15e1fbb
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
@@ -458,3 +458,50 @@ test OneBigValue {
  "\xff\xff\xff\xff\xff\xff\xff\xff",
  "\x00\x01\x02\x03\x04\x05\x06\x07",
}

packet ArrayOfBytes {
  _fixed_ = 8 : 8,
  bytes : 8[],
}

test ArrayOfBytes {
  "\x08\x01\x02\x03",
  "\x08\x05\x04\x03\x02\x01\x00",
  "\x08\x06\x05\x04\x03\x02\x01\x00",
}

packet ArrayOfSixteens {
  _fixed_ = 16 : 8,
  sixteens : 16[],
}

test ArrayOfSixteens {
  "\x10\x01\x11\x02\x12\x03\x13",
  "\x10\x05\x15\x04\x14\x03\x13\x02\x12\x01\x11\x00\x10",
  "\x10\x06\x16\x05\x15\x04\x14\x03\x13\x02\x12\x01\x11\x00\x10",
}

packet ArrayOfThirtyTwo {
  _fixed_ = 32 : 8,
  thirtytwos : 32[],
}

test ArrayOfThirtyTwo {
  "\x20\x01\x11\x21\x31\x02\x12\x22\x32\x03\x13\x23\x33",
  "\x20\x05\x15\x25\x35\x04\x14\x24\x34\x03\x13\x23\x33\x02\x12\x22\x32\x01\x11\x21\x31\x00\x10\x20\x30",
  "\x20\x06\x16\x26\x36\x05\x15\x25\x35\x04\x14\x24\x34\x03\x13\x23\x33\x02\x12\x22\x32\x01\x11\x21\x31\x00\x10\x20\x30",
}

packet Arrays {
  _size_(bytes) : 8,
  bytes : 8[],
  _size_(sixteens) : 8,
  sixteens : 16[],
  _size_(thirtytwos) : 8,
  thirtytwos : 32[]
}

test Arrays {
  "\x03\x01\x02\x03\x06\x01\x11\x02\x12\x03\x13\x0C\x01\x11\x21\x31\x02\x12\x22\x32\x03\x13\x23\x33",
  "\x06\x05\x04\x03\x02\x01\x00\x0C\x05\x15\x04\x14\x03\x13\x02\x12\x01\x11\x00\x10\x18\x05\x15\x25\x35\x04\x14\x24\x34\x03\x13\x23\x33\x02\x12\x22\x32\x01\x11\x21\x31\x00\x10\x20\x30",
}