+static int compare_buffers(char *msg, int no,
+ int expect_len, const unsigned char *expect_buf,
+ int got_len, const unsigned char *got_buf)
+{
+ int i;
+ if (expect_len == got_len
+ && !memcmp(expect_buf, got_buf, expect_len))
+ return 1;
+ printf("tsticonv test=%s i=%d failed\n", msg, no);
+ printf("off got exp\n");
+ for (i = 0; i<got_len || i<expect_len; i++)
+ {
+ char got_char[10];
+ char expect_char[10];
+
+ if (i < got_len)
+ sprintf(got_char, "%02X", got_buf[i]);
+ else
+ sprintf(got_char, "? ");
+
+ if (i < expect_len)
+ sprintf(expect_char, "%02X", expect_buf[i]);
+ else
+ sprintf(expect_char, "? ");
+
+ printf("%02d %s %s %c\n",
+ i, got_char, expect_char, got_buf[i] == expect_buf[i] ?
+ ' ' : '*');
+
+ }
+ exit(1);
+}
+