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

17
tests/string_memset.c Normal file
View File

@@ -0,0 +1,17 @@
#include "string.h"
int main(void)
{
char testblock[12] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
int i = 0;
memset((void *)&testblock, 0x00, (sizeof(char) * 8));
for ( i = 0; i < 8; i++) {
if ( testblock[i] != 0x00 ) return (i + 1);
}
if ( testblock[8] != 9 ) return 8;
if ( testblock[9] != 10 ) return 9;
if ( testblock[10] != 11 ) return 10;
if ( testblock[11] != 12 ) return 11;
return 0;
}