add: get_raw_bit
This commit is contained in:
18
tests/get_raw_bit.🗿
Normal file
18
tests/get_raw_bit.🗿
Normal file
@ -0,0 +1,18 @@
|
||||
main()
|
||||
{
|
||||
local tab;
|
||||
|
||||
name = "get_raw_bit";
|
||||
|
||||
tab = get_raw_bit(1);
|
||||
test_tab_num(tab, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, 16, "");
|
||||
free(tab);
|
||||
|
||||
tab = get_raw_bit(2);
|
||||
test_tab_num(tab, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, 16, "");
|
||||
free(tab);
|
||||
|
||||
tab = get_raw_bit(0x8000);
|
||||
test_tab_num(tab, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, 16, "");
|
||||
free(tab);
|
||||
}
|
23
tests/test.🗿
23
tests/test.🗿
@ -74,11 +74,30 @@ test_tab_str(value, reach_value, description)
|
||||
putstr(": ERROR: ");
|
||||
putstr(", ");
|
||||
putstr(description);
|
||||
putstr(" [");
|
||||
puttab_str(reach_value);
|
||||
putstr(" != ");
|
||||
puttab_str(value);
|
||||
putstr("]");
|
||||
}
|
||||
else
|
||||
{
|
||||
putstr(": OK: ");
|
||||
putstr(description);
|
||||
}
|
||||
wrt '\n';
|
||||
}
|
||||
|
||||
|
||||
test_tab_num(value, reach_value, size, description)
|
||||
{
|
||||
putstr(name);
|
||||
if (tabcmp_num(value, reach_value, size))
|
||||
{
|
||||
putstr(": ERROR: ");
|
||||
putstr(", ");
|
||||
putstr(description);
|
||||
puttab_num(reach_value, size);
|
||||
putstr(" != ");
|
||||
puttab_num(value, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user