int main(int argc , char ** argv) { enkf_config_node_type * config_node = enkf_config_node_alloc_summary("FOPR" , LOAD_FAIL_EXIT); { test_create( config_node ); } enkf_config_node_free( config_node ); }
int main(int argc, char *argv[]) { char *pool_desc, *log_file; char root_dir[PATH_MAX]; START(argc, argv, "rpmemd_db"); if (argc != 4) UT_FATAL("usage: %s <root_dir> <pool_desc> <log-file>", argv[0]); if (realpath(argv[1], root_dir) == NULL) UT_FATAL("!realpath(%s)", argv[1]); pool_desc = argv[2]; log_file = argv[3]; if (rpmemd_log_init("rpmemd error: ", log_file, 0)) FAILED_FUNC("rpmemd_log_init"); test_init(root_dir); test_check_dir(root_dir); test_create(root_dir, pool_desc); test_open(root_dir, pool_desc); rpmemd_log_close(); DONE(NULL); }
int main(int argc, char **argv) { grpc_test_init(argc, argv); test_create(); test_set_compression_algorithm(); test_compression_algorithm_states(); return 0; }
/*------------------------------------------------------------------------- * Function: main * * Purpose: Test the memory pool code * * Return: Success: * * Failure: * * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * * Modifications: * *------------------------------------------------------------------------- */ int main(void) { int nerrors=0; /* Reset library */ h5_reset(); /* Test memory pool creation */ nerrors += test_create(); /* Test memory pool space closing */ nerrors += test_close_one(); /* Test memory pool space allocation */ nerrors += test_allocate_first(); nerrors += test_allocate_split(); nerrors += test_allocate_many_small(); nerrors += test_allocate_new_page(); nerrors += test_allocate_random(); if (nerrors) goto error; puts("All memory pool tests passed."); return 0; error: puts("*** TESTS FAILED ***"); H5E_BEGIN_TRY { } H5E_END_TRY; return 1; }
int main(int argc , char **argv) { test_create(); test_assert_true( util_file_exists( argv[0] )); test_copy( argv[0] ); test_enter( argv[0] ); }
/* TEST */ void pre_executor_test(string_t description) { g_test_runner->test_collection = (test_t**)realloc(g_test_runner->test_collection, sizeof(test_t) * (++g_test_runner->test_count)); g_test_runner->test_collection[g_test_runner->test_count - 1] = test_create(description, g_test_runner->suite_level); g_test_runner->total_success++; // assume that this test will succeed, later we will decrement this if a test failes }
int main(int argc , char ** argv) { test_create(); test_min_realisations(); test_continue(); test_current_module_options(); test_stop_long_running(); exit(0); }
int main(int args, char *arg[]) { list_t *list = NULL; list = test_create(); test_insert(list); test_delete(list); test_examine(list); test_distroy(&list); list = test_create(); test_sorting(list); test_distroy(&list); test_concat_lists(); test_merge_lists(); test_reverse_lists(); exit (EXIT_SUCCESS); }
/** @tested: test whether system will crash when create and delete again and again, which may reveal some bugs */ void test_create_del() { int count = 100000; int i; for (i = 0; i < count; i++) { test_create(); test_delfile(); } }
int main() { test_create(); test_set_vstop(); test_set_vlimit(); exit(0); }
static void init_path_instrumentation (FishPathInstrumentation *fpi, Babl *fmt_source, Babl *fmt_destination) { long ticks_start = 0; long ticks_end = 0; if (!fpi->fmt_rgba_double) { fpi->fmt_rgba_double = babl_format_new ( babl_model ("RGBA"), babl_type ("double"), babl_component ("R"), babl_component ("G"), babl_component ("B"), babl_component ("A"), NULL); } if (!fpi->test) fpi->test = test_create (); // <- test_create utiliza var static dentro de la función fpi->fish_rgba_to_source = babl_fish_reference (fpi->fmt_rgba_double, fmt_source); fpi->fish_reference = babl_fish_reference (fmt_source, fmt_destination); fpi->fish_destination_to_rgba = babl_fish_reference (fmt_destination, fpi->fmt_rgba_double); fpi->source = babl_calloc (NUM_TEST_PIXELS, fmt_source->format.bytes_per_pixel); fpi->destination = babl_calloc (NUM_TEST_PIXELS, fmt_destination->format.bytes_per_pixel); fpi->ref_destination = babl_calloc (NUM_TEST_PIXELS, fmt_destination->format.bytes_per_pixel); fpi->destination_rgba_double = babl_calloc (NUM_TEST_PIXELS, fpi->fmt_rgba_double->format.bytes_per_pixel); fpi->ref_destination_rgba_double = babl_calloc (NUM_TEST_PIXELS, fpi->fmt_rgba_double->format.bytes_per_pixel); /* create sourcebuffer from testbuffer in the correct format */ babl_process (fpi->fish_rgba_to_source, fpi->test, fpi->source, NUM_TEST_PIXELS); /* calculate the reference buffer of how it should be */ ticks_start = babl_ticks (); babl_process (fpi->fish_reference, fpi->source, fpi->ref_destination, NUM_TEST_PIXELS); ticks_end = babl_ticks (); fpi->reference_cost = babl_process_cost (ticks_start, ticks_end); /* transform the reference destination buffer to RGBA */ babl_process (fpi->fish_destination_to_rgba, fpi->ref_destination, fpi->ref_destination_rgba_double, NUM_TEST_PIXELS); }
/** * Add a manual grade to the given problem. A manual grade is a grade you enter at the keyboard, not tested by the comp * * @param problem the problem to add the manual grade to * @param description a description of the manual grade * @param points the points associated with this manual grade * @param is_extra_credit is this manual grade extra credit? */ void add_manual_grade(PROBLEM* problem, const char* description, int points, BOOL is_extra_credit) { TEST* test = test_create(description, &_get_manual_grade); test->is_manual = TRUE; test->is_ec = is_extra_credit; test->max_score = (is_extra_credit ? 0 : points); test->max_ec_score = (is_extra_credit ? points : 0); ll_push_back(problem->tests, test); }
int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); test_create(); test_set_compression_algorithm(); test_compression_algorithm_states(); test_set_socket_mutator(); grpc_shutdown(); return 0; }
/* PENDING */ void pre_executor_pending(string_t description) { g_test_runner->test_collection = (test_t**)realloc(g_test_runner->test_collection, sizeof(test_t) * (++g_test_runner->test_count)); test_t * test = test_create(description, g_test_runner->suite_level); test->is_pending = true; g_test_runner->test_collection[g_test_runner->test_count - 1] = test; g_test_runner->total_pending++; }
/** * Add a new extra credit to the given problem, given the function to test * * @param problem the problem to which to add the test * @param description a description of the test to add to the problem * @param points the number of extra credit points to attribute to the test * @param test_function the function that is called and associated with this test */ void add_new_ec_test(PROBLEM* problem, const char* description, double points, void (*test_function)() ) { TEST* test = test_create(description, test_function); test->is_manual = FALSE; test->is_ec = TRUE; test->max_score = 0; test->max_ec_score = points; ll_push_back(problem->tests, test); }
int main() { test_create(1); test_add(2); test_print(3); test_remove(4); test_remove_last_node(); test_remove_first_node(); test_add_with_index(0); test_add_with_index(1); test_add_with_index(2); return 0; }
int main(int argc , char ** argv) { ecl_grid_type * ecl_grid = ecl_grid_alloc_rectangular( 9 , 9 , 2 , 1 , 1 , 1 , NULL ); ecl_kw_type * fault_blk_kw = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( ecl_grid ) , ECL_INT_TYPE ); test_create( ecl_grid , fault_blk_kw ); test_create_invalid( ecl_grid ); test_trace_edge( ecl_grid ); test_export(ecl_grid); test_neighbours( ecl_grid ); ecl_grid_free( ecl_grid ); ecl_kw_free( fault_blk_kw ); exit(0); }
int main() { int Error(0); Error += test_alloc(); Error += test_texture2d_image_size(); Error += test_texture2d_query(); Error += test_texture2d_clear(); Error += test_texture2d_image_access(); Error += test_create(); Error += fetch::test(); return Error; }
int main(int argc, char **argv) { pid_t pid; if (argc == 2) { if (!strcmp(argv[1], "hugetlbfs")) { unsigned long hpage_size = default_huge_page_size(); if (!hpage_size) { printf("Unable to determine huge page size\n"); abort(); } hugetlbfs_test = 1; memfd_str = MEMFD_HUGE_STR; mfd_def_size = hpage_size * 2; } else { printf("Unknown option: %s\n", argv[1]); abort(); } } test_create(); test_basic(); test_seal_write(); test_seal_future_write(); test_seal_shrink(); test_seal_grow(); test_seal_resize(); test_share_dup("SHARE-DUP", ""); test_share_mmap("SHARE-MMAP", ""); test_share_open("SHARE-OPEN", ""); test_share_fork("SHARE-FORK", ""); /* Run test-suite in a multi-threaded environment with a shared * file-table. */ pid = spawn_idle_thread(CLONE_FILES | CLONE_FS | CLONE_VM); test_share_dup("SHARE-DUP", SHARED_FT_STR); test_share_mmap("SHARE-MMAP", SHARED_FT_STR); test_share_open("SHARE-OPEN", SHARED_FT_STR); test_share_fork("SHARE-FORK", SHARED_FT_STR); join_idle_thread(pid); printf("memfd: DONE\n"); return 0; }
int main(int argc, const char **argv) { test_create(); test_to_long_long(); test_compare(); test_add(); test_subtract(); test_increment(); test_decrement(); test_performance(); printf("\nAll tests passed!\n"); return EXIT_SUCCESS; };
int main(int argc , char ** argv) { test_create(); test_min_realisations(); test_continue(); { const char * num_realizations_str = "NUM_REALIZATIONS 80\n"; const char * min_realizations_str = "MIN_REALIZATIONS 10%%\n"; int min_realizations = 8; test_min_realizations_percent(num_realizations_str, min_realizations_str, min_realizations); } { const char * num_realizations_str = "NUM_REALIZATIONS 8\n"; const char * min_realizations_str = "MIN_REALIZATIONS 50%%\n"; int min_realizations = 4; test_min_realizations_percent(num_realizations_str, min_realizations_str, min_realizations); } { const char * num_realizations_str = "NUM_REALIZATIONS 80\n"; const char * min_realizations_str = "MIN_REALIZATIONS 2\n"; int min_realizations = 2; test_min_realizations_percent(num_realizations_str, min_realizations_str, min_realizations); } { const char * num_realizations_str = "NUM_REALIZATIONS 8\n"; const char * min_realizations_str = "MIN_REALIZATIONS 10%%\n"; int min_realizations = 0; test_min_realizations_percent(num_realizations_str, min_realizations_str, min_realizations); } { const char * num_realizations_str = "NUM_REALIZATIONS 900\n"; const char * min_realizations_str = "MIN_REALIZATIONS 10 \n"; int min_realizations = 10; test_min_realizations_percent(num_realizations_str, min_realizations_str, min_realizations); } { const char * num_realizations_str = "NUM_REALIZATIONS 900\n"; int min_realizations = 0; test_min_realizations_percent(num_realizations_str, "", min_realizations); } test_current_module_options(); test_stop_long_running(); exit(0); }
int main(int argc, char const* argv[]) { int n; struct test_t *w = test_create(n); //printf("test 1\n"); //test_print(w); //printf("%d\n",test_count(w)); //printf("\n\n"); //printf("test 2\n"); test_print(w+1); printf("%d\n",test_count(w+1)); return 0; }
int main(int argc , char ** argv) { const char * grid_file = argv[1]; const char * fault_blk_file = argv[2]; ecl_grid_type * ecl_grid = ecl_grid_alloc( grid_file ); ecl_kw_type * fault_blk_kw; { FILE * stream = util_fopen( fault_blk_file , "r"); fault_blk_kw = ecl_kw_fscanf_alloc_grdecl( stream , "FAULTBLK" , ecl_grid_get_global_size( ecl_grid ) , ECL_INT); fclose( stream ); } test_create( ecl_grid , fault_blk_kw ); ecl_grid_free( ecl_grid ); ecl_kw_free( fault_blk_kw ); exit(0); }
int main(int argc, char **argv) { pid_t pid; printf("memfd: CREATE\n"); test_create(); printf("memfd: BASIC\n"); test_basic(); printf("memfd: SEAL-WRITE\n"); test_seal_write(); printf("memfd: SEAL-SHRINK\n"); test_seal_shrink(); printf("memfd: SEAL-GROW\n"); test_seal_grow(); printf("memfd: SEAL-RESIZE\n"); test_seal_resize(); printf("memfd: SHARE-DUP\n"); test_share_dup(); printf("memfd: SHARE-MMAP\n"); test_share_mmap(); printf("memfd: SHARE-OPEN\n"); test_share_open(); printf("memfd: SHARE-FORK\n"); test_share_fork(); /* Run test-suite in a multi-threaded environment with a shared * file-table. */ pid = spawn_idle_thread(CLONE_FILES | CLONE_FS | CLONE_VM); printf("memfd: SHARE-DUP (shared file-table)\n"); test_share_dup(); printf("memfd: SHARE-MMAP (shared file-table)\n"); test_share_mmap(); printf("memfd: SHARE-OPEN (shared file-table)\n"); test_share_open(); printf("memfd: SHARE-FORK (shared file-table)\n"); test_share_fork(); join_idle_thread(pid); printf("memfd: DONE\n"); return 0; }
int main(int argc, char *argv[]) { START(argc, argv, "obj_zones"); if (argc != 3) UT_FATAL("usage: %s file-name [open|create]", argv[0]); const char *path = argv[1]; char op = argv[2][0]; if (op == 'c') test_create(path); else if (op == 'o') test_open(path); else UT_FATAL("invalid operation"); DONE(NULL); }
int main(void) { struct test *t = test_create(100); mutex_lock(&t->mutex); /* Run the producer until the queue is full */ t->producer_blocked = FALSE; tasklet_later(&t->producer, producer); while (!t->producer_blocked) cond_wait(&t->cond, &t->mutex); tasklet_stop(&t->producer); assert(t->producer_count == 100); /* Run the consumer until the queue is empty */ t->consumer_blocked = FALSE; tasklet_later(&t->consumer, consumer); while (!t->consumer_blocked) cond_wait(&t->cond, &t->mutex); assert(t->consumer_count == 100); /* Run the producer and the consumer together until 200 items have been produced. */ t->producer_blocked = FALSE; t->consumer_blocked = FALSE; tasklet_later(&t->producer, producer); while (t->producer_count < 200) cond_wait(&t->cond, &t->mutex); while (!t->consumer_blocked) cond_wait(&t->cond, &t->mutex); assert(t->consumer_count == t->producer_count); test_destroy(t); return 0; }
int main() { while(1){ int number; printf("type in your test number: "); scanf("%d",&number); switch (number) { case 1: test_create(); break; case 2: test_close(); break; case 3: test_createwait();break; case 4: test_sig();break; case 5: test_info();break; case 6: test_chown();break; case 7: test_chmod();break; case 8: test_stat();break; default: printf("Wrong input test number"); } } }
int main() { int failures = 0; printf("Starting linked list test...\n"); failures += test_create(); failures += test_append_element(); failures += test_prepend_element(); failures += test_prepend_five(); failures += test_append_five(); failures += test_add_many(); failures += test_add_struct(); failures += test_append_list(); failures += test_append_list_empty(); failures += test_prepend_list(); failures += test_prepend_list_empty(); failures += test_reverse(); failures += test_shallow_copy(); failures += test_shift(); failures += test_reduce(); failures += test_insert(); failures += test_insert_at_head(); failures += test_insert_at_tail(); failures += test_delete(); failures += test_delete_at_head(); failures += test_delete_at_tail(); failures += test_index(); failures += test_destroy(); failures += test_clear(); failures += test_llist_index_of_f(); failures += test_to_array(); failures += test_delete_last(); failures += test_delete_last_few(); if (0 == failures) { printf("All tests ok.\n"); } else { printf("%d test(s) FAILED.\n", failures); return 1; } return 0; }
int test_runall (sortfunc const * funcs, int nfuncs) { int * input; int * output; int ifunc, icheck, pass, allpass; allpass = 1; for (ifunc = 0; ifunc < nfuncs; ++ifunc) { printf ("Checking %s\n", funcs[ifunc].name); pass = 1; for (icheck = 0; icheck < 10; ++icheck) { test_create (icheck, &input, &output); funcs[ifunc].func (output, 10); if ( ! test_check (input, output)) { pass = 0; } test_destroy (input, output); } if (pass) { printf ("%s passed\n", funcs[ifunc].name); } else { printf ("%s FAILED\n", funcs[ifunc].name); allpass = 0; } } if (allpass) { printf ("\nAll tests passed.\n"); } else { printf ("\nThere were FAILURES.\n"); } return allpass ? 0 : 1; }
int main(int argc, char *argv[]) { START(argc, argv, "cto_multiple_pools"); if (argc < 4) UT_FATAL("usage: %s directory mode npools nthreads", argv[0]); Dir = argv[1]; char mode = argv[2][0]; Npools = ATOU(argv[3]); unsigned nthreads = ATOU(argv[4]); UT_OUT("create %d pools in %d thread(s)", Npools, nthreads); Pools = CALLOC(Npools * nthreads, sizeof(Pools[0])); Threads = CALLOC(nthreads, sizeof(Threads[0])); Pool_idx = CALLOC(nthreads, sizeof(Pool_idx[0])); switch (mode) { case 'o': test_open(nthreads); break; case 'c': test_create(nthreads); break; default: UT_FATAL("unknown mode"); } FREE(Pools); FREE(Threads); FREE(Pool_idx); DONE(NULL); }