os-k/src/kaleid/common/test/test-common.c

84 lines
2.3 KiB
C

//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Authors: spectral` //
// NeoX //
// //
// Desc: Test file for common/ //
//----------------------------------------------------------------------------//
#include <stdlib.h>
#include <stdio.h>
void *_osk_memsetw(void *, int, long);
char *_osk_itoa(int, char *, int);
char *_osk_ltoa(long, char *, int);
char *_osk_utoa(unsigned int, char *, int);
char *_osk_ultoa(unsigned long, char *, int);
int main(int argc, char *argv[])
{
(void)argc;
(void)argv;
// please don't mind how weird this file is
// I remove tests of "simple" functions after
// I'm done with testing that function
// so a lot of test variables remain in case
// I need them for a future test
//const char *test1 = "test string\n";
//const size_t size1 = strlen(test1);
//char *test2 = malloc(size1);
//char *test3 = malloc(size1);
#if 0
const size_t sizex = 130;
short *xxx = (short *)malloc(sizex * sizeof(short));
//printf("%ld\n",(ulong)xxx%8);
//memzero(xxx, sizex);
_osk_memsetw(xxx, 300, sizex);
size_t it;
for (it = 0; it < sizex; it++) {
short s = *(xxx + it);
printf("%hd", s);
}
free((void *)xxx);
#endif
char buf[256];
puts(_osk_ultoa(5000000000, buf, 10));
puts("");
//const char *str = "ceci est un string de test!";
//char *str2 = malloc((strlen(str) + 3) * sizeof(char));
//char *str3 = malloc((strlen(str) + 3) * sizeof(char));
//strcpy(str2, str);
//size_t s = strlen(str2);
//strrev(str3,str2);
//printf("%lu - %s\n", strlen(str3), str3);
//str2[s] = '\n';
//str2[s+1] = '\0';
//strrev(str2,str3);
//printf("%lu - %s\n", strlen(str2), str2);
//free(str2);
//free(str3);
//free(test2);
//free(test3);
return 0;
}