mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added memset test code
This commit is contained in:
parent
aa0b0a7567
commit
596f225179
1 changed files with 13 additions and 0 deletions
13
test.c
13
test.c
|
@ -117,9 +117,19 @@ void encode(uint32_t val) {
|
|||
return;
|
||||
}
|
||||
|
||||
void multi_byte_memset(char *buf, int blen, char *src, int slen)
|
||||
{
|
||||
int bi, si;
|
||||
for (bi = 0, si = 0; bi < blen; bi++, si++) {
|
||||
buf[bi] = src[si % slen];
|
||||
}
|
||||
}
|
||||
|
||||
void main(){
|
||||
char c[128];
|
||||
uint8_t cv[] = {0xEC, 0xBA, 0xBB, 0x00}; // Lambda (0x03bb) is encoded with leading 0xCE
|
||||
uint8_t cv2[] = {0xCE, 0xBB}; // Lambda (0x03bb) is encoded with leading 0xCE
|
||||
//uint8_t cv2[] = {0xEC, 0xBA, 0xBB}; // Lambda (0x03bb) is encoded with leading 0xCE
|
||||
// uint8_t cv[] = {0xCE, 0xBB, 0x00}; // Lambda (0x03bb) is encoded with leading 0xCE
|
||||
char *cptr;
|
||||
uint32_t state = CYC_UTF8_ACCEPT, codepoint, val = 0x32363435;
|
||||
|
@ -132,6 +142,9 @@ void main(){
|
|||
// }
|
||||
// c[127] = '\0';
|
||||
// printf("%s\n", c);
|
||||
multi_byte_memset(c, 126, cv2, 2);
|
||||
c[127] = '\0';
|
||||
printf("TEST: %s\n", c);
|
||||
|
||||
ptr = cv;
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue