mirror of
https://github.com/tailix/libclayer.git
synced 2024-11-20 11:06:24 -05:00
21 lines
505 B
C
21 lines
505 B
C
|
#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);
|
||
|
}
|
||
|
}
|