OpenCores
URL https://opencores.org/ocsvn/plasma/plasma/trunk

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [rtos_test.c] - Diff between revs 352 and 400

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 352 Rev 400
Line 45... Line 45...
   printf("TestCLib\n");
   printf("TestCLib\n");
   strcpy(s1, "Hello ");
   strcpy(s1, "Hello ");
   memset(s2, 0, sizeof(s2));
   memset(s2, 0, sizeof(s2));
   strncpy(s2, "World wide", 5);
   strncpy(s2, "World wide", 5);
   strcat(s1, s2);
   strcat(s1, s2);
   strncat(s1, "!\nthing", 14);
   strncat(s1, "!\nthing", 2);
   printf("%s", s1);
   printf("%s", s1);
   rc = strcmp(s1, "Hello World!\n");
   rc = strcmp(s1, "Hello World!\n");
   assert(rc == 0);
   assert(rc == 0);
   rc = strcmp(s1, "Hello WOrld!\n");
   rc = strcmp(s1, "Hello WOrld!\n");
   assert(rc > 0);
   assert(rc > 0);
   rc = strcmp(s1, "Hello world!\n");
   rc = strcmp(s1, "Hello world!\n");
   assert(rc < 0);
   assert(rc < 0);
   rc = strncmp(s1, "Hellx", 4);
   rc = strncmp(s1, "Hellx", 4);
   assert(rc == 0);
   assert(rc == 0);
   ptr = strstr(s1, "orl");
   ptr = strstr(s1, "orl");
   assert(ptr[0] = 'o');
   assert(ptr[0] == 'o');
   rc = strlen(s1);
   rc = strlen(s1);
   assert(rc == 13);
   assert(rc == 13);
   memcpy(s2, s1, rc+1);
   memcpy(s2, s1, rc+1);
   rc = memcmp(s1, s2, 8);
   rc = memcmp(s1, s2, 8);
   assert(rc == 0);
   assert(rc == 0);
Line 119... Line 119...
   for(i = 0; i < 256; ++i)
   for(i = 0; i < 256; ++i)
   {
   {
      if(ptrs[i])
      if(ptrs[i])
         OS_HeapFree(ptrs[i]);
         OS_HeapFree(ptrs[i]);
   }
   }
 
#if 1
 
   for(i = 1000; i < 1000000; i += 1000)
 
   {
 
      ptr = OS_HeapMalloc(NULL, i);
 
      if(ptr == NULL)
 
         break;
 
      OS_HeapFree(ptr);
 
   }
 
   printf("Malloc max = %d\n", i);
 
#endif
   printf("Done.\n");
   printf("Done.\n");
}
}
 
 
//******************************************************************
//******************************************************************
static void MyThreadMain(void *arg)
static void MyThreadMain(void *arg)
Line 431... Line 441...
 
 
//******************************************************************
//******************************************************************
void MMUTest(void);
void MMUTest(void);
void HtmlThread(void *arg);
void HtmlThread(void *arg);
void ConsoleInit(void);
void ConsoleInit(void);
void exit(int);
 
uint8 macAddress[] =  {0x00, 0x10, 0xdd, 0xce, 0x15, 0xd4};
uint8 macAddress[] =  {0x00, 0x10, 0xdd, 0xce, 0x15, 0xd4};
 
 
 
 
void MainThread(void *Arg)
void MainThread(void *Arg)
{
{

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.