1
0
Fork 0
mirror of https://github.com/tailix/libclayer.git synced 2024-11-20 11:06:24 -05:00
libclayer/tests/string.c

21 lines
505 B
C
Raw Normal View History

2022-12-25 06:23:09 -05:00
#include <assert.h>
#include <stddef.h>
#include <string.h>
void test_main()
{
{
const size_t count = 1024;
char aaa[count];
char bbb[count];
for (size_t i = 0; i < count; ++i) aaa[i] = bbb[i] = i*i;
assert(LIBCLAYER(memcmp)(aaa, bbb, count) == 0);
aaa[123] = 1;
bbb[123] = 2;
assert(LIBCLAYER(memcmp)(aaa, bbb, count) == -1);
aaa[123] = 2;
bbb[123] = 1;
assert(LIBCLAYER(memcmp)(aaa, bbb, count) == 1);
}
}