24 for (c_in = ESCAPED_CMD + 1; c_in <= ((char) 0xFF); c_in++) {
53 for (c_in = ESCAPED_CMD + 1; c_in <= ((char) 0xFF); c_in++) {
194 for (i = 0; i < 4; i++)
213 for (i = 0; i < 4; i++)
246 for (u = 0; u < u_len; u++)
253 for (u = 0; u < u_len; u++)
266 for (u = 0; u < u_len; u++)
279 for (u = 0; u < u_len; u++)
291 for (u = 0; u < 6; u++) {
323 for (i = 0; i < 4; i++)
413 for (i = 0; i < 256; i++)
419 void sendReadOnly() {
432 void sendVarSpecPic() {
445 #define CMD_TOKEN_STR "\xAA"
446 #define CMD_SEND_ONLY_STR "\xFE"
447 #define CMD_SEND_RECEIVE_VAR_STR "\xFF"
452 uint8_t au8_data[17] =
CMD_TOKEN_STR CMD_SEND_ONLY_STR
"\x00" "\x0C" "\x03" "%x\x00" "test\x00" "ing";
467 uint8_t au8_data[17] =
CMD_TOKEN_STR CMD_SEND_ONLY_STR
"\x00" "\x0C" "\xFF" "%y\x00" "book\x00" "let";
481 uint8_t au8_data[17] =
CMD_TOKEN_STR CMD_SEND_RECEIVE_VAR_STR
"\x00" "\x0C" "\x03" "%x\x00" "test\x00" "ing";
523 uint8_t au8_data[11] =
CMD_TOKEN_STR CMD_SEND_RECEIVE_VAR_STR
"\x00" "\x06" "\x03" "\x00" "test";
544 for (
uint i = 0; i < 4; i++)
578 au8_outCharData = NULL;
587 ASSERT(au8_outCharData != NULL);
588 ASSERT(st_outCharIndex < st_outCharLen);
589 ASSERT(au8_outCharData[st_outCharIndex++] == c);
602 #define REQUIRE_ASSERT(code, expectedMsg) \
604 BOOL didAssert = FALSE; \
607 } catch (char* psz_msg) { \
608 didAssert = strncmp(psz_msg, expectedMsg, strlen(expectedMsg)) ? FALSE : TRUE; \
614 #define REQUIRE_ASSERT(code, expectedMsg) (void) 0
640 au8_outCharData = au8_data;
641 st_outCharLen = u_len;
643 ASSERT(st_outCharIndex == st_outCharLen);
674 for (u_i = 0; u_i < 4; u_i++)
675 xferVar[0].pu8_data[u_i] = u_i;
687 for (u_i = 0; u_i < 256; u_i++)
688 xferVar[0].pu8_data[u_i] = u_i;
695 au8_data[u_i + 4] = u_i;
697 for (; u_i < 256; u_i++)
698 au8_data[u_i + 5] = u_i;
707 "specifyVar:indexTooHigh");
713 "specifyVar:nullData");
721 "specifyVar:invalidSize");
723 "specifyVar:invalidSize");
735 au8_outCharData = au8_data;
739 ASSERT(st_outCharIndex == st_outCharLen);
756 for (u_i = 5; u_i < 5 + 256; u_i++)
760 au8_outCharData = au8_data;
761 st_outCharLen = 5 + 256;
770 ASSERT(st_outCharIndex == st_outCharLen);
787 for (u_i = 6; u_i < 6 + 256; u_i++)
791 au8_outCharData = au8_data;
792 st_outCharLen = 5 + 256;
801 ASSERT(st_outCharIndex == st_outCharLen);
818 for (u_i = 7; u_i < 7 + 256; u_i++)
822 au8_outCharData = au8_data;
823 st_outCharLen = 5 + 256;
831 ASSERT(st_outCharIndex == st_outCharLen);
926 printf(
"Running test %d...", u_index + 1);
928 printf(
"success.\n");
930 printf(
"All %d tests passed.\n", u_index);