这篇教程C++ test_function函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中test_function函数的典型用法代码示例。如果您正苦于以下问题:C++ test_function函数的具体用法?C++ test_function怎么用?C++ test_function使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了test_function函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainintmain (){ test_function (); return 0;}
开发者ID:cooljeanius,项目名称:wget,代码行数:7,
示例2: mainintmain (){ test_function (u16_mbtouc_unsafe); return 0;}
开发者ID:ajnelson,项目名称:gnulib,代码行数:7,
示例3: mainintmain (){ DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); /* A particular value. */ x = 0.6L; y = sqrtl (x); ASSERT (y >= 0.7745966692L && y <= 0.7745966693L); /* Another particular value. */ { long double z; long double err; x = 8.1974099812331540680810141969554806865L; y = sqrtl (x); z = y * y - x; err = my_ldexpl (z, LDBL_MANT_DIG); if (err < 0) err = - err; ASSERT (err <= 100.0L); } test_function (); return 0;}
开发者ID:Distrotech,项目名称:gnulib,代码行数:30,
示例4: csl_common_test_timer_i1CSL_CDECLstruct csl_common_timer_resultcsl_common_test_timer_i1( void (*test_function)(int), int param ){ struct csl_common_timer_result rs; struct timeval start; int loop = 2; int i = 0; size_t nl = 0; double ela = 0.0; gettimeofday( &start,NULL ); while( (ela = calc_elapsed(&start)) < MAX_SAMPLING_INTERVAL_MS ) { for( i=0;i<loop;++i ) { test_function(param); nl++; } loop *= 2; } rs.n_loops = nl; rs.total_ms = ela; rs.ms_per_call = ela/(double)nl; rs.call_per_sec = nl*1000.0/ela; return rs;}
开发者ID:codesloop,项目名称:codesloop,代码行数:28,
示例5: mainintmain (){ test_function (u32_mbtouc); return 0;}
开发者ID:cooljeanius,项目名称:wget,代码行数:7,
示例6: test_wrap/* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) */inttest_wrap (char *test_name, int (*test_function) (FILE * test_fd, char *cipher_suite, int proto_version), FILE * test_fd, int daemon_flags, char *cipher_suite, int proto_version, ...){ int ret; va_list arg_list; struct MHD_Daemon *d; va_start (arg_list, proto_version); if (setup_testcase (&d, daemon_flags, arg_list) != 0) { va_end (arg_list); return -1; } fprintf (stdout, "running test: %s ", test_name); ret = test_function (test_fd, cipher_suite, proto_version); if (ret == 0) { fprintf (stdout, "[pass]/n"); } else { fprintf (stdout, "[fail]/n"); } teardown_testcase (d); va_end (arg_list); return ret;}
开发者ID:izenecloud,项目名称:icma,代码行数:34,
示例7: eat_cpupid_t eat_cpu(int (test_function)(void)){ union pipe read_pipe, write_pipe; int cpu, rc; pid_t pid; cpu = pick_online_cpu(); FAIL_IF(cpu < 0); FAIL_IF(bind_to_cpu(cpu)); if (pipe(read_pipe.fds) == -1) return -1; if (pipe(write_pipe.fds) == -1) return -1; pid = fork(); if (pid == 0) exit(eat_cpu_child(write_pipe, read_pipe)); if (sync_with_child(read_pipe, write_pipe)) { rc = -1; goto out; } printf("main test running as pid %d/n", getpid()); rc = test_function();out: kill(pid, SIGKILL); return rc;}
开发者ID:020gzh,项目名称:linux,代码行数:33,
示例8: run_tests/* * run_tests - Run series of tests. Return number of errors */static int run_tests(){ int i; int errors = 0; double points = 0.0; double max_points = 0.0; printf("Score/tRating/tErrors/tFunction/n"); for (i = 0; test_set[i].solution_funct; i++) { int terrors; double tscore; double tpoints; if (!test_fname || strcmp(test_set[i].name,test_fname) == 0) { int rating = global_rating ? global_rating : test_set[i].rating; terrors = test_function(&test_set[i]); errors += terrors; tscore = terrors == 0 ? 1.0 : 0.0; tpoints = rating * tscore; points += tpoints; max_points += rating; if (grade || terrors < 1) printf(" %.0f/t%d/t%d/t%s/n", tpoints, rating, terrors, test_set[i].name); } } printf("Total points: %.0f/%.0f/n", points, max_points); return errors;}
开发者ID:DevilPandaKnight,项目名称:CS-33,代码行数:35,
示例9: test_wrap/* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) */inttest_wrap (const char *test_name, int (*test_function) (void * cls, const char *cipher_suite, int proto_version), void * cls, int daemon_flags, const char *cipher_suite, int proto_version, ...){ int ret; va_list arg_list; struct MHD_Daemon *d; va_start (arg_list, proto_version); if (setup_testcase (&d, daemon_flags, arg_list) != 0) { va_end (arg_list); fprintf (stderr, "Failed to setup testcase %s/n", test_name); return -1; }#if 0 fprintf (stdout, "running test: %s ", test_name);#endif ret = test_function (NULL, cipher_suite, proto_version);#if 0 if (ret == 0) { fprintf (stdout, "[pass]/n"); } else { fprintf (stdout, "[fail]/n"); }#endif teardown_testcase (d); va_end (arg_list); return ret;}
开发者ID:Chris112,项目名称:sep,代码行数:36,
示例10: ACE_TMAINintACE_TMAIN (int, ACE_TCHAR *[]){ int failure_count = 0; test_class my_test_class; // Tet out the export of a class. I don't see // How this can fail at runtime (rather it would // probably give link errors), but just in case... cout << "Method Test: "; if (my_test_class.method () != RETVAL) { cout << "Failed" << endl; ++failure_count; } else cout << "Succeeded" << endl; // Test out the export of a function. Like above, // I don't know how this can fail at runtime. cout << "Function Test: "; if (test_function () != RETVAL) { cout << "Failed" << endl; ++failure_count; } else cout << "Succeeded" << endl; // Also test out the export of data. cout << "Variable Test: "; if (test_variable != RETVAL) { cout << "Failed" << endl; ++failure_count; } else cout << "Succeeded" << endl; // Test out the ACE_Singleton export by checking to see // that we have the same instance pointer as the DLL does. // This can fail at runtime. cout << "Singleton Test: "; if (TEST_SINGLETON::instance () != get_dll_singleton ()) { cout << "Failed" << endl; ++failure_count; } else cout << "Succeeded" << endl; // Return the number of failures return failure_count;}
开发者ID:asdlei00,项目名称:ACE,代码行数:59,
示例11: mainint main( void ){ double dbl; dbl = -1.0; if( test_function( &dbl ) ) fail( __LINE__ ); _PASS;}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:8,
示例12: reset void reset() { simVars.timecontrol.current_timestep_nr = 0; prog_h.physical_set_all(test_function(time_test_function_order, 0)); prog_u.physical_set_all(0); prog_v.physical_set_all(0); }
开发者ID:schreiberx,项目名称:sweet,代码行数:8,
示例13: mainint main(int argc, char *argv[]){ zf_log_set_output_v(ZF_LOG_PUT_STD, 0, mock_output_callback); TEST_RUNNER_CREATE(argc, argv); TEST_EXECUTE(test_function()); return TEST_RUNNER_EXIT_CODE();}
开发者ID:alring,项目名称:zf_log,代码行数:8,
示例14: mainintmain (int argc, char *argv[]){ set_program_name (argv[0]); test_function (xprintf); return 0;}
开发者ID:nguyenquocbinh,项目名称:klee-examples,代码行数:8,
示例15: mainint main(){ int x = 10, y = 20, z = 30; z = test_function(x); printf("%d %d %d/n", x, y , z); return 0;}
开发者ID:akiltipu,项目名称:cpbook_subeen,代码行数:8,
示例16: mainintmain (int argc _GL_UNUSED, char *argv[]){ set_program_name (argv[0]); test_function (xfprintf); return 0;}
开发者ID:DavidChenLiang,项目名称:study,代码行数:8,
示例17: mainintmain (){ DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); /* Consider the current rounding mode, cf. <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/float.h.html> */ if (FLT_ROUNDS == 1) { /* The current rounding mode is round-to-nearest (the default in IEEE 754). */ /* Zero. */ ASSERT (rintl (0.0L) == 0.0L); ASSERT (rintl (minus_zerol) == 0.0L); /* Positive numbers. */ ASSERT (rintl (0.3L) == 0.0L); ASSERT (rintl (0.5L) == 0.0L); /* unlike roundl() */ ASSERT (rintl (0.7L) == 1.0L); ASSERT (rintl (1.0L) == 1.0L); ASSERT (rintl (1.5L) == 2.0L); ASSERT (rintl (1.999L) == 2.0L); ASSERT (rintl (2.0L) == 2.0L); ASSERT (rintl (2.1L) == 2.0L); ASSERT (rintl (2.5L) == 2.0L); /* unlike roundl() */ ASSERT (rintl (2.7L) == 3.0L); ASSERT (rintl (65535.999L) == 65536.0L); ASSERT (rintl (65536.0L) == 65536.0L); ASSERT (rintl (65536.001L) == 65536.0L); ASSERT (rintl (2.341e31L) == 2.341e31L); /* Negative numbers. */ ASSERT (rintl (-0.3L) == 0.0L); ASSERT (rintl (-0.5L) == 0.0L); /* unlike roundl() */ ASSERT (rintl (-0.7L) == -1.0L); ASSERT (rintl (-1.0L) == -1.0L); ASSERT (rintl (-1.5L) == -2.0L); ASSERT (rintl (-1.999L) == -2.0L); ASSERT (rintl (-2.0L) == -2.0L); ASSERT (rintl (-2.1L) == -2.0L); ASSERT (rintl (-2.5L) == -2.0L); /* unlike roundl() */ ASSERT (rintl (-2.7L) == -3.0L); ASSERT (rintl (-65535.999L) == -65536.0L); ASSERT (rintl (-65536.0L) == -65536.0L); ASSERT (rintl (-65536.001L) == -65536.0L); ASSERT (rintl (-2.341e31L) == -2.341e31L); test_function (); return 0; } else { fputs ("Skipping test: non-standard rounding mode/n", stderr); return 77; }}
开发者ID:ajnelson,项目名称:gnulib,代码行数:58,
示例18: gfx_engineint gfx_engine(){ test_function();// used for debug commands and stuff. draw_ui(); // draws the ui and compress all buffers down to the screen_buffer, so only one draw to the screen is made. draw_map();// draws the individual tiles that correspond to the tile numbers in the map array. blit (screen_buffer, screen, 0,0,0,0,1024,768); rectfill (screen_buffer, 0,0,1024,768,makecol(0,0,0)); return 0;}
开发者ID:SamPearson,项目名称:game-engine,代码行数:10,
示例19: mainint main(){ std::cout << "Running test that needs a library" << std::endl; if (test_function() != "Hello, world.") { std::cerr << "test_function didn't return as expected" << std::endl; return 1; } return 0;}
开发者ID:spb,项目名称:bs,代码行数:10,
示例20: mainintmain (){ DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); test_function (fmal); return 0;}
开发者ID:miyamuko,项目名称:git-merge-changelog-for-windows,代码行数:11,
示例21: mainintmain (){ /* A particular value. */ x = 0.6f; y = logf (x); ASSERT (y >= -0.5108257f && y <= -0.5108256f); test_function (); return 0;}
开发者ID:ajnelson,项目名称:gnulib,代码行数:12,
示例22: mainintmain (){ /* A particular value. */ x = 0.6f; y = sqrtf (x); ASSERT (y >= 0.7745966f && y <= 0.7745967f); test_function (); return 0;}
开发者ID:miyamuko,项目名称:git-merge-changelog-for-windows,代码行数:12,
示例23: mainintmain (){ /* A particular value. */ x = 0.6f; y = log1pf (x); ASSERT (y >= 0.4700036f && y <= 0.4700037f); test_function (); return 0;}
开发者ID:Chainfire,项目名称:android-ndk-compression-tools,代码行数:12,
示例24: memory_leak_checkstatic void memory_leak_check() { unsigned int memory_used; mcheck_pedantic(NULL); memory_used= mallinfo().uordblks; test_function(); memory_used= mallinfo().uordblks - memory_used; if (memory_used != 0) printf("Memory leak detected (%d bytes)/n", memory_used); else printf("No memory leak detected./n");}
开发者ID:Jornason,项目名称:Class-Projects,代码行数:12,
示例25: mainintmain (){ /* A particular value. */ x = 0.6; y = expm1 (x); ASSERT (y >= 0.822118800 && y <= 0.822118801); test_function (); return 0;}
开发者ID:Chainfire,项目名称:android-ndk-compression-tools,代码行数:12,
示例26: mainintmain (){ /* A particular value. */ x = 0.6; y = log2 (x); ASSERT (y >= -0.7369655942 && y <= -0.7369655941); test_function (); return 0;}
开发者ID:cooljeanius,项目名称:wget,代码行数:12,
示例27: picUnit_run_testuint8_t picUnit_run_test(uint8_t (*test_function)(), uint8_t * noOfTestsRun_p, uint8_t testResults[]){ if(PICUNIT_TEST_FAILED == test_function()) { picUnit_report_test_failed(noOfTestsRun_p, testResults); } else { picUnit_report_test_passed(noOfTestsRun_p, testResults); } return 0;}
开发者ID:jmossberg,项目名称:picUnit,代码行数:12,
示例28: mainintmain (){ /* A particular value. */ x = 0.6; y = sqrt (x); ASSERT (y >= 0.7745966692 && y <= 0.7745966693); test_function (); return 0;}
开发者ID:Distrotech,项目名称:gnulib,代码行数:12,
示例29: mainintmain (){ /* A particular value. */ x = 0.6; y = log (x); ASSERT (y >= -0.5108256238 && y <= -0.5108256237); test_function (); return 0;}
开发者ID:Distrotech,项目名称:gnulib,代码行数:12,
注:本文中的test_function函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ test_generic函数代码示例 C++ test_filter函数代码示例 |