4 #include "../qrencode_inner.h"
5 #include "../qrinput.h"
8 /* See pp. 73 of JIS X0510:2004 */
9 void test_rscode1(void)
13 static const char str[9] = "01234567";
14 static unsigned char correct[26] = {
15 0x10, 0x20, 0x0c, 0x56, 0x61, 0x80, 0xec, 0x11, 0xec, 0x11, 0xec, 0x11,
16 0xec, 0x11, 0xec, 0x11, 0xa5, 0x24, 0xd4, 0xc1, 0xed, 0x36, 0xc7, 0x87,
19 testStart("RS ecc test");
20 stream = QRinput_new();
21 QRinput_append(stream, QR_MODE_NUM, 8, (unsigned char *)str);
22 QRinput_setErrorCorrectionLevel(stream, QR_ECLEVEL_M);
23 code = QRraw_new(stream);
25 testEnd(memcmp(correct + 16, code->rsblock[0].ecc, 10));
30 int main(int argc, char **argv)