diff --git a/test/buf_parse_test.c b/test/buf_parse_test.c
index 74f6040..13534d1 100644
--- a/test/buf_parse_test.c
+++ b/test/buf_parse_test.c
@@ -679,6 +679,10 @@ void buf_parse_test_integer_bin ();
void buf_parse_test_ident ();
void buf_parse_test_list ();
void buf_parse_test_s8 ();
+void buf_parse_test_s16 ();
+void buf_parse_test_s32 ();
+void buf_parse_test_s64 ();
+void buf_parse_test_sw ();
void buf_parse_test_str ();
void buf_parse_test_str_character ();
void buf_parse_test_str_u8 ();
@@ -686,6 +690,10 @@ void buf_parse_test_sym ();
void buf_parse_test_tag ();
void buf_parse_test_tuple ();
void buf_parse_test_u8 ();
+void buf_parse_test_u16 ();
+void buf_parse_test_u32 ();
+void buf_parse_test_u64 ();
+void buf_parse_test_uw ();
void buf_parse_test ()
{
@@ -714,7 +722,15 @@ void buf_parse_test ()
buf_parse_test_tag();
buf_parse_test_tuple();
buf_parse_test_u8();
+ buf_parse_test_u16();
+ buf_parse_test_u32();
+ buf_parse_test_u64();
+ buf_parse_test_uw();
buf_parse_test_s8();
+ buf_parse_test_s16();
+ buf_parse_test_s32();
+ buf_parse_test_s64();
+ buf_parse_test_sw();
buf_parse_test_cfn();
}
@@ -1152,17 +1168,27 @@ void buf_parse_test_s8 ()
BUF_PARSE_TEST_S(8, "-0x7", -7);
BUF_PARSE_TEST_S(8, "-0x8", -8);
BUF_PARSE_TEST_S(8, "-0x9", -9);
+ BUF_PARSE_TEST_S(8, "-0xa", -10);
BUF_PARSE_TEST_S(8, "-0xA", -10);
+ BUF_PARSE_TEST_S(8, "-0xb", -11);
BUF_PARSE_TEST_S(8, "-0xB", -11);
+ BUF_PARSE_TEST_S(8, "-0xc", -12);
BUF_PARSE_TEST_S(8, "-0xC", -12);
+ BUF_PARSE_TEST_S(8, "-0xd", -13);
BUF_PARSE_TEST_S(8, "-0xD", -13);
+ BUF_PARSE_TEST_S(8, "-0xe", -14);
BUF_PARSE_TEST_S(8, "-0xE", -14);
+ BUF_PARSE_TEST_S(8, "-0xf", -15);
BUF_PARSE_TEST_S(8, "-0xF", -15);
BUF_PARSE_TEST_S(8, "-0x00", 0);
BUF_PARSE_TEST_S(8, "-0x01", -1);
BUF_PARSE_TEST_S(8, "-0x10", -16);
BUF_PARSE_TEST_S(8, "-0x11", -17);
BUF_PARSE_TEST_S(8, "-0x000", 0);
+ BUF_PARSE_TEST_S(8, "-0x7f", -127);
+ BUF_PARSE_TEST_S(8, "-0x7F", -127);
+ BUF_PARSE_TEST_S(8, "-0x07f", -127);
+ BUF_PARSE_TEST_S(8, "-0x07F", -127);
BUF_PARSE_TEST_S(8, "-0x80", -128);
BUF_PARSE_TEST_S(8, "-0x080", -128);
BUF_PARSE_TEST_S(8, "-0", 0);
@@ -1273,6 +1299,519 @@ void buf_parse_test_s8 ()
BUF_PARSE_TEST_S(8, "0127", 127);
}
+void buf_parse_test_s16 ()
+{
+ BUF_PARSE_TEST_S(16, "-0b0", 0);
+ BUF_PARSE_TEST_S(16, "-0b1", -1);
+ BUF_PARSE_TEST_S(16, "-0b00", 0);
+ BUF_PARSE_TEST_S(16, "-0b01", -1);
+ BUF_PARSE_TEST_S(16, "-0b10", -2);
+ BUF_PARSE_TEST_S(16, "-0b11", -3);
+ BUF_PARSE_TEST_S(16, "-0b000", 0);
+ BUF_PARSE_TEST_S(16, "-0b001", -1);
+ BUF_PARSE_TEST_S(16, "-0b010", -2);
+ BUF_PARSE_TEST_S(16, "-0b011", -3);
+ BUF_PARSE_TEST_S(16, "-0b100", -4);
+ BUF_PARSE_TEST_S(16, "-0b101", -5);
+ BUF_PARSE_TEST_S(16, "-0b110", -6);
+ BUF_PARSE_TEST_S(16, "-0b111", -7);
+ BUF_PARSE_TEST_S(16, "-0b10000000", -128);
+ BUF_PARSE_TEST_S(16, "-0b010000000", -128);
+ BUF_PARSE_TEST_S(16, "-0b111111111111111", -32767);
+ BUF_PARSE_TEST_S(16, "-0b0111111111111111", -32767);
+ BUF_PARSE_TEST_S(16, "-0b1000000000000000", -32768);
+ BUF_PARSE_TEST_S(16, "-0b01000000000000000", -32768);
+ BUF_PARSE_TEST_S(16, "-0o0", 0);
+ BUF_PARSE_TEST_S(16, "-0o1", -1);
+ BUF_PARSE_TEST_S(16, "-0o2", -2);
+ BUF_PARSE_TEST_S(16, "-0o3", -3);
+ BUF_PARSE_TEST_S(16, "-0o4", -4);
+ BUF_PARSE_TEST_S(16, "-0o5", -5);
+ BUF_PARSE_TEST_S(16, "-0o6", -6);
+ BUF_PARSE_TEST_S(16, "-0o7", -7);
+ BUF_PARSE_TEST_S(16, "-0o00", 0);
+ BUF_PARSE_TEST_S(16, "-0o01", -1);
+ BUF_PARSE_TEST_S(16, "-0o10", -8);
+ BUF_PARSE_TEST_S(16, "-0o11", -9);
+ BUF_PARSE_TEST_S(16, "-0o000", 0);
+ BUF_PARSE_TEST_S(16, "-0o177", -127);
+ BUF_PARSE_TEST_S(16, "-0o0177", -127);
+ BUF_PARSE_TEST_S(16, "-0o200", -128);
+ BUF_PARSE_TEST_S(16, "-0o0200", -128);
+ BUF_PARSE_TEST_S(16, "-0o77777", -32767);
+ BUF_PARSE_TEST_S(16, "-0o077777", -32767);
+ BUF_PARSE_TEST_S(16, "-0o100000", -32768);
+ BUF_PARSE_TEST_S(16, "-0o0100000", -32768);
+ BUF_PARSE_TEST_S(16, "-0x0", 0);
+ BUF_PARSE_TEST_S(16, "-0x1", -1);
+ BUF_PARSE_TEST_S(16, "-0x2", -2);
+ BUF_PARSE_TEST_S(16, "-0x3", -3);
+ BUF_PARSE_TEST_S(16, "-0x4", -4);
+ BUF_PARSE_TEST_S(16, "-0x5", -5);
+ BUF_PARSE_TEST_S(16, "-0x6", -6);
+ BUF_PARSE_TEST_S(16, "-0x7", -7);
+ BUF_PARSE_TEST_S(16, "-0x8", -8);
+ BUF_PARSE_TEST_S(16, "-0x9", -9);
+ BUF_PARSE_TEST_S(16, "-0xa", -10);
+ BUF_PARSE_TEST_S(16, "-0xA", -10);
+ BUF_PARSE_TEST_S(16, "-0xb", -11);
+ BUF_PARSE_TEST_S(16, "-0xB", -11);
+ BUF_PARSE_TEST_S(16, "-0xc", -12);
+ BUF_PARSE_TEST_S(16, "-0xC", -12);
+ BUF_PARSE_TEST_S(16, "-0xd", -13);
+ BUF_PARSE_TEST_S(16, "-0xD", -13);
+ BUF_PARSE_TEST_S(16, "-0xe", -14);
+ BUF_PARSE_TEST_S(16, "-0xE", -14);
+ BUF_PARSE_TEST_S(16, "-0xf", -15);
+ BUF_PARSE_TEST_S(16, "-0xF", -15);
+ BUF_PARSE_TEST_S(16, "-0x00", 0);
+ BUF_PARSE_TEST_S(16, "-0x01", -1);
+ BUF_PARSE_TEST_S(16, "-0x10", -16);
+ BUF_PARSE_TEST_S(16, "-0x11", -17);
+ BUF_PARSE_TEST_S(16, "-0x000", 0);
+ BUF_PARSE_TEST_S(16, "-0x7f", -127);
+ BUF_PARSE_TEST_S(16, "-0x7F", -127);
+ BUF_PARSE_TEST_S(16, "-0x07f", -127);
+ BUF_PARSE_TEST_S(16, "-0x07F", -127);
+ BUF_PARSE_TEST_S(16, "-0x80", -128);
+ BUF_PARSE_TEST_S(16, "-0x080", -128);
+ BUF_PARSE_TEST_S(16, "-0xff", -255);
+ BUF_PARSE_TEST_S(16, "-0xFF", -255);
+ BUF_PARSE_TEST_S(16, "-0x0ff", -255);
+ BUF_PARSE_TEST_S(16, "-0x0FF", -255);
+ BUF_PARSE_TEST_S(16, "-0x100", -256);
+ BUF_PARSE_TEST_S(16, "-0x0100", -256);
+ BUF_PARSE_TEST_S(16, "-0x7fff", -32767);
+ BUF_PARSE_TEST_S(16, "-0x7FFF", -32767);
+ BUF_PARSE_TEST_S(16, "-0x07fff", -32767);
+ BUF_PARSE_TEST_S(16, "-0x07FFF", -32767);
+ BUF_PARSE_TEST_S(16, "-0x8000", -32768);
+ BUF_PARSE_TEST_S(16, "-0x08000", -32768);
+ BUF_PARSE_TEST_S(16, "-0", 0);
+ BUF_PARSE_TEST_S(16, "-1", -1);
+ BUF_PARSE_TEST_S(16, "-2", -2);
+ BUF_PARSE_TEST_S(16, "-3", -3);
+ BUF_PARSE_TEST_S(16, "-4", -4);
+ BUF_PARSE_TEST_S(16, "-5", -5);
+ BUF_PARSE_TEST_S(16, "-6", -6);
+ BUF_PARSE_TEST_S(16, "-7", -7);
+ BUF_PARSE_TEST_S(16, "-8", -8);
+ BUF_PARSE_TEST_S(16, "-9", -9);
+ BUF_PARSE_TEST_S(16, "-00", 0);
+ BUF_PARSE_TEST_S(16, "-10", -10);
+ BUF_PARSE_TEST_S(16, "-11", -11);
+ BUF_PARSE_TEST_S(16, "-12", -12);
+ BUF_PARSE_TEST_S(16, "-20", -20);
+ BUF_PARSE_TEST_S(16, "-21", -21);
+ BUF_PARSE_TEST_S(16, "-22", -22);
+ BUF_PARSE_TEST_S(16, "-000", 0);
+ BUF_PARSE_TEST_S(16, "-010", -10);
+ BUF_PARSE_TEST_S(16, "-011", -11);
+ BUF_PARSE_TEST_S(16, "-012", -12);
+ BUF_PARSE_TEST_S(16, "-020", -20);
+ BUF_PARSE_TEST_S(16, "-021", -21);
+ BUF_PARSE_TEST_S(16, "-022", -22);
+ BUF_PARSE_TEST_S(16, "-127", -127);
+ BUF_PARSE_TEST_S(16, "-0127", -127);
+ BUF_PARSE_TEST_S(16, "-128", -128);
+ BUF_PARSE_TEST_S(16, "-0128", -128);
+ BUF_PARSE_TEST_S(16, "-32767", -32767);
+ BUF_PARSE_TEST_S(16, "-032767", -32767);
+ BUF_PARSE_TEST_S(16, "-32768", -32768);
+ BUF_PARSE_TEST_S(16, "-032768", -32768);
+ BUF_PARSE_TEST_S(16, "0b0", 0);
+ BUF_PARSE_TEST_S(16, "0b1", 1);
+ BUF_PARSE_TEST_S(16, "0b00", 0);
+ BUF_PARSE_TEST_S(16, "0b01", 1);
+ BUF_PARSE_TEST_S(16, "0b10", 2);
+ BUF_PARSE_TEST_S(16, "0b11", 3);
+ BUF_PARSE_TEST_S(16, "0b000", 0);
+ BUF_PARSE_TEST_S(16, "0b001", 1);
+ BUF_PARSE_TEST_S(16, "0b010", 2);
+ BUF_PARSE_TEST_S(16, "0b011", 3);
+ BUF_PARSE_TEST_S(16, "0b100", 4);
+ BUF_PARSE_TEST_S(16, "0b101", 5);
+ BUF_PARSE_TEST_S(16, "0b110", 6);
+ BUF_PARSE_TEST_S(16, "0b111", 7);
+ BUF_PARSE_TEST_S(16, "0b1111111", 127);
+ BUF_PARSE_TEST_S(16, "0b01111111", 127);
+ BUF_PARSE_TEST_S(16, "0b10000000", 128);
+ BUF_PARSE_TEST_S(16, "0b010000000", 128);
+ BUF_PARSE_TEST_S(16, "0b111111111111111", 32767);
+ BUF_PARSE_TEST_S(16, "0b0111111111111111", 32767);
+ BUF_PARSE_TEST_S(16, "0o0", 0);
+ BUF_PARSE_TEST_S(16, "0o1", 1);
+ BUF_PARSE_TEST_S(16, "0o2", 2);
+ BUF_PARSE_TEST_S(16, "0o3", 3);
+ BUF_PARSE_TEST_S(16, "0o4", 4);
+ BUF_PARSE_TEST_S(16, "0o5", 5);
+ BUF_PARSE_TEST_S(16, "0o6", 6);
+ BUF_PARSE_TEST_S(16, "0o7", 7);
+ BUF_PARSE_TEST_S(16, "0o00", 0);
+ BUF_PARSE_TEST_S(16, "0o01", 1);
+ BUF_PARSE_TEST_S(16, "0o10", 8);
+ BUF_PARSE_TEST_S(16, "0o11", 9);
+ BUF_PARSE_TEST_S(16, "0o000", 0);
+ BUF_PARSE_TEST_S(16, "0o177", 127);
+ BUF_PARSE_TEST_S(16, "0o0177", 127);
+ BUF_PARSE_TEST_S(16, "0o200", 128);
+ BUF_PARSE_TEST_S(16, "0o0200", 128);
+ BUF_PARSE_TEST_S(16, "0o77777", 32767);
+ BUF_PARSE_TEST_S(16, "0o077777", 32767);
+ BUF_PARSE_TEST_S(16, "0x0", 0);
+ BUF_PARSE_TEST_S(16, "0x1", 1);
+ BUF_PARSE_TEST_S(16, "0x2", 2);
+ BUF_PARSE_TEST_S(16, "0x3", 3);
+ BUF_PARSE_TEST_S(16, "0x4", 4);
+ BUF_PARSE_TEST_S(16, "0x5", 5);
+ BUF_PARSE_TEST_S(16, "0x6", 6);
+ BUF_PARSE_TEST_S(16, "0x7", 7);
+ BUF_PARSE_TEST_S(16, "0x8", 8);
+ BUF_PARSE_TEST_S(16, "0x9", 9);
+ BUF_PARSE_TEST_S(16, "0xa", 10);
+ BUF_PARSE_TEST_S(16, "0xA", 10);
+ BUF_PARSE_TEST_S(16, "0xb", 11);
+ BUF_PARSE_TEST_S(16, "0xB", 11);
+ BUF_PARSE_TEST_S(16, "0xc", 12);
+ BUF_PARSE_TEST_S(16, "0xC", 12);
+ BUF_PARSE_TEST_S(16, "0xd", 13);
+ BUF_PARSE_TEST_S(16, "0xD", 13);
+ BUF_PARSE_TEST_S(16, "0xe", 14);
+ BUF_PARSE_TEST_S(16, "0xE", 14);
+ BUF_PARSE_TEST_S(16, "0xf", 15);
+ BUF_PARSE_TEST_S(16, "0xF", 15);
+ BUF_PARSE_TEST_S(16, "0x00", 0);
+ BUF_PARSE_TEST_S(16, "0x01", 1);
+ BUF_PARSE_TEST_S(16, "0x10", 16);
+ BUF_PARSE_TEST_S(16, "0x11", 17);
+ BUF_PARSE_TEST_S(16, "0x000", 0);
+ BUF_PARSE_TEST_S(16, "0x7f", 127);
+ BUF_PARSE_TEST_S(16, "0x7F", 127);
+ BUF_PARSE_TEST_S(16, "0x07f", 127);
+ BUF_PARSE_TEST_S(16, "0x07F", 127);
+ BUF_PARSE_TEST_S(16, "0x80", 128);
+ BUF_PARSE_TEST_S(16, "0x080", 128);
+ BUF_PARSE_TEST_S(16, "0xff", 255);
+ BUF_PARSE_TEST_S(16, "0xFF", 255);
+ BUF_PARSE_TEST_S(16, "0x0ff", 255);
+ BUF_PARSE_TEST_S(16, "0x0FF", 255);
+ BUF_PARSE_TEST_S(16, "0x100", 256);
+ BUF_PARSE_TEST_S(16, "0x0100", 256);
+ BUF_PARSE_TEST_S(16, "0x7fff", 32767);
+ BUF_PARSE_TEST_S(16, "0x7FFF", 32767);
+ BUF_PARSE_TEST_S(16, "0x07fff", 32767);
+ BUF_PARSE_TEST_S(16, "0x07FFF", 32767);
+ BUF_PARSE_TEST_S(16, "0", 0);
+ BUF_PARSE_TEST_S(16, "1", 1);
+ BUF_PARSE_TEST_S(16, "2", 2);
+ BUF_PARSE_TEST_S(16, "3", 3);
+ BUF_PARSE_TEST_S(16, "4", 4);
+ BUF_PARSE_TEST_S(16, "5", 5);
+ BUF_PARSE_TEST_S(16, "6", 6);
+ BUF_PARSE_TEST_S(16, "7", 7);
+ BUF_PARSE_TEST_S(16, "8", 8);
+ BUF_PARSE_TEST_S(16, "9", 9);
+ BUF_PARSE_TEST_S(16, "00", 0);
+ BUF_PARSE_TEST_S(16, "10", 10);
+ BUF_PARSE_TEST_S(16, "11", 11);
+ BUF_PARSE_TEST_S(16, "12", 12);
+ BUF_PARSE_TEST_S(16, "20", 20);
+ BUF_PARSE_TEST_S(16, "21", 21);
+ BUF_PARSE_TEST_S(16, "22", 22);
+ BUF_PARSE_TEST_S(16, "000", 0);
+ BUF_PARSE_TEST_S(16, "010", 10);
+ BUF_PARSE_TEST_S(16, "011", 11);
+ BUF_PARSE_TEST_S(16, "012", 12);
+ BUF_PARSE_TEST_S(16, "020", 20);
+ BUF_PARSE_TEST_S(16, "021", 21);
+ BUF_PARSE_TEST_S(16, "022", 22);
+ BUF_PARSE_TEST_S(16, "127", 127);
+ BUF_PARSE_TEST_S(16, "0127", 127);
+ BUF_PARSE_TEST_S(16, "128", 128);
+ BUF_PARSE_TEST_S(16, "0128", 128);
+ BUF_PARSE_TEST_S(16, "32767", 32767);
+ BUF_PARSE_TEST_S(16, "032767", 32767);
+}
+
+void buf_parse_test_s32 ()
+{
+ BUF_PARSE_TEST_S(32, "-0b0", 0);
+ BUF_PARSE_TEST_S(32, "-0b1", -1);
+ BUF_PARSE_TEST_S(32, "-0b00", 0);
+ BUF_PARSE_TEST_S(32, "-0b01", -1);
+ BUF_PARSE_TEST_S(32, "-0b10", -2);
+ BUF_PARSE_TEST_S(32, "-0b11", -3);
+ BUF_PARSE_TEST_S(32, "-0b000", 0);
+ BUF_PARSE_TEST_S(32, "-0b001", -1);
+ BUF_PARSE_TEST_S(32, "-0b010", -2);
+ BUF_PARSE_TEST_S(32, "-0b011", -3);
+ BUF_PARSE_TEST_S(32, "-0b100", -4);
+ BUF_PARSE_TEST_S(32, "-0b101", -5);
+ BUF_PARSE_TEST_S(32, "-0b110", -6);
+ BUF_PARSE_TEST_S(32, "-0b111", -7);
+ BUF_PARSE_TEST_S(32, "-0b10000000", -128);
+ BUF_PARSE_TEST_S(32, "-0b010000000", -128);
+ BUF_PARSE_TEST_S(32, "-0b111111111111111", -32767);
+ BUF_PARSE_TEST_S(32, "-0b0111111111111111", -32767);
+ BUF_PARSE_TEST_S(32, "-0b1000000000000000", -32768);
+ BUF_PARSE_TEST_S(32, "-0b01000000000000000", -32768);
+ BUF_PARSE_TEST_S(32, "-0b1111111111111111111111111111111", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0b01111111111111111111111111111111", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0b10000000000000000000000000000000", -2147483648);
+ BUF_PARSE_TEST_S(32, "-0b010000000000000000000000000000000", -2147483648);
+ BUF_PARSE_TEST_S(32, "-0o0", 0);
+ BUF_PARSE_TEST_S(32, "-0o1", -1);
+ BUF_PARSE_TEST_S(32, "-0o2", -2);
+ BUF_PARSE_TEST_S(32, "-0o3", -3);
+ BUF_PARSE_TEST_S(32, "-0o4", -4);
+ BUF_PARSE_TEST_S(32, "-0o5", -5);
+ BUF_PARSE_TEST_S(32, "-0o6", -6);
+ BUF_PARSE_TEST_S(32, "-0o7", -7);
+ BUF_PARSE_TEST_S(32, "-0o00", 0);
+ BUF_PARSE_TEST_S(32, "-0o01", -1);
+ BUF_PARSE_TEST_S(32, "-0o10", -8);
+ BUF_PARSE_TEST_S(32, "-0o11", -9);
+ BUF_PARSE_TEST_S(32, "-0o000", 0);
+ BUF_PARSE_TEST_S(32, "-0o177", -127);
+ BUF_PARSE_TEST_S(32, "-0o0177", -127);
+ BUF_PARSE_TEST_S(32, "-0o200", -128);
+ BUF_PARSE_TEST_S(32, "-0o0200", -128);
+ BUF_PARSE_TEST_S(32, "-0o77777", -32767);
+ BUF_PARSE_TEST_S(32, "-0o077777", -32767);
+ BUF_PARSE_TEST_S(32, "-0o100000", -32768);
+ BUF_PARSE_TEST_S(32, "-0o0100000", -32768);
+ BUF_PARSE_TEST_S(32, "-0o17777777777", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0o017777777777", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0o20000000000", -2147483648);
+ BUF_PARSE_TEST_S(32, "-0o020000000000", -2147483648);
+ BUF_PARSE_TEST_S(32, "-0x0", 0);
+ BUF_PARSE_TEST_S(32, "-0x1", -1);
+ BUF_PARSE_TEST_S(32, "-0x2", -2);
+ BUF_PARSE_TEST_S(32, "-0x3", -3);
+ BUF_PARSE_TEST_S(32, "-0x4", -4);
+ BUF_PARSE_TEST_S(32, "-0x5", -5);
+ BUF_PARSE_TEST_S(32, "-0x6", -6);
+ BUF_PARSE_TEST_S(32, "-0x7", -7);
+ BUF_PARSE_TEST_S(32, "-0x8", -8);
+ BUF_PARSE_TEST_S(32, "-0x9", -9);
+ BUF_PARSE_TEST_S(32, "-0xa", -10);
+ BUF_PARSE_TEST_S(32, "-0xA", -10);
+ BUF_PARSE_TEST_S(32, "-0xb", -11);
+ BUF_PARSE_TEST_S(32, "-0xB", -11);
+ BUF_PARSE_TEST_S(32, "-0xc", -12);
+ BUF_PARSE_TEST_S(32, "-0xC", -12);
+ BUF_PARSE_TEST_S(32, "-0xd", -13);
+ BUF_PARSE_TEST_S(32, "-0xD", -13);
+ BUF_PARSE_TEST_S(32, "-0xe", -14);
+ BUF_PARSE_TEST_S(32, "-0xE", -14);
+ BUF_PARSE_TEST_S(32, "-0xf", -15);
+ BUF_PARSE_TEST_S(32, "-0xF", -15);
+ BUF_PARSE_TEST_S(32, "-0x00", 0);
+ BUF_PARSE_TEST_S(32, "-0x01", -1);
+ BUF_PARSE_TEST_S(32, "-0x10", -16);
+ BUF_PARSE_TEST_S(32, "-0x11", -17);
+ BUF_PARSE_TEST_S(32, "-0x000", 0);
+ BUF_PARSE_TEST_S(32, "-0x7f", -127);
+ BUF_PARSE_TEST_S(32, "-0x7F", -127);
+ BUF_PARSE_TEST_S(32, "-0x07f", -127);
+ BUF_PARSE_TEST_S(32, "-0x07F", -127);
+ BUF_PARSE_TEST_S(32, "-0x80", -128);
+ BUF_PARSE_TEST_S(32, "-0x080", -128);
+ BUF_PARSE_TEST_S(32, "-0xff", -255);
+ BUF_PARSE_TEST_S(32, "-0xFF", -255);
+ BUF_PARSE_TEST_S(32, "-0x0ff", -255);
+ BUF_PARSE_TEST_S(32, "-0x0FF", -255);
+ BUF_PARSE_TEST_S(32, "-0x100", -256);
+ BUF_PARSE_TEST_S(32, "-0x0100", -256);
+ BUF_PARSE_TEST_S(32, "-0x7fff", -32767);
+ BUF_PARSE_TEST_S(32, "-0x7FFF", -32767);
+ BUF_PARSE_TEST_S(32, "-0x07fff", -32767);
+ BUF_PARSE_TEST_S(32, "-0x07FFF", -32767);
+ BUF_PARSE_TEST_S(32, "-0x8000", -32768);
+ BUF_PARSE_TEST_S(32, "-0x08000", -32768);
+ BUF_PARSE_TEST_S(32, "-0x7fffffff", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0x7FFFFFFF", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0x07fffffff", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0x07FFFFFFF", -2147483647);
+ BUF_PARSE_TEST_S(32, "-0x80000000", -2147483648);
+ BUF_PARSE_TEST_S(32, "-0x080000000", -2147483648);
+ BUF_PARSE_TEST_S(32, "-0", 0);
+ BUF_PARSE_TEST_S(32, "-1", -1);
+ BUF_PARSE_TEST_S(32, "-2", -2);
+ BUF_PARSE_TEST_S(32, "-3", -3);
+ BUF_PARSE_TEST_S(32, "-4", -4);
+ BUF_PARSE_TEST_S(32, "-5", -5);
+ BUF_PARSE_TEST_S(32, "-6", -6);
+ BUF_PARSE_TEST_S(32, "-7", -7);
+ BUF_PARSE_TEST_S(32, "-8", -8);
+ BUF_PARSE_TEST_S(32, "-9", -9);
+ BUF_PARSE_TEST_S(32, "-00", 0);
+ BUF_PARSE_TEST_S(32, "-10", -10);
+ BUF_PARSE_TEST_S(32, "-11", -11);
+ BUF_PARSE_TEST_S(32, "-12", -12);
+ BUF_PARSE_TEST_S(32, "-20", -20);
+ BUF_PARSE_TEST_S(32, "-21", -21);
+ BUF_PARSE_TEST_S(32, "-22", -22);
+ BUF_PARSE_TEST_S(32, "-000", 0);
+ BUF_PARSE_TEST_S(32, "-010", -10);
+ BUF_PARSE_TEST_S(32, "-011", -11);
+ BUF_PARSE_TEST_S(32, "-012", -12);
+ BUF_PARSE_TEST_S(32, "-020", -20);
+ BUF_PARSE_TEST_S(32, "-021", -21);
+ BUF_PARSE_TEST_S(32, "-022", -22);
+ BUF_PARSE_TEST_S(32, "-127", -127);
+ BUF_PARSE_TEST_S(32, "-0127", -127);
+ BUF_PARSE_TEST_S(32, "-128", -128);
+ BUF_PARSE_TEST_S(32, "-0128", -128);
+ BUF_PARSE_TEST_S(32, "-32767", -32767);
+ BUF_PARSE_TEST_S(32, "-032767", -32767);
+ BUF_PARSE_TEST_S(32, "-32768", -32768);
+ BUF_PARSE_TEST_S(32, "-032768", -32768);
+ BUF_PARSE_TEST_S(32, "-2147483647", -2147483647);
+ BUF_PARSE_TEST_S(32, "-2147483647", -2147483647);
+ BUF_PARSE_TEST_S(32, "-2147483648", -2147483648);
+ BUF_PARSE_TEST_S(32, "-2147483648", -2147483648);
+ BUF_PARSE_TEST_S(32, "0b0", 0);
+ BUF_PARSE_TEST_S(32, "0b1", 1);
+ BUF_PARSE_TEST_S(32, "0b00", 0);
+ BUF_PARSE_TEST_S(32, "0b01", 1);
+ BUF_PARSE_TEST_S(32, "0b10", 2);
+ BUF_PARSE_TEST_S(32, "0b11", 3);
+ BUF_PARSE_TEST_S(32, "0b000", 0);
+ BUF_PARSE_TEST_S(32, "0b001", 1);
+ BUF_PARSE_TEST_S(32, "0b010", 2);
+ BUF_PARSE_TEST_S(32, "0b011", 3);
+ BUF_PARSE_TEST_S(32, "0b100", 4);
+ BUF_PARSE_TEST_S(32, "0b101", 5);
+ BUF_PARSE_TEST_S(32, "0b110", 6);
+ BUF_PARSE_TEST_S(32, "0b111", 7);
+ BUF_PARSE_TEST_S(32, "0b1111111", 127);
+ BUF_PARSE_TEST_S(32, "0b01111111", 127);
+ BUF_PARSE_TEST_S(32, "0b10000000", 128);
+ BUF_PARSE_TEST_S(32, "0b010000000", 128);
+ BUF_PARSE_TEST_S(32, "0b111111111111111", 32767);
+ BUF_PARSE_TEST_S(32, "0b0111111111111111", 32767);
+ BUF_PARSE_TEST_S(32, "0b1000000000000000", 32768);
+ BUF_PARSE_TEST_S(32, "0b01000000000000000", 32768);
+ BUF_PARSE_TEST_S(32, "0b1111111111111111111111111111111", 2147483647);
+ BUF_PARSE_TEST_S(32, "0b01111111111111111111111111111111", 2147483647);
+ BUF_PARSE_TEST_S(32, "0o0", 0);
+ BUF_PARSE_TEST_S(32, "0o1", 1);
+ BUF_PARSE_TEST_S(32, "0o2", 2);
+ BUF_PARSE_TEST_S(32, "0o3", 3);
+ BUF_PARSE_TEST_S(32, "0o4", 4);
+ BUF_PARSE_TEST_S(32, "0o5", 5);
+ BUF_PARSE_TEST_S(32, "0o6", 6);
+ BUF_PARSE_TEST_S(32, "0o7", 7);
+ BUF_PARSE_TEST_S(32, "0o00", 0);
+ BUF_PARSE_TEST_S(32, "0o01", 1);
+ BUF_PARSE_TEST_S(32, "0o10", 8);
+ BUF_PARSE_TEST_S(32, "0o11", 9);
+ BUF_PARSE_TEST_S(32, "0o000", 0);
+ BUF_PARSE_TEST_S(32, "0o177", 127);
+ BUF_PARSE_TEST_S(32, "0o0177", 127);
+ BUF_PARSE_TEST_S(32, "0o200", 128);
+ BUF_PARSE_TEST_S(32, "0o0200", 128);
+ BUF_PARSE_TEST_S(32, "0o77777", 32767);
+ BUF_PARSE_TEST_S(32, "0o077777", 32767);
+ BUF_PARSE_TEST_S(32, "0o100000", 32768);
+ BUF_PARSE_TEST_S(32, "0o0100000", 32768);
+ BUF_PARSE_TEST_S(32, "0o17777777777", 2147483647);
+ BUF_PARSE_TEST_S(32, "0o017777777777", 2147483647);
+ BUF_PARSE_TEST_S(32, "0x0", 0);
+ BUF_PARSE_TEST_S(32, "0x1", 1);
+ BUF_PARSE_TEST_S(32, "0x2", 2);
+ BUF_PARSE_TEST_S(32, "0x3", 3);
+ BUF_PARSE_TEST_S(32, "0x4", 4);
+ BUF_PARSE_TEST_S(32, "0x5", 5);
+ BUF_PARSE_TEST_S(32, "0x6", 6);
+ BUF_PARSE_TEST_S(32, "0x7", 7);
+ BUF_PARSE_TEST_S(32, "0x8", 8);
+ BUF_PARSE_TEST_S(32, "0x9", 9);
+ BUF_PARSE_TEST_S(32, "0xa", 10);
+ BUF_PARSE_TEST_S(32, "0xA", 10);
+ BUF_PARSE_TEST_S(32, "0xb", 11);
+ BUF_PARSE_TEST_S(32, "0xB", 11);
+ BUF_PARSE_TEST_S(32, "0xc", 12);
+ BUF_PARSE_TEST_S(32, "0xC", 12);
+ BUF_PARSE_TEST_S(32, "0xd", 13);
+ BUF_PARSE_TEST_S(32, "0xD", 13);
+ BUF_PARSE_TEST_S(32, "0xe", 14);
+ BUF_PARSE_TEST_S(32, "0xE", 14);
+ BUF_PARSE_TEST_S(32, "0xf", 15);
+ BUF_PARSE_TEST_S(32, "0xF", 15);
+ BUF_PARSE_TEST_S(32, "0x00", 0);
+ BUF_PARSE_TEST_S(32, "0x01", 1);
+ BUF_PARSE_TEST_S(32, "0x10", 16);
+ BUF_PARSE_TEST_S(32, "0x11", 17);
+ BUF_PARSE_TEST_S(32, "0x000", 0);
+ BUF_PARSE_TEST_S(32, "0x7f", 127);
+ BUF_PARSE_TEST_S(32, "0x7F", 127);
+ BUF_PARSE_TEST_S(32, "0x07f", 127);
+ BUF_PARSE_TEST_S(32, "0x07F", 127);
+ BUF_PARSE_TEST_S(32, "0x80", 128);
+ BUF_PARSE_TEST_S(32, "0x080", 128);
+ BUF_PARSE_TEST_S(32, "0xff", 255);
+ BUF_PARSE_TEST_S(32, "0xFF", 255);
+ BUF_PARSE_TEST_S(32, "0x0ff", 255);
+ BUF_PARSE_TEST_S(32, "0x0FF", 255);
+ BUF_PARSE_TEST_S(32, "0x100", 256);
+ BUF_PARSE_TEST_S(32, "0x0100", 256);
+ BUF_PARSE_TEST_S(32, "0x7fff", 32767);
+ BUF_PARSE_TEST_S(32, "0x7FFF", 32767);
+ BUF_PARSE_TEST_S(32, "0x07fff", 32767);
+ BUF_PARSE_TEST_S(32, "0x07FFF", 32767);
+ BUF_PARSE_TEST_S(32, "0x8000", 32768);
+ BUF_PARSE_TEST_S(32, "0x08000", 32768);
+ BUF_PARSE_TEST_S(32, "0x7fffffff", 2147483647);
+ BUF_PARSE_TEST_S(32, "0x7FFFFFFF", 2147483647);
+ BUF_PARSE_TEST_S(32, "0x07fffffff", 2147483647);
+ BUF_PARSE_TEST_S(32, "0x07FFFFFFF", 2147483647);
+ BUF_PARSE_TEST_S(32, "0", 0);
+ BUF_PARSE_TEST_S(32, "1", 1);
+ BUF_PARSE_TEST_S(32, "2", 2);
+ BUF_PARSE_TEST_S(32, "3", 3);
+ BUF_PARSE_TEST_S(32, "4", 4);
+ BUF_PARSE_TEST_S(32, "5", 5);
+ BUF_PARSE_TEST_S(32, "6", 6);
+ BUF_PARSE_TEST_S(32, "7", 7);
+ BUF_PARSE_TEST_S(32, "8", 8);
+ BUF_PARSE_TEST_S(32, "9", 9);
+ BUF_PARSE_TEST_S(32, "00", 0);
+ BUF_PARSE_TEST_S(32, "10", 10);
+ BUF_PARSE_TEST_S(32, "11", 11);
+ BUF_PARSE_TEST_S(32, "12", 12);
+ BUF_PARSE_TEST_S(32, "20", 20);
+ BUF_PARSE_TEST_S(32, "21", 21);
+ BUF_PARSE_TEST_S(32, "22", 22);
+ BUF_PARSE_TEST_S(32, "000", 0);
+ BUF_PARSE_TEST_S(32, "010", 10);
+ BUF_PARSE_TEST_S(32, "011", 11);
+ BUF_PARSE_TEST_S(32, "012", 12);
+ BUF_PARSE_TEST_S(32, "020", 20);
+ BUF_PARSE_TEST_S(32, "021", 21);
+ BUF_PARSE_TEST_S(32, "022", 22);
+ BUF_PARSE_TEST_S(32, "127", 127);
+ BUF_PARSE_TEST_S(32, "0127", 127);
+ BUF_PARSE_TEST_S(32, "128", 128);
+ BUF_PARSE_TEST_S(32, "0128", 128);
+ BUF_PARSE_TEST_S(32, "32767", 32767);
+ BUF_PARSE_TEST_S(32, "032767", 32767);
+ BUF_PARSE_TEST_S(32, "32768", 32768);
+ BUF_PARSE_TEST_S(32, "032768", 32768);
+ BUF_PARSE_TEST_S(32, "2147483647", 2147483647);
+ BUF_PARSE_TEST_S(32, "2147483647", 2147483647);
+}
+
+void buf_parse_test_s64 ()
+{
+}
+
+void buf_parse_test_sw ()
+{
+}
+
+
void buf_parse_test_str ()
{
BUF_PARSE_TEST_NOT_STR("");
@@ -1683,3 +2222,19 @@ void buf_parse_test_u8 ()
BUF_PARSE_TEST_U(8, "127", 127);
BUF_PARSE_TEST_U(8, "0127", 127);
}
+
+void buf_parse_test_u16 ()
+{
+}
+
+void buf_parse_test_u32 ()
+{
+}
+
+void buf_parse_test_u64 ()
+{
+}
+
+void buf_parse_test_uw ()
+{
+}