Clean up tests

This commit is contained in:
jD91mZM2
2018-07-22 11:24:50 +02:00
parent e9484e4d60
commit 67d5976622
97 changed files with 84 additions and 84 deletions
+24
View File
@@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char ** argv) {
printf("# mem #\n");
char arr[100];
memset(arr, 0, 100); // Compiler builtin, should work
arr[50] = 1;
if ((size_t)memchr((void *)arr, 1, 100) - (size_t)arr != 50) {
printf("Incorrect memchr\n");
exit(1);
}
printf("Correct memchr\n");
char arr2[51];
memset(arr2, 0, 51); // Compiler builtin, should work
memccpy((void *)arr2, (void *)arr, 1, 100);
if (arr[50] != 1) {
printf("Incorrect memccpy\n");
exit(1);
}
printf("Correct memccpy\n");
return 0;
}