int main (int argc, char *argv[]) { CORBA_Environment ev; free (malloc (8)); CORBA_exception_init (&ev); timer = g_timer_new (); g_timer_start (timer); g_timer_reset (timer); orb = CORBA_ORB_init (&argc, argv, "orbit-local-orb", &ev); g_assert (ev._major == CORBA_NO_EXCEPTION); fprintf (stderr, "ORB: init took %g(ms)\n", (elapsed_time = g_timer_elapsed (timer, NULL)) * 1000.0); bogomark += elapsed_time; test_copy (); test_activation (); g_timer_reset (timer); CORBA_ORB_destroy (orb, &ev); g_assert (ev._major == CORBA_NO_EXCEPTION); fprintf (stderr, "ORB: destroy took %g(ms)\n", (elapsed_time = g_timer_elapsed (timer, NULL)) * 1000.0); bogomark += elapsed_time; g_timer_reset (timer); CORBA_Object_release ((CORBA_Object) orb, &ev); g_assert (ev._major == CORBA_NO_EXCEPTION); g_timer_destroy (timer); fprintf (stderr, "Overall bogomark %g\n", 1000.0 / bogomark); return 0; }
int main(int argc, char** argv) { if (!parse_args(argc,argv)) { return 0; } plan_tests(16); Waypoints waypoints; ok(setup_waypoints(waypoints),"waypoint setup",0); unsigned size = waypoints.size(); ok(test_lookup(waypoints,3),"waypoint lookup",0); ok(!test_lookup(waypoints,5000),"waypoint bad lookup",0); ok(test_nearest(waypoints),"waypoint nearest",0); ok(test_nearest_landable(waypoints),"waypoint nearest landable",0); ok(test_location(waypoints,true),"waypoint location good",0); ok(test_location(waypoints,false),"waypoint location bad",0); ok(test_range(waypoints,100)==1,"waypoint visit range 100m",0); ok(test_radius(waypoints,100)==1,"waypoint radius 100m",0); ok(test_range(waypoints,500000)== waypoints.size(),"waypoint range 500000m",0); ok(test_radius(waypoints,25000)<= test_range(waypoints,25000),"waypoint radius<range",0); // test clear waypoints.clear(); ok(waypoints.size()==0,"waypoint clear",0); setup_waypoints(waypoints); ok(size == waypoints.size(),"waypoint setup after clear",0); ok(test_copy(waypoints),"waypoint copy",0); ok(test_erase(waypoints,3),"waypoint erase",0); ok(test_replace(waypoints,4),"waypoint replace",0); return exit_status(); }
int main(int argc, char *argv[]) { bool result = true; piece no_piece = NULL; printf("result of test error\n"); test_equality_int(0, 1, "error test_equality_int "); test_equality_bool(true, false, "error test_equality_bool "); test_failure_piece(no_piece); printf("----------------------------------------------------------\n"); delete_piece(no_piece); result = result && test_equality_bool(true, test_new_piece(), "new_piece"); result = result && test_equality_bool(true, test_intersect(), "intersect"); result = result && test_equality_bool(true, test_move(), "move"); result = result && test_equality_bool(true, test_copy(), "copy"); if (result) { printf("Youpi !\n"); return EXIT_SUCCESS; } else return EXIT_FAILURE; }
int main(int argc, char** argv) { test_buf_strnlen(); test_buf_new(); test_offs_ncopy(); test_offs_ncopy2(); test_offs_ncopy3(); test_offs_ncopy4(); test_offs_ncopy5(); test_offs_ncopy6(); test_offs_ncopy_extend(); test_offs_ncopy_extend2(); test_offs_ncopy_extend3(); test_offs_ncopy_extend4(); test_copy(); test_copy2(); test_ncopy(); test_ncopy2(); test_add(); test_add_extend(); test_buf_printf(); test_buf_printf2(); return 0; }
enum piglit_result piglit_display(void) { enum piglit_result res; GLuint fb, rb; GLint stencil_size; GLenum status; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); /* Create the FBO. */ glGenRenderbuffersEXT(1, &rb); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, f.iformat, BUF_SIZE, BUF_SIZE); glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_STENCIL_SIZE_EXT, &stencil_size); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); glGenFramebuffersEXT(1, &fb); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER_EXT, rb); glViewport(0, 0, BUF_SIZE, BUF_SIZE); glDrawBuffer(GL_NONE); glReadBuffer(GL_NONE); status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { printf("FBO incomplete status 0x%X\n", status); piglit_report_result(PIGLIT_SKIP); } mask = (1 << stencil_size) - 1; switch (test) { case CLEAR: puts("Testing glClear(stencil)."); res = test_clear(); break; case READPIXELS: puts("Testing glReadPixels(stencil)."); res = test_readpixels(); break; case DRAWPIXELS: puts("Testing glDrawPixels(stencil)."); res = test_drawpixels(); break; case COPYPIXELS: case BLIT: puts(test == BLIT ? "Testing glBlitFramebuffer(stencil)." : "Testing glCopyPixels(stencil)."); res = test_copy(); break; default: assert(0); } /* Cleanup. */ glDeleteFramebuffersEXT(1, &fb); glDeleteRenderbuffersEXT(1, &rb); glutSwapBuffers(); assert(glGetError() == 0); return res; }
int main(int argc , char ** argv) { basic_test(); test_equal(); test_copy(); exit(0); }
int main() { test_ref(); test_copy(); return 0; }
enum piglit_result piglit_display(void) { enum piglit_result res; GLuint fb, rb; GLenum status; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); /* Create the FBO. */ glGenRenderbuffersEXT(1, &rb); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, f.iformat, BUF_SIZE, BUF_SIZE); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); glGenFramebuffersEXT(1, &fb); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER_EXT, rb); glViewport(0, 0, BUF_SIZE, BUF_SIZE); glDrawBuffer(GL_NONE); glReadBuffer(GL_NONE); status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { printf("FBO incomplete status 0x%X\n", status); piglit_report_result(PIGLIT_SKIP); } glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); switch (test) { case CLEAR: puts("Testing glClear(depth)."); res = test_clear(); break; case READPIXELS: puts("Testing glReadPixels(depth)."); res = test_readpixels(); break; case DRAWPIXELS: puts("Testing glDrawPixels(depth)."); res = test_drawpixels(); break; case COPYPIXELS: case BLIT: puts(test == BLIT ? "Testing glBlitFramebuffer(depth)." : "Testing glCopyPixels(depth)."); res = test_copy(); break; default: assert(0); res = PIGLIT_SKIP; } /* Cleanup. */ glBindFramebufferEXT(GL_FRAMEBUFFER, piglit_winsys_fbo); glDeleteFramebuffersEXT(1, &fb); glDeleteRenderbuffersEXT(1, &rb); piglit_present_results(); if (!piglit_check_gl_error(GL_NO_ERROR)) piglit_report_result(PIGLIT_FAIL); return res; }
int main(int argc, char **argv) { krb5_context context; krb5_error_code ret; int optidx = 0; krb5_ccache id1, id2; setprogname(argv[0]); if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optidx)) usage(1); if (help_flag) usage (0); if(version_flag){ print_version(NULL); exit(0); } argc -= optidx; argv += optidx; ret = krb5_init_context(&context); if (ret) errx (1, "krb5_init_context failed: %d", ret); test_cache_remove(context, krb5_cc_type_file); test_cache_remove(context, krb5_cc_type_memory); #ifdef USE_SQLITE test_cache_remove(context, krb5_cc_type_scc); #endif test_default_name(context); test_mcache(context); test_init_vs_destroy(context, krb5_cc_type_memory); test_init_vs_destroy(context, krb5_cc_type_file); #if 0 test_init_vs_destroy(context, krb5_cc_type_api); #endif test_init_vs_destroy(context, krb5_cc_type_scc); test_mcc_default(); test_def_cc_name(context); test_cache_iter_all(context); test_cache_iter(context, krb5_cc_type_memory, 0); { krb5_principal p; krb5_cc_new_unique(context, krb5_cc_type_memory, "bar", &id1); krb5_cc_new_unique(context, krb5_cc_type_memory, "baz", &id2); krb5_parse_name(context, "*****@*****.**", &p); krb5_cc_initialize(context, id1, p); krb5_free_principal(context, p); } test_cache_find(context, "*****@*****.**", 1); test_cache_find(context, "*****@*****.**", 0); test_cache_iter(context, krb5_cc_type_memory, 0); test_cache_iter(context, krb5_cc_type_memory, 1); test_cache_iter(context, krb5_cc_type_memory, 0); test_cache_iter(context, krb5_cc_type_file, 0); test_cache_iter(context, krb5_cc_type_api, 0); test_cache_iter(context, krb5_cc_type_scc, 0); test_cache_iter(context, krb5_cc_type_scc, 1); test_copy(context, krb5_cc_type_file, krb5_cc_type_file); test_copy(context, krb5_cc_type_memory, krb5_cc_type_memory); test_copy(context, krb5_cc_type_file, krb5_cc_type_memory); test_copy(context, krb5_cc_type_memory, krb5_cc_type_file); test_copy(context, krb5_cc_type_scc, krb5_cc_type_file); test_copy(context, krb5_cc_type_file, krb5_cc_type_scc); test_copy(context, krb5_cc_type_scc, krb5_cc_type_memory); test_copy(context, krb5_cc_type_memory, krb5_cc_type_scc); test_move(context, krb5_cc_type_file); test_move(context, krb5_cc_type_memory); #ifdef HAVE_KCM test_move(context, krb5_cc_type_kcm); #endif test_move(context, krb5_cc_type_scc); test_prefix_ops(context, "FILE:/tmp/foo", &krb5_fcc_ops); test_prefix_ops(context, "FILE", &krb5_fcc_ops); test_prefix_ops(context, "MEMORY", &krb5_mcc_ops); test_prefix_ops(context, "MEMORY:foo", &krb5_mcc_ops); test_prefix_ops(context, "/tmp/kaka", &krb5_fcc_ops); #ifdef HAVE_SCC test_prefix_ops(context, "SCC:", &krb5_scc_ops); test_prefix_ops(context, "SCC:foo", &krb5_scc_ops); #endif krb5_cc_destroy(context, id1); krb5_cc_destroy(context, id2); test_cc_config(context); krb5_free_context(context); #if 0 sleep(60); #endif return 0; }
int main() { test_copy(); test_heap(); return 0; }
/*------------------------------------------------------------------------- * Function: main * * Purpose: Test error API. * * Programmer: Raymond Lu * July 10, 2003 * *------------------------------------------------------------------------- */ int main(void) { hid_t file, fapl; hid_t estack_id; char filename[1024]; const char *FUNC_main = "main"; HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n"); /* Initialize errors */ if(init_error() < 0) TEST_ERROR; fapl = h5_fileaccess(); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; /* Test error stack */ if(error_stack() < 0) { /* Push an error onto error stack */ if(H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, "Error stack test failed") < 0) TEST_ERROR; /* Delete an error from the top of error stack */ H5Epop(ERR_STACK, 1); /* Make sure we can use other class's major or minor errors. */ H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS2, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, "Error stack test failed"); /* Print out the errors on stack */ dump_error(ERR_STACK); /* Empty error stack */ H5Eclear2(ERR_STACK); /* Close error stack */ H5Eclose_stack(ERR_STACK); } /* end if */ /* Test error API */ if(test_error(file) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed, %s", "it's wrong"); estack_id = H5Eget_current_stack(); H5Eprint2(estack_id, stderr); H5Eclose_stack(estack_id); } /* end if */ /* Test pushing a very long error description */ if(test_long_desc() < 0) TEST_ERROR; /* Test creating a new error stack */ if(test_create() < 0) TEST_ERROR; /* Test copying a new error stack */ if(test_copy() < 0) TEST_ERROR; if(H5Fclose(file) < 0) TEST_ERROR; /* Close error information */ if(close_error() < 0) TEST_ERROR; /* Test error message during data reading when filter isn't registered * Use default FAPL to avoid some VFD drivers by the check-vfd test because * the test file was pre-generated. */ h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename); if(test_filter_error(filename) < 0) TEST_ERROR; h5_clean_files(FILENAME, fapl); HDfprintf(stderr, "\nAll error API tests passed.\n"); return 0; error: HDfprintf(stderr, "\n***** ERROR TEST FAILED (real problem)! *****\n"); return 1; }
void run () { testBadJson (); test_copy (); test_move (); }