Add more tests from stringlib

This commit is contained in:
2016-03-27 13:16:41 -07:00
parent 9fefff9edf
commit f059c083c8
8 changed files with 66 additions and 0 deletions

16
tests/string_memcpy.c Normal file
View File

@@ -0,0 +1,16 @@
#include "string.h"
int main(void)
{
char testblock[8] = {1, 2, 3, 4, 5, 6, 7, 8};
char testblock2[6] = {50, 60, 70, 80, 90, 100};
int i = 0;
memcpy((void *)&testblock, (void *)&testblock2, (sizeof(char)*6));
for ( i = 0; i < 6; i++) {
if ( testblock[i] != testblock2[i] ) return (i + 1);
}
if ( testblock[6] != 7 ) return 7;
if ( testblock[7] != 8 ) return 8;
return 0;
}