Merge pull request #7 from Shizmob/feature/array-alignment-testcase

testcases: add array packing/alignment test case
This commit is contained in:
Will
2023-06-03 10:11:54 +10:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -8,9 +8,11 @@
<!-- Testing encoding, plus __type-less should become string -->
<superstar babe="<22>~<7E>c<EFBFBD><63>"><EFBFBD>V<EFBFBD>@<40>C<EFBFBD>X<EFBFBD>@<40>}<7D>C<EFBFBD>@<40><><EFBFBD>C<EFBFBD>t</superstar>
<!-- Testing 6bit conversion -->
<xXx_T4GG3R_xXx __type="3u8">8 9 10</xXx_T4GG3R_xXx>
<!-- Shouldn't have alignment issues from the 3u8 -->
<xXx_T4GG3R_xXx __type="2u8">8 9</xXx_T4GG3R_xXx>
<!-- Shouldn't have alignment issues from the 2u8 -->
<aligned __type="u8">12</aligned>
<!-- Array contents are never packed -->
<aligned_arr __type="u8" __count="1">13</aligned_arr>
<!-- Binary parsing -->
<entry __type="binary">DEADBEEF</entry>
<!-- Lowercase, too -->

View File

@@ -3,8 +3,9 @@
<entry __type="ip4" __count="2">127.0.0.1 192.168.0.1</entry>
<entry __type="str" attr="test" attr2="best">Hello, world!</entry>
<superstar __type="str" babe="ミツル">シ イス マイ ワイフ</superstar>
<xXx_T4GG3R_xXx __type="3u8">8 9 10</xXx_T4GG3R_xXx>
<xXx_T4GG3R_xXx __type="2u8">8 9</xXx_T4GG3R_xXx>
<aligned __type="u8">12</aligned>
<aligned_arr __type="u8" __count="1">13</aligned_arr>
<entry __type="bin" __size="4">deadbeef</entry>
<entry __type="bin" __size="4">deadbe7a</entry>
<entry __type="3u8" __count="2">1 2 3 1 2 3</entry>