1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-20 11:16:10 -05:00
kernel/test/libk/memset.c
2017-11-04 08:04:22 +00:00

23 lines
382 B
C

#include <kernelmq/stdlib.h>
#include <assert.h>
#include <string.h>
int main()
{
char buffer[7];
kmemset(buffer, 0, 1);
assert(strlen(buffer) == 0);
kmemset(buffer, 1, 3);
kmemset(&buffer[3], 0, 4);
assert(strlen(buffer) == 3);
strcpy(buffer, "qwerty");
kmemset(&buffer[2], 'a', 2);
assert(!strcmp(buffer, "qwaaty"));
return 0;
}