*
*/
+#include <btron/btron.h>
#include <bstdio.h>
#include <tcode.h>
+#include <tstring.h>
#include "test.h"
LOCAL TC test_tadsearch_testdata03[] = {TK_E, TK_F, TK_G, TK_E, TNULL};
LOCAL TC test_tadsearch_testdata04[] = {TK_a, TK_b, TK_c, TK_d, TK_e, TNULL};
LOCAL TC test_tadsearch_testdata05[] = {TK_a, TK_b, TK_A, TK_B, TK_C, TNULL};
+LOCAL TC test_tadsearch_testdata06[] = {TK_a, TK_b, TNULL};
+LOCAL TC test_tadsearch_testdata07[] = {TK_b, TK_a, TNULL};
+LOCAL UB test_tadsearch_testdata08[] = {
+ 0xe0, 0xff, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x22, 0x01, 0xe1, 0xff, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff,
+ 0x88, 0xff, 0x21, 0x00, 0x00, 0x00, 0xa0, 0xff,
+ 0x0e, 0x00, 0x00, 0x00, 0x7b, 0x05, 0xe0, 0x03,
+ 0x5e, 0x00, 0x46, 0x00, 0x6c, 0x00, 0x55, 0x00,
+ 0xa0, 0xff, 0x0a, 0x00, 0x00, 0x01, 0x5e, 0x00,
+ 0x76, 0x00, 0x6c, 0x00, 0x55, 0x00, 0xa0, 0xff,
+ 0x22, 0x00, 0x00, 0x03, 0xa0, 0xff, 0x02, 0x00,
+ 0x00, 0x08, 0xa1, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xa1, 0xff, 0x02, 0x00, 0x01, 0x01,
+ 0x5d, 0x21, 0xad, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0xc8, 0x00, 0x5d, 0x21, 0xa0, 0xff, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0xa4, 0xff, 0x24, 0x00,
+ 0x11, 0x08, 0x22, 0x21, 0x23, 0x21, 0x24, 0x21,
+ 0x25, 0x21, 0x2b, 0x21, 0x2c, 0x21, 0x47, 0x21,
+ 0x49, 0x21, 0x4b, 0x21, 0x4d, 0x21, 0x4f, 0x21,
+ 0x51, 0x21, 0x53, 0x21, 0x55, 0x21, 0x57, 0x21,
+ 0x59, 0x21, 0x5b, 0x21, 0xa4, 0xff, 0x18, 0x00,
+ 0x11, 0x09, 0x46, 0x21, 0x48, 0x21, 0x4a, 0x21,
+ 0x4c, 0x21, 0x4e, 0x21, 0x50, 0x21, 0x52, 0x21,
+ 0x54, 0x21, 0x56, 0x21, 0x58, 0x21, 0x5a, 0x21,
+ 0xa1, 0xff, 0x24, 0x00, 0x00, 0x02, 0x04, 0x01,
+ 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0b, 0x00, 0x48, 0x00, 0x90, 0x00, 0xd8, 0x00,
+ 0x20, 0x01, 0x68, 0x01, 0xb0, 0x01, 0xf8, 0x01,
+ 0x40, 0x02, 0x88, 0x02, 0xd0, 0x02, 0x18, 0x03,
+ 0xa2, 0xff, 0x04, 0x00, 0x00, 0x01, 0x00, 0x80,
+ 0xa1, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01,
+ 0xa2, 0xff, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0xa2, 0xff, 0x04, 0x00, 0x01, 0x04, 0x00, 0x80,
+ 0x72, 0x3a, 0x7c, 0x46, 0x22, 0x21, 0x61, 0x36,
+ 0x6a, 0x3d, 0x4e, 0x24, 0x48, 0x35, 0x6e, 0x4c,
+ 0x48, 0x32, 0x54, 0x39, 0x43, 0x24, 0x3f, 0x24,
+ 0x73, 0x24, 0x47, 0x24, 0x39, 0x24, 0x23, 0x21,
+ 0x48, 0x35, 0x6e, 0x4c, 0x48, 0x32, 0x23, 0x21,
+ 0x0a, 0x00, 0x3d, 0x24, 0x37, 0x24, 0x3f, 0x24,
+ 0x69, 0x24, 0x4a, 0x24, 0x73, 0x24, 0x2b, 0x24,
+ 0x4d, 0x3f, 0x2c, 0x24, 0x61, 0x24, 0x41, 0x24,
+ 0x63, 0x24, 0x2f, 0x24, 0x41, 0x24, 0x63, 0x24,
+ 0x24, 0x24, 0x43, 0x24, 0x51, 0x24, 0x24, 0x24,
+ 0x47, 0x24, 0x42, 0x3a, 0x6c, 0x24, 0x4a, 0x24,
+ 0x24, 0x24, 0x73, 0x24, 0x47, 0x24, 0x39, 0x24,
+ 0x23, 0x21, 0x0a, 0x00, 0x47, 0x24, 0x22, 0x21,
+ 0x68, 0x24, 0x2f, 0x24, 0x2b, 0x38, 0x3f, 0x24,
+ 0x69, 0x24, 0x4a, 0x24, 0x73, 0x24, 0x2b, 0x24,
+ 0x62, 0x3f, 0x6c, 0x24, 0x6b, 0x4b, 0x3c, 0x32,
+ 0x2c, 0x24, 0x43, 0x24, 0x46, 0x24, 0x46, 0x24,
+ 0x22, 0x21, 0x31, 0x23, 0x35, 0x23, 0x30, 0x23,
+ 0x5f, 0x31, 0x7a, 0x30, 0x2d, 0x24, 0x22, 0x21,
+ 0x48, 0x24, 0x2b, 0x24, 0x71, 0x3d, 0x24, 0x24,
+ 0x46, 0x24, 0x22, 0x24, 0x6b, 0x24, 0x73, 0x24,
+ 0x47, 0x24, 0x39, 0x24, 0x23, 0x21, 0x0a, 0x00,
+ 0x62, 0x24, 0x26, 0x24, 0x4d, 0x24, 0x22, 0x21,
+ 0x22, 0x25, 0x5b, 0x25, 0x2b, 0x24, 0x48, 0x24,
+ 0x23, 0x21, 0x4f, 0x47, 0x2f, 0x3c, 0x2b, 0x24,
+ 0x48, 0x24, 0x23, 0x21, 0x0a, 0x00, 0x2a, 0x24,
+ 0x30, 0x41, 0x69, 0x24, 0x4a, 0x24, 0x22, 0x21,
+ 0x31, 0x23, 0x35, 0x23, 0x30, 0x23, 0x5f, 0x31,
+ 0x7a, 0x30, 0x2d, 0x24, 0x21, 0x47, 0x2d, 0x24,
+ 0x47, 0x24, 0x61, 0x49, 0x4a, 0x43, 0x68, 0x4d,
+ 0x46, 0x24, 0x4a, 0x24, 0x24, 0x24, 0x48, 0x35,
+ 0x6e, 0x4c, 0x48, 0x32, 0x4b, 0x24, 0x68, 0x4d,
+ 0x46, 0x24, 0x73, 0x24, 0x38, 0x24, 0x63, 0x24,
+ 0x4d, 0x24, 0x3c, 0x21, 0x68, 0x24, 0x22, 0x21,
+ 0x5c, 0x25, 0x31, 0x25, 0x2c, 0x24, 0x23, 0x21,
+ 0x0a, 0x00, 0x31, 0x23, 0x35, 0x23, 0x30, 0x23,
+ 0x5f, 0x31, 0x40, 0x24, 0x68, 0x24, 0x22, 0x21,
+ 0x31, 0x23, 0x35, 0x23, 0x30, 0x23, 0x5f, 0x31,
+ 0x23, 0x21, 0x0a, 0x00, 0x4a, 0x24, 0x73, 0x24,
+ 0x2b, 0x24, 0x46, 0x3f, 0x52, 0x3b, 0x22, 0x4f,
+ 0x6c, 0x24, 0x48, 0x24, 0x2b, 0x24, 0x62, 0x24,
+ 0x24, 0x24, 0x6b, 0x24, 0x37, 0x24, 0x23, 0x21,
+ 0x6c, 0x30, 0x48, 0x32, 0x34, 0x23, 0x4d, 0x3f,
+ 0x47, 0x24, 0x48, 0x35, 0x6e, 0x4c, 0x48, 0x32,
+ 0x2b, 0x24, 0x23, 0x21, 0x2a, 0x24, 0x61, 0x24,
+ 0x47, 0x24, 0x46, 0x24, 0x3c, 0x21, 0x4a, 0x24,
+ 0x23, 0x21, 0x0a, 0x00, 0x68, 0x24, 0x3c, 0x21,
+ 0x37, 0x24, 0x51, 0x25, 0x51, 0x25, 0x43, 0x46,
+ 0x39, 0x40, 0x6a, 0x4d, 0x73, 0x24, 0x38, 0x24,
+ 0x63, 0x24, 0x26, 0x24, 0x3e, 0x24, 0x3c, 0x21,
+ 0x22, 0x21, 0x48, 0x24, 0x2b, 0x24, 0x40, 0x38,
+ 0x43, 0x24, 0x46, 0x24, 0x6b, 0x24, 0x4e, 0x24,
+ 0x23, 0x21, 0x62, 0x24, 0x26, 0x24, 0x2b, 0x38,
+ 0x46, 0x24, 0x69, 0x24, 0x73, 0x24, 0x4a, 0x24,
+ 0x24, 0x24, 0x23, 0x21, 0x0a, 0x00, 0x2a, 0x24,
+ 0x30, 0x41, 0x69, 0x24, 0x4a, 0x24, 0x22, 0x21,
+ 0x31, 0x23, 0x35, 0x23, 0x30, 0x23, 0x5f, 0x31,
+ 0x64, 0x24, 0x6b, 0x24, 0x2b, 0x24, 0x69, 0x24,
+ 0x3d, 0x24, 0x4e, 0x24, 0x4a, 0x40, 0x75, 0x36,
+ 0x31, 0x24, 0x6d, 0x24, 0x48, 0x24, 0x23, 0x21,
+ 0x0a, 0x00, 0x48, 0x35, 0x6e, 0x4c, 0x48, 0x32,
+ 0x43, 0x24, 0x46, 0x24, 0x4e, 0x24, 0x4f, 0x24,
+ 0x4a, 0x24, 0x22, 0x21, 0x62, 0x24, 0x43, 0x24,
+ 0x48, 0x24, 0x26, 0x3b, 0x32, 0x48, 0x48, 0x24,
+ 0x37, 0x24, 0x46, 0x24, 0x6b, 0x24, 0x59, 0x24,
+ 0x2d, 0x24, 0x4a, 0x24, 0x73, 0x24, 0x40, 0x24,
+ 0x68, 0x24, 0x23, 0x21, 0x0a, 0x00, 0x55, 0x23,
+ 0x4e, 0x24, 0x7a, 0x3b, 0x46, 0x25, 0x3c, 0x21,
+ 0x56, 0x25, 0x6b, 0x25, 0x4e, 0x24, 0x7e, 0x38,
+ 0x2b, 0x24, 0x24, 0x24, 0x4b, 0x24, 0x42, 0x3a,
+ 0x43, 0x24, 0x3f, 0x24, 0x5b, 0x45, 0x48, 0x24,
+ 0x24, 0x24, 0x44, 0x24, 0x76, 0x37, 0x5e, 0x32,
+ 0x2c, 0x24, 0x4f, 0x3b, 0x5e, 0x24, 0x43, 0x24,
+ 0x46, 0x24, 0x62, 0x24, 0x2a, 0x24, 0x2b, 0x24,
+ 0x37, 0x24, 0x2f, 0x24, 0x4a, 0x24, 0x24, 0x24,
+ 0x22, 0x21, 0x0a, 0x00, 0x49, 0x3b, 0x39, 0x24,
+ 0x2b, 0x24, 0x49, 0x3b, 0x35, 0x24, 0x6c, 0x24,
+ 0x6b, 0x24, 0x2b, 0x24, 0x22, 0x21, 0x3d, 0x24,
+ 0x73, 0x24, 0x4a, 0x24, 0x37, 0x4a, 0x4f, 0x30,
+ 0x24, 0x35, 0x2c, 0x24, 0x24, 0x24, 0x24, 0x24,
+ 0x73, 0x24, 0x38, 0x24, 0x63, 0x24, 0x4d, 0x24,
+ 0x3c, 0x21, 0x2b, 0x24, 0x23, 0x21, 0x77, 0x3d,
+ 0x52, 0x3b, 0x21, 0x36, 0x4f, 0x24, 0x22, 0x21,
+ 0x39, 0x24, 0x43, 0x24, 0x33, 0x24, 0x73, 0x24,
+ 0x47, 0x24, 0x6d, 0x24, 0x23, 0x21, 0x0a, 0x00,
+ 0x47, 0x24, 0x22, 0x21, 0x64, 0x24, 0x43, 0x24,
+ 0x48, 0x24, 0x42, 0x3a, 0x6c, 0x24, 0x3f, 0x24,
+ 0x2b, 0x24, 0x48, 0x24, 0x57, 0x3b, 0x43, 0x24,
+ 0x3f, 0x24, 0x69, 0x24, 0x22, 0x21, 0x59, 0x4e,
+ 0x4e, 0x24, 0x5b, 0x45, 0x2c, 0x24, 0x22, 0x21,
+ 0x67, 0x42, 0x39, 0x40, 0x44, 0x24, 0x66, 0x24,
+ 0x40, 0x24, 0x2f, 0x24, 0x47, 0x24, 0x22, 0x21,
+ 0x48, 0x24, 0x2b, 0x24, 0x40, 0x38, 0x43, 0x24,
+ 0x46, 0x24, 0x6b, 0x24, 0x73, 0x24, 0x47, 0x24,
+ 0x39, 0x24, 0x23, 0x21, 0x0a, 0x00, 0x3d, 0x24,
+ 0x33, 0x24, 0x47, 0x24, 0x5e, 0x24, 0x3f, 0x24,
+ 0x56, 0x24, 0x41, 0x24, 0x5a, 0x40, 0x6c, 0x24,
+ 0x47, 0x24, 0x39, 0x24, 0x68, 0x24, 0x23, 0x21,
+ 0x0a, 0x00, 0x22, 0x24, 0x4e, 0x24, 0x4a, 0x24,
+ 0x22, 0x21, 0x44, 0x24, 0x66, 0x24, 0x40, 0x24,
+ 0x2f, 0x24, 0x4a, 0x24, 0x73, 0x24, 0x46, 0x24,
+ 0x2d, 0x24, 0x67, 0x24, 0x26, 0x24, 0x53, 0x24,
+ 0x2e, 0x4e, 0x54, 0x39, 0x73, 0x24, 0x4d, 0x24,
+ 0x3c, 0x21, 0x73, 0x24, 0x40, 0x24, 0x68, 0x24,
+ 0x23, 0x21, 0x5c, 0x25, 0x31, 0x25, 0x2c, 0x24,
+ 0x23, 0x21, 0x0a, 0x00, 0x40, 0x46, 0x55, 0x30,
+ 0x32, 0x24, 0x4a, 0x24, 0x69, 0x34, 0x37, 0x24,
+ 0x46, 0x24, 0x3f, 0x32, 0x2c, 0x24, 0x22, 0x21,
+ 0x44, 0x24, 0x66, 0x24, 0x40, 0x24, 0x2f, 0x24,
+ 0x47, 0x24, 0x22, 0x21, 0x40, 0x24, 0x23, 0x21,
+ 0x0a, 0x00, 0x2a, 0x24, 0x30, 0x41, 0x4f, 0x24,
+ 0x5c, 0x4b, 0x76, 0x45, 0x4b, 0x24, 0x44, 0x24,
+ 0x66, 0x24, 0x40, 0x24, 0x2f, 0x24, 0x72, 0x24,
+ 0x29, 0x3f, 0x24, 0x24, 0x3f, 0x24, 0x24, 0x24,
+ 0x4e, 0x24, 0x2b, 0x24, 0x48, 0x24, 0x64, 0x4c,
+ 0x24, 0x24, 0x3f, 0x24, 0x24, 0x24, 0x23, 0x21,
+ 0x64, 0x4c, 0x24, 0x24, 0x4d, 0x35, 0x61, 0x24,
+ 0x3f, 0x24, 0x24, 0x24, 0x23, 0x21, 0x2e, 0x3e,
+ 0x31, 0x23, 0x7e, 0x3b, 0x56, 0x34, 0x64, 0x4c,
+ 0x24, 0x24, 0x4d, 0x35, 0x61, 0x24, 0x3f, 0x24,
+ 0x24, 0x24, 0x23, 0x21, 0x0a, 0x00, 0x2a, 0x24,
+ 0x30, 0x41, 0x22, 0x21, 0x44, 0x24, 0x66, 0x24,
+ 0x40, 0x24, 0x2f, 0x24, 0x43, 0x24, 0x46, 0x24,
+ 0x40, 0x38, 0x24, 0x24, 0x3f, 0x24, 0x24, 0x24,
+ 0x40, 0x24, 0x31, 0x24, 0x41, 0x24, 0x63, 0x24,
+ 0x26, 0x24, 0x73, 0x24, 0x2b, 0x24, 0x48, 0x24,
+ 0x23, 0x21, 0x0a, 0x00, 0x48, 0x35, 0x6e, 0x4c,
+ 0x48, 0x32, 0x4c, 0x44, 0x4e, 0x24, 0x36, 0x32,
+ 0x2b, 0x24, 0x69, 0x24, 0x40, 0x38, 0x6f, 0x24,
+ 0x3b, 0x24, 0x46, 0x24, 0x62, 0x24, 0x69, 0x24,
+ 0x28, 0x24, 0x50, 0x24, 0x23, 0x3a, 0x22, 0x21,
+ 0x48, 0x35, 0x6e, 0x4c, 0x48, 0x32, 0x4c, 0x44,
+ 0x4e, 0x24, 0x56, 0x34, 0x47, 0x24, 0x4e, 0x24,
+ 0x47, 0x3a, 0x37, 0x3f, 0x2e, 0x4e, 0x54, 0x39,
+ 0x4f, 0x24, 0x64, 0x24, 0x43, 0x24, 0x51, 0x24,
+ 0x6a, 0x24, 0x22, 0x21, 0x0a, 0x00, 0x4d, 0x24,
+ 0x2e, 0x24, 0x40, 0x24, 0x2f, 0x24, 0x22, 0x21,
+ 0x33, 0x24, 0x6c, 0x24, 0x40, 0x24, 0x4d, 0x24,
+ 0x23, 0x21, 0x0a, 0x00, 0x67, 0x42, 0x39, 0x40,
+ 0x6a, 0x24, 0x4d, 0x24, 0x2e, 0x24, 0x40, 0x24,
+ 0x2f, 0x24, 0x2e, 0x25, 0x67, 0x25, 0x2f, 0x25,
+ 0x23, 0x21, 0x33, 0x24, 0x6c, 0x24, 0x2c, 0x24,
+ 0x4c, 0x44, 0x4e, 0x24, 0x6a, 0x4d, 0x5f, 0x24,
+ 0x7d, 0x4a, 0x23, 0x21, 0x0a, 0x00, 0x4d, 0x24,
+ 0x2e, 0x24, 0x40, 0x24, 0x2f, 0x24, 0x43, 0x24,
+ 0x46, 0x24, 0x4e, 0x24, 0x4f, 0x24, 0x4d, 0x24,
+ 0x2e, 0x24, 0x2c, 0x24, 0x3f, 0x42, 0x61, 0x24,
+ 0x4b, 0x24, 0x7e, 0x46, 0x43, 0x24, 0x46, 0x24,
+ 0x6b, 0x24, 0x23, 0x21, 0x3d, 0x24, 0x73, 0x24,
+ 0x65, 0x42, 0x6f, 0x24, 0x6a, 0x24, 0x79, 0x46,
+ 0x2c, 0x24, 0x2f, 0x3e, 0x4a, 0x24, 0x61, 0x24,
+ 0x23, 0x21, 0x33, 0x24, 0x6c, 0x24, 0x23, 0x21,
+ 0x0a, 0x00, 0x47, 0x24, 0x22, 0x21, 0x3d, 0x24,
+ 0x6c, 0x24, 0x4b, 0x24, 0x67, 0x42, 0x39, 0x40,
+ 0x6a, 0x24, 0x2e, 0x25, 0x67, 0x25, 0x2f, 0x25,
+ 0x4a, 0x21, 0x4c, 0x36, 0x52, 0x3b, 0x4b, 0x21,
+ 0x23, 0x21, 0x33, 0x24, 0x6c, 0x24, 0x47, 0x3a,
+ 0x2f, 0x36, 0x23, 0x21, 0x0a, 0x00, 0x37, 0x24,
+ 0x2b, 0x24, 0x37, 0x24, 0x33, 0x24, 0x6c, 0x24,
+ 0x72, 0x24, 0x6a, 0x4d, 0x60, 0x24, 0x48, 0x24,
+ 0x21, 0x3c, 0x2b, 0x24, 0x69, 0x24, 0x39, 0x45,
+ 0x77, 0x30, 0x4b, 0x24, 0x5e, 0x25, 0x3c, 0x21,
+ 0x2f, 0x25, 0x35, 0x24, 0x6c, 0x24, 0x6b, 0x24,
+ 0x48, 0x24, 0x24, 0x24, 0x26, 0x24, 0x6d, 0x34,
+ 0x31, 0x38, 0x62, 0x24, 0x3c, 0x48, 0x26, 0x24,
+ 0x22, 0x21, 0x74, 0x3d, 0x4f, 0x3f, 0x4e, 0x24,
+ 0x75, 0x37, 0x23, 0x21, 0x0a, 0x00, 0x47, 0x41,
+ 0x4d, 0x3f, 0x4b, 0x24, 0x4f, 0x24, 0x2a, 0x24,
+ 0x26, 0x41, 0x61, 0x24, 0x50, 0x3d, 0x68, 0x4d,
+ 0x4a, 0x24, 0x24, 0x24, 0x23, 0x21, 0x0a, 0x00,
+ 0x5e, 0x24, 0x22, 0x24, 0x2a, 0x24, 0x30, 0x41,
+ 0x69, 0x24, 0x49, 0x25, 0x47, 0x41, 0x4d, 0x3f,
+ 0x4f, 0x24, 0x22, 0x21, 0x6d, 0x35, 0x7a, 0x3a,
+ 0x6a, 0x44, 0x29, 0x3f, 0x47, 0x24, 0x62, 0x24,
+ 0x29, 0x3f, 0x43, 0x24, 0x46, 0x24, 0x4a, 0x24,
+ 0x35, 0x24, 0x24, 0x24, 0x43, 0x24, 0x46, 0x24,
+ 0x33, 0x24, 0x43, 0x24, 0x3f, 0x24, 0x23, 0x21,
+ 0xe2, 0xff, 0x00, 0x00,
+};
+LOCAL UB test_tadsearch_testdata09[] = {
+ 0xe0, 0xff, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x22, 0x01, 0xe1, 0xff, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff,
+ 0x88, 0xff, 0x21, 0x00, 0x00, 0x00, 0xa0, 0xff,
+ 0x0e, 0x00, 0x00, 0x00, 0x7b, 0x05, 0xe0, 0x03,
+ 0x5e, 0x00, 0x46, 0x00, 0x6c, 0x00, 0x55, 0x00,
+ 0xa0, 0xff, 0x0a, 0x00, 0x00, 0x01, 0x5e, 0x00,
+ 0x76, 0x00, 0x6c, 0x00, 0x55, 0x00, 0xa0, 0xff,
+ 0x22, 0x00, 0x00, 0x03, 0xa0, 0xff, 0x02, 0x00,
+ 0x00, 0x08, 0xa1, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xa1, 0xff, 0x02, 0x00, 0x01, 0x01,
+ 0x5d, 0x21, 0xad, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0xc8, 0x00, 0x5d, 0x21, 0xa0, 0xff, 0x04, 0x00,
+ 0x00, 0x04, 0x00, 0x80, 0xa4, 0xff, 0x24, 0x00,
+ 0x11, 0x08, 0x22, 0x21, 0x23, 0x21, 0x24, 0x21,
+ 0x25, 0x21, 0x2b, 0x21, 0x2c, 0x21, 0x47, 0x21,
+ 0x49, 0x21, 0x4b, 0x21, 0x4d, 0x21, 0x4f, 0x21,
+ 0x51, 0x21, 0x53, 0x21, 0x55, 0x21, 0x57, 0x21,
+ 0x59, 0x21, 0x5b, 0x21, 0xa4, 0xff, 0x18, 0x00,
+ 0x11, 0x09, 0x46, 0x21, 0x48, 0x21, 0x4a, 0x21,
+ 0x4c, 0x21, 0x4e, 0x21, 0x50, 0x21, 0x52, 0x21,
+ 0x54, 0x21, 0x56, 0x21, 0x58, 0x21, 0x5a, 0x21,
+ 0xa1, 0xff, 0x24, 0x00, 0x00, 0x02, 0x04, 0x01,
+ 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0b, 0x00, 0x48, 0x00, 0x90, 0x00, 0xd8, 0x00,
+ 0x20, 0x01, 0x68, 0x01, 0xb0, 0x01, 0xf8, 0x01,
+ 0x40, 0x02, 0x88, 0x02, 0xd0, 0x02, 0x18, 0x03,
+ 0xa1, 0xff, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01,
+ 0xa2, 0xff, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0xa2, 0xff, 0x04, 0x00, 0x01, 0x04, 0x00, 0x80,
+ 0x62, 0x24, 0x26, 0x24, 0x7e, 0x3b, 0x7a, 0x38,
+ 0x40, 0x24, 0x2b, 0x24, 0x69, 0x24, 0x24, 0x24,
+ 0x28, 0x24, 0x6b, 0x24, 0x31, 0x24, 0x49, 0x24,
+ 0x22, 0x21, 0x0a, 0x00, 0x22, 0x24, 0x6b, 0x24,
+ 0x32, 0x25, 0x3c, 0x21, 0x60, 0x25, 0x3d, 0x25,
+ 0x55, 0x25, 0x48, 0x25, 0x4e, 0x24, 0x47, 0x25,
+ 0x50, 0x25, 0x43, 0x25, 0x30, 0x25, 0x72, 0x24,
+ 0x37, 0x24, 0x46, 0x24, 0x24, 0x24, 0x3f, 0x24,
+ 0x7e, 0x3b, 0x4e, 0x24, 0x76, 0x3b, 0x23, 0x21,
+ 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x47, 0x3a,
+ 0x69, 0x3d, 0x4e, 0x24, 0x22, 0x3a, 0x4f, 0x24,
+ 0x61, 0x49, 0x4c, 0x44, 0x4b, 0x24, 0x56, 0x21,
+ 0x48, 0x24, 0x5e, 0x24, 0x43, 0x24, 0x3f, 0x24,
+ 0x6a, 0x24, 0x68, 0x32, 0x4c, 0x4c, 0x2c, 0x24,
+ 0x2a, 0x24, 0x2b, 0x24, 0x37, 0x24, 0x2f, 0x24,
+ 0x4a, 0x24, 0x6b, 0x24, 0x4e, 0x24, 0x4f, 0x24,
+ 0x34, 0x41, 0x74, 0x49, 0x50, 0x25, 0x30, 0x25,
+ 0x57, 0x21, 0x0a, 0x00, 0x40, 0x24, 0x43, 0x24,
+ 0x3f, 0x24, 0x73, 0x24, 0x40, 0x24, 0x31, 0x24,
+ 0x49, 0x24, 0x22, 0x21, 0x0a, 0x00, 0x79, 0x44,
+ 0x61, 0x24, 0x5a, 0x40, 0x6a, 0x24, 0x2e, 0x25,
+ 0x6a, 0x25, 0x2e, 0x25, 0x6a, 0x25, 0x4b, 0x24,
+ 0x4a, 0x24, 0x43, 0x24, 0x46, 0x24, 0x2d, 0x24,
+ 0x3f, 0x24, 0x69, 0x24, 0x0a, 0x00, 0x56, 0x21,
+ 0x68, 0x32, 0x4c, 0x4c, 0x64, 0x24, 0x3b, 0x32,
+ 0x2c, 0x24, 0x2a, 0x24, 0x2b, 0x24, 0x37, 0x24,
+ 0x24, 0x24, 0x4e, 0x24, 0x4f, 0x24, 0x45, 0x3b,
+ 0x4d, 0x4d, 0x22, 0x21, 0x48, 0x24, 0x5e, 0x24,
+ 0x6b, 0x24, 0x4e, 0x24, 0x4f, 0x24, 0x50, 0x25,
+ 0x30, 0x25, 0x57, 0x21, 0x0a, 0x00, 0x4b, 0x24,
+ 0x4a, 0x24, 0x6a, 0x24, 0x22, 0x21, 0x0a, 0x00,
+ 0x79, 0x44, 0x61, 0x24, 0x5a, 0x40, 0x6a, 0x24,
+ 0x2c, 0x24, 0x61, 0x32, 0x2e, 0x24, 0x46, 0x24,
+ 0x37, 0x24, 0x5e, 0x24, 0x43, 0x24, 0x3f, 0x24,
+ 0x69, 0x24, 0x0a, 0x00, 0x56, 0x21, 0x5f, 0x3b,
+ 0x5e, 0x24, 0x6b, 0x24, 0x5e, 0x24, 0x47, 0x24,
+ 0x60, 0x41, 0x6e, 0x3a, 0x2b, 0x33, 0x4f, 0x3b,
+ 0x2b, 0x24, 0x69, 0x24, 0xa2, 0xff, 0x06, 0x00,
+ 0x00, 0x03, 0x00, 0x00, 0x02, 0x01, 0x32, 0x23,
+ 0x30, 0x23, 0xa2, 0xff, 0x06, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x01, 0x01, 0x60, 0x41, 0x6e, 0x3a,
+ 0x4a, 0x30, 0x65, 0x3e, 0x2c, 0x49, 0x57, 0x4d,
+ 0x4a, 0x24, 0x62, 0x24, 0x4e, 0x24, 0x4f, 0x24,
+ 0x45, 0x3b, 0x4d, 0x4d, 0x57, 0x21, 0x0a, 0x00,
+ 0x2f, 0x48, 0x64, 0x47, 0x7c, 0x46, 0x62, 0x24,
+ 0x64, 0x31, 0x7c, 0x34, 0x4b, 0x24, 0x4a, 0x24,
+ 0x43, 0x24, 0x3f, 0x24, 0x22, 0x3a, 0x4b, 0x24,
+ 0x4f, 0x24, 0x0a, 0x00, 0x56, 0x21, 0x5f, 0x3b,
+ 0x5e, 0x24, 0x6b, 0x24, 0x5e, 0x24, 0x47, 0x24,
+ 0x22, 0x21, 0x45, 0x45, 0x3b, 0x38, 0x6a, 0x45,
+ 0x7e, 0x46, 0x65, 0x38, 0xa2, 0xff, 0x06, 0x00,
+ 0x00, 0x03, 0x00, 0x00, 0x02, 0x01, 0x32, 0x23,
+ 0x30, 0x23, 0xa2, 0xff, 0x06, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x01, 0x01, 0x60, 0x41, 0x6e, 0x3a,
+ 0x4a, 0x30, 0x65, 0x3e, 0x2c, 0x49, 0x57, 0x4d,
+ 0x4a, 0x24, 0x62, 0x24, 0x4e, 0x24, 0x4f, 0x24,
+ 0x45, 0x3b, 0x4d, 0x4d, 0x57, 0x21, 0x0a, 0x00,
+ 0x4b, 0x24, 0x4a, 0x24, 0x43, 0x24, 0x3f, 0x24,
+ 0x23, 0x21, 0x0a, 0x00, 0x0a, 0x00, 0x22, 0x24,
+ 0x73, 0x24, 0x5e, 0x24, 0x6a, 0x24, 0x64, 0x47,
+ 0x6c, 0x24, 0x4a, 0x24, 0x2b, 0x24, 0x43, 0x24,
+ 0x3f, 0x24, 0x4e, 0x24, 0x47, 0x24, 0x64, 0x4c,
+ 0x6a, 0x42, 0x4b, 0x24, 0x4b, 0x24, 0x4f, 0x24,
+ 0x4a, 0x24, 0x6a, 0x24, 0x5e, 0x24, 0x3b, 0x24,
+ 0x73, 0x24, 0x47, 0x24, 0x37, 0x24, 0x3f, 0x24,
+ 0x2c, 0x24, 0x44, 0x21, 0xe2, 0xff, 0x00, 0x00,
+};
+LOCAL TC test_tadsearch_testdata10[] = {0x2331, 0x3B7E, 0x3456, TNULL};
+LOCAL TC test_tadsearch_testdata11[] = {0x4479, 0x2461, 0x405A, 0x246A, TNULL};
LOCAL TEST_RESULT test_tadsearch_1()
{
return TEST_RESULT_PASS;
}
+LOCAL TEST_RESULT test_tadsearch_4()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err;
+
+ set[0].buffer = test_tadsearch_testdata02;
+ set[0].strlen = 3;
+ set[1].buffer = test_tadsearch_testdata01;
+ set[1].strlen = 3;
+ set[2].buffer = test_tadsearch_testdata03;
+ set[2].strlen = 4;
+
+ err = tadlib_rabinkarpsearch(test_tadsearch_testdata05, 5, set, 3, &result);
+ if (err != 1) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+ if (result.i != 1) {
+ printf("result failure: %d\n", result.i);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_tadsearch_5()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err;
+
+ set[0].buffer = test_tadsearch_testdata02;
+ set[0].strlen = 3;
+ set[1].buffer = test_tadsearch_testdata03;
+ set[1].strlen = 4;
+ set[2].buffer = test_tadsearch_testdata01;
+ set[2].strlen = 3;
+
+ err = tadlib_rabinkarpsearch(test_tadsearch_testdata05, 5, set, 3, &result);
+ if (err != 1) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+ if (result.i != 2) {
+ printf("result failure: %d\n", result.i);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_tadsearch_6()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err;
+
+ set[0].buffer = test_tadsearch_testdata06;
+ set[0].strlen = 2;
+ set[1].buffer = test_tadsearch_testdata02;
+ set[1].strlen = 3;
+ set[2].buffer = test_tadsearch_testdata03;
+ set[2].strlen = 4;
+
+ err = tadlib_rabinkarpsearch(test_tadsearch_testdata05, 5, set, 3, &result);
+ if (err != 1) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+ if (result.i != 0) {
+ printf("result failure: %d\n", result.i);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_tadsearch_7()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err;
+
+ set[0].buffer = test_tadsearch_testdata07;
+ set[0].strlen = 2;
+ set[1].buffer = test_tadsearch_testdata02;
+ set[1].strlen = 3;
+ set[2].buffer = test_tadsearch_testdata03;
+ set[2].strlen = 4;
+
+ err = tadlib_rabinkarpsearch(test_tadsearch_testdata05, 5, set, 3, &result);
+ if (err != 0) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_tadsearch_8()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err, len;
+
+ set[0].buffer = test_tadsearch_testdata01;
+ set[0].strlen = 3;
+ set[1].buffer = test_tadsearch_testdata02;
+ set[1].strlen = 3;
+ set[2].buffer = test_tadsearch_testdata03;
+ set[2].strlen = 4;
+
+ len = tc_strlen((TC*)test_tadsearch_testdata08);
+ err = tadlib_rabinkarpsearch((TC*)test_tadsearch_testdata08, len, set, 3, &result);
+ if (err != 0) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_tadsearch_9()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err, len;
+
+ set[0].buffer = test_tadsearch_testdata01;
+ set[0].strlen = 3;
+ set[1].buffer = test_tadsearch_testdata10;
+ set[1].strlen = 3;
+ set[2].buffer = test_tadsearch_testdata03;
+ set[2].strlen = 4;
+
+ len = sizeof(test_tadsearch_testdata08)/2;
+ err = tadlib_rabinkarpsearch((TC*)test_tadsearch_testdata08, len, set, 3, &result);
+ if (err != 1) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+ if (result.i != 1) {
+ printf("result failure: %d\n", result.i);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_tadsearch_10()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err, len;
+
+ set[0].buffer = test_tadsearch_testdata01;
+ set[0].strlen = 3;
+ set[1].buffer = test_tadsearch_testdata02;
+ set[1].strlen = 3;
+ set[2].buffer = test_tadsearch_testdata03;
+ set[2].strlen = 4;
+
+ len = tc_strlen((TC*)test_tadsearch_testdata09);
+ err = tadlib_rabinkarpsearch((TC*)test_tadsearch_testdata09, len, set, 3, &result);
+ if (err != 0) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
+LOCAL TEST_RESULT test_tadsearch_11()
+{
+ tcstrbuffer_t set[3];
+ tadlib_rk_result_t result;
+ W err, len;
+
+ set[0].buffer = test_tadsearch_testdata01;
+ set[0].strlen = 3;
+ set[1].buffer = test_tadsearch_testdata11;
+ set[1].strlen = 4;
+ set[2].buffer = test_tadsearch_testdata03;
+ set[2].strlen = 4;
+
+ len = sizeof(test_tadsearch_testdata09)/2;
+ err = tadlib_rabinkarpsearch((TC*)test_tadsearch_testdata09, len, set, 3, &result);
+ if (err != 1) {
+ printf("return value failure: %d\n", err);
+ return TEST_RESULT_FAIL;
+ }
+ if (result.i != 1) {
+ printf("result failure: %d\n", result.i);
+ return TEST_RESULT_FAIL;
+ }
+
+ return TEST_RESULT_PASS;
+}
+
LOCAL VOID test_tadsearch_printresult(TEST_RESULT (*proc)(), B *test_name)
{
TEST_RESULT result;
test_tadsearch_printresult(test_tadsearch_1, "test_tadsearch_1");
test_tadsearch_printresult(test_tadsearch_2, "test_tadsearch_2");
test_tadsearch_printresult(test_tadsearch_3, "test_tadsearch_3");
+ test_tadsearch_printresult(test_tadsearch_4, "test_tadsearch_4");
+ test_tadsearch_printresult(test_tadsearch_5, "test_tadsearch_5");
+ test_tadsearch_printresult(test_tadsearch_6, "test_tadsearch_6");
+ test_tadsearch_printresult(test_tadsearch_7, "test_tadsearch_7");
+ test_tadsearch_printresult(test_tadsearch_8, "test_tadsearch_8");
+ test_tadsearch_printresult(test_tadsearch_9, "test_tadsearch_9");
+ test_tadsearch_printresult(test_tadsearch_10, "test_tadsearch_10");
+ test_tadsearch_printresult(test_tadsearch_11, "test_tadsearch_11");
}