Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
  int retval = 0;
  int i;

  for (i = 1; argv[i]; i++) {
    if (strcmp(argv[i], "-v") == 0)
      tstflags |= tst_verbatim;
    else if (strcmp(argv[i], "-a") == 0)
      tstflags |= tst_abort;
    else
      usage(1);
  }
#if HAVE_OPEN_C
  tstflags |= tst_verbatim;
#endif

  retval |= test_alloc();
  retval |= test_lock();
  retval |= test_strdupcat();
  retval |= test_sprintf("%s.%s", "foo", "bar");
  retval |= test_strlst();
  retval |= test_vectors();
  retval |= test_auto();

  return retval;
}
Ejemplo n.º 2
0
int main(void)
{
	test_strtol();
	test_strtoul();
	test_sprintf();
	return 0;
}
Ejemplo n.º 3
0
int
main (int   argc,
      char *argv[])
{
    test_sprintf ();
    test_vsprintf ();
    test_strdup ();
    test_strndup ();
    test_strcat ();
    test_strncat ();
    test_strcat_sprintf ();
    test_strcat_vsprintf ();
    test_str_split ();
    test_array_new ();
    test_array_add ();
    test_array_addn ();
    test_array_addp ();
    test_array_copy ();
    test_array_append ();
    test_str_wrap ();
    test_str_screen_width ();
    test_str_screen_wrap ();

    return 0;
}
Ejemplo n.º 4
0
int main(int argc, char **argv) {
	if (argc > 1) {
		if (!strcmp(argv[1], "v")) {
			Verbose = 1;
		}
		else if (!strcmp(argv[1], "test-stdout")) {
			test_stdout();
			return EXIT_SUCCESS;
		}
		if (!strcmp(argv[1], "test-atexit")) {
			test_atexit();
			return EXIT_SUCCESS;
		}
	}
	test_mem();
	test_str();
	test_sprintf();
	test_math();
	test_proc();
	test_stdio();
	test_file();
	test_exit();
	return EXIT_FAILURE;
}
Ejemplo n.º 5
0
void core_loop()
{
//         init_netif();
//         init_network();

#ifdef DBG
#ifdef MATH_DBG
        printf("atanh(2.5) = %s\n", (isNaN(atanh(2.5)))?"NaN" : "A number");
#endif
#ifdef BUF_DBG
        buf_dbg();
#endif
#ifdef VMEM_DBG
        debug("Address of higher half: %X\n", (int)&higherhalf);
        debug("Address of end ptr:     %X\n", (int)&end);
#endif
#ifdef SPRINTF_DBG
        test_sprintf();
        test_calculation_functions();
#endif
#ifdef SLAB_DBG
        mm_cache_test();
#endif
#endif
#ifdef RR_EXP
        extern void task_testA();
        extern void task_testB();
        rr_thread_init(task_testA);
        rr_thread_init(task_testB);
#endif
#ifdef PT_DBG
        addr_t ptb = (addr_t)(&page_table_boot) + 0xC0000000;
        printf( "page table boot: %X\n"
                "phys: %X\n"
                "virt: %X\n",
                &core_loop,
                pte_get_phys(core_loop),
                core_loop
        );
#endif

//         uint32_t pid = 0;
        debug("Entering core loop\n");
        while (TRUE) // Infinite loop, to make the kernel wait when there is nothing to do
        {
                switch (rl)
                {
                case RL_RUN0:
                case RL_RUN1:
                case RL_RUN2:
                case RL_RUN3:
                case RL_RUN4:
                     halt();
#ifdef RR_EXP
                     rr_sched();
#endif
                        break;

                case RL_REBOOT:
                        break;

                case RL_SHUTDOWN:
                        break;
                }
                halt(); // Puts the CPU in idle state untill next interrupt
        }
}
Ejemplo n.º 6
0
bool test_libc(void)
{
	// test_string_h();
	return test_sprintf() && test_div64();
}