static int thread_printheader(logbuffer_t * logbuf) { logbuf->logsize = 0; log_header_t header = log_header_INIT("thread_printheader", __FILE__, 100); printheader_logbuffer(logbuf, &header); TEST(0 == compare_header(logbuf->logsize, logbuf->addr, "thread_printheader", __FILE__, 100)); return 0; ONERR: CLEARBUFFER_ERRLOG(); return EINVAL; }
static int childprocess_unittest(void) { resourceusage_t usage = resourceusage_FREE; if (test_logininfo()) goto ONERR; CLEARBUFFER_ERRLOG(); TEST(0 == init_resourceusage(&usage)); if (test_systypes()) goto ONERR; if (test_initfree()) goto ONERR; if (test_query()) goto ONERR; if (test_switchandset()) goto ONERR; if (test_logininfo()) goto ONERR; TEST(0 == same_resourceusage(&usage)); TEST(0 == free_resourceusage(&usage)); return 0; ONERR: return EINVAL; }
static int run_all_test(maincontext_t* maincontext) { (void) maincontext; prepare_test(); // current development // ... //{ err RUN(unittest_err_errornr); //} //{ std types RUN(unittest_stdtypes_iobj); //} //{ task context RUN(unittest_task_module); RUN(unittest_task_threadcontext); //} //{ main context RUN(unittest_main_maincontext); //} //{ cache unittest RUN(unittest_cache_objectcacheimpl); //} //{ data structure unittest RUN(unittest_ds_link); // in memory data structures RUN(unittest_ds_inmem_arraysf); RUN(unittest_ds_inmem_arraystf); RUN(unittest_ds_inmem_binarystack); RUN(unittest_ds_inmem_blockarray); RUN(unittest_ds_inmem_dlist); RUN(unittest_ds_inmem_olist); RUN(unittest_ds_inmem_exthash); RUN(unittest_ds_inmem_heap); RUN(unittest_ds_inmem_patriciatrie); RUN(unittest_ds_inmem_queue); RUN(unittest_ds_inmem_redblacktree); RUN(unittest_ds_inmem_slist); RUN(unittest_ds_inmem_splaytree); RUN(unittest_ds_inmem_suffixtree); RUN(unittest_ds_inmem_trie); // sort algorithms RUN(unittest_ds_sort_mergesort); // type adapter RUN(unittest_ds_typeadapt); RUN(unittest_ds_typeadapt_comparator); RUN(unittest_ds_typeadapt_getkey); RUN(unittest_ds_typeadapt_gethash); RUN(unittest_ds_typeadapt_lifetime); RUN(unittest_ds_typeadapt_typeadaptimpl); RUN(unittest_ds_typeadapt_nodeoffset); //} //{ math unittest RUN(unittest_math_fpu); RUN(unittest_math_float_decimal); RUN(unittest_math_hash_crc16); RUN(unittest_math_hash_crc32); RUN(unittest_math_hash_crc7); RUN(unittest_math_hash_sha1); RUN(unittest_math_int_abs); RUN(unittest_math_int_bcd); RUN(unittest_math_int_biginteger); RUN(unittest_math_int_bitorder); RUN(unittest_math_int_byteorder); RUN(unittest_math_int_factorise); RUN(unittest_math_int_findzerobyte); RUN(unittest_math_int_log10); RUN(unittest_math_int_log2); RUN(unittest_math_int_power2); RUN(unittest_math_int_sign); RUN(unittest_math_int_sqroot); //} //{ memory unittest RUN(unittest_memory_atomic); RUN(unittest_memory_hwcache); RUN(unittest_memory_memblock); RUN(unittest_memory_memstream); RUN(unittest_memory_memvec); RUN(unittest_memory_pagecache); RUN(unittest_memory_pagecacheimpl); RUN(unittest_memory_pagecache_macros); RUN(unittest_memory_ptr); RUN(unittest_memory_wbuffer); RUN(unittest_memory_mm_mm); RUN(unittest_memory_mm_mmimpl); //} //{ proglang unittest RUN(unittest_proglang_automat_mman); RUN(unittest_proglang_automat); RUN(unittest_proglang_regexpr); //} //{ string unittest RUN(unittest_string); RUN(unittest_string_convertwchar); RUN(unittest_string_cstring); RUN(unittest_string_base64encode); RUN(unittest_string_strsearch); RUN(unittest_string_textpos); RUN(unittest_string_utf8); //} //{ task unittest RUN(unittest_task_syncwait); RUN(unittest_task_syncfunc); RUN(unittest_task_syncrunner); //} //{ test unittest RUN(unittest_test_errortimer); RUN(unittest_test_perftest); RUN(unittest_test_resourceusage); RUN(unittest_test_unittest); RUN(unittest_test_mm_mm_test); RUN(unittest_test_mm_testmm); //} //{ time unittest RUN(unittest_time_sysclock); RUN(unittest_time_systimer); RUN(unittest_time_timevalue); //} //{ io unittest // filesystem RUN(unittest_io_iosys_iobuffer); RUN(unittest_io_iosys_iolist); RUN(unittest_io_iosys_iothread); RUN(unittest_io_directory); RUN(unittest_io_file); RUN(unittest_io_filepath); RUN(unittest_io_fileutil); // IP RUN(unittest_io_ip_ipaddr); RUN(unittest_io_ip_ipsocket); // log RUN(unittest_io_log_logbuffer); RUN(unittest_io_log_logcontext); RUN(unittest_io_log_logwriter); // generic RUN(unittest_io_iochannel); RUN(unittest_io_iopoll); RUN(unittest_io_pipe); // reader RUN(unittest_io_reader_csvfilereader); RUN(unittest_io_reader_filereader); RUN(unittest_io_reader_utf8reader); // Terminal RUN(unittest_io_terminal_pseudoterm); RUN(unittest_io_terminal_serial); RUN(unittest_io_terminal_termadapt); RUN(unittest_io_terminal_terminal); // writer // www RUN(unittest_io_www_uri); //} //{ platform unittest // sync unittest RUN(unittest_platform_sync_eventcount); RUN(unittest_platform_sync_mutex); RUN(unittest_platform_sync_rwlock); RUN(unittest_platform_sync_semaphore); RUN(unittest_platform_sync_signal); RUN(unittest_platform_sync_thrmutex); RUN(unittest_platform_sync_waitlist); // task unittest RUN(unittest_platform_task_process); RUN(unittest_platform_task_thread); RUN(unittest_platform_task_thread_stack); // other RUN(unittest_string_clocale); RUN(unittest_platform_malloc); RUN(unittest_platform_syslogin); RUN(unittest_platform_syscontext); RUN(unittest_platform_vm); // user interface subsystem #if defined(KONFIG_USERINTERFACE_X11) RUN(unittest_platform_X11); RUN(unittest_platform_X11_x11display); RUN(unittest_platform_X11_x11screen); RUN(unittest_platform_X11_x11drawable); // RUN(unittest_platform_X11_x11window); // TODO: remove comment // RUN(unittest_platform_X11_x11dblbuffer); // TODO: remove comment // RUN(unittest_platform_X11_x11videomode); // TODO: remove comment #endif #if defined(KONFIG_USERINTERFACE_EGL) RUN(unittest_platform_opengl_egl_egl); RUN(unittest_platform_opengl_egl_eglconfig); RUN(unittest_platform_opengl_egl_eglcontext); RUN(unittest_platform_opengl_egl_egldisplay); RUN(unittest_platform_opengl_egl_eglpbuffer); RUN(unittest_platform_opengl_egl_eglwindow); #endif //} #if !defined(KONFIG_USERINTERFACE_NONE) //{ graphic unittest RUN(unittest_graphic_display); RUN(unittest_graphic_gconfig); RUN(unittest_graphic_gcontext); RUN(unittest_graphic_pixelbuffer); RUN(unittest_graphic_surface); RUN(unittest_graphic_windowconfig); RUN(unittest_graphic_window); //} #endif CLEARBUFFER_ERRLOG(); return 0; }