• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ plan函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中plan函数的典型用法代码示例。如果您正苦于以下问题:C++ plan函数的具体用法?C++ plan怎么用?C++ plan使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了plan函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main (int argc, char *argv[])
{
    flux_msg_t *msg;
    flux_t h;
    flux_reactor_t *reactor;

    plan (35);

    (void)setenv ("FLUX_CONNECTOR_PATH", CONNECTOR_PATH, 0);
    ok ((h = flux_open ("loop://", FLUX_O_COPROC)) != NULL,
        "opened loop connector");
    if (!h)
        BAIL_OUT ("can't continue without loop handle");
    ok ((reactor = flux_get_reactor (h)) != NULL,
        "obtained reactor");
    if (!reactor)
        BAIL_OUT ("can't continue without reactor");

    flux_fatal_set (h, fatal_err, NULL);
    flux_fatal_error (h, __FUNCTION__, "Foo");
    ok (fatal_tested == true,
        "flux_fatal function is called on fatal error");

    /* create nodeset for last _then test */
    ok ((then_ns = nodeset_create ()) != NULL,
        "nodeset created ok");

    ok (flux_msghandler_addvec (h, htab, htablen, NULL) == 0,
        "registered message handlers");
    /* test continues in rpctest_begin_cb() so that rpc calls
     * can sleep while we answer them
     */
    ok ((msg = flux_request_encode ("rpctest.begin", NULL)) != NULL
        && flux_send (h, msg, 0) == 0,
        "sent message to initiate test");
    ok (flux_reactor_run (reactor, 0) == 0,
        "reactor completed normally");
    flux_msg_destroy (msg);

    /* Check result of last _then test */
    ok (nodeset_count (then_ns) == 128,
        "then callback worked with correct nodemap");
    nodeset_destroy (then_ns);
    flux_rpc_destroy (then_r);

    flux_close (h);

    done_testing();
    return (0);
}
开发者ID:surajpkn,项目名称:flux-core,代码行数:50,代码来源:multrpc.c


示例2: ACE_TMAIN

int ACE_TMAIN (int argc, ACE_TCHAR * argv[])
{
    try
    {
        if (argc < 1)
        {
            ACE_ERROR ((LM_ERROR, ACE_TEXT ("Incorrect count of arguments. Path to deployment plan has not been specified.\n")));
            return 1;
        }
        //parsing plan
        DAnCE::Config_Handlers::XML_File_Intf file (argv[1]);
        file.add_search_path (ACE_TEXT ("DANCE_ROOT"), ACE_TEXT ("/docs/schema/"));
        file.add_search_path (ACE_TEXT ("CIAO_ROOT"), ACE_TEXT ("/docs/schema/"));
        file.add_search_path (ACE_TEXT ("TAO_ROOT"), ACE_TEXT ("/docs/schema/"));
        auto_ptr<Deployment::DeploymentPlan>  plan (file.release_plan());

        //check instance references to corresponding implementations
        for ( ::CORBA::ULong i = 0; i < plan->instance.length(); i++)
        {
            if (plan->instance[i].implementationRef > plan->implementation.length() - 1)
            {
                ACE_ERROR ((LM_ERROR,
                            ACE_TEXT ("incorrect implementationRef in instance %C.\n"), plan->instance[i].name.in()));
                return 1;
            }
        }

        //check artifact reference for implementations of Home objects
        for ( ::CORBA::ULong i = 0; i < plan->implementation.length(); i++)
        {
            if (plan->implementation[i].artifactRef.length() > 0)
            {
                if (plan->implementation[i].artifactRef[0] > plan->artifact.length() - 1)
                {
                    ACE_ERROR ((LM_ERROR,
                                ACE_TEXT ("incorrect artifactRef in the implementation %C.\n"), plan->implementation[i].name.in()));
                    return 1;
                }
            }
        }
    }
    catch (...)
    {
        ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception")));
        return 1;
    }

    return 0;
}
开发者ID:svn2github,项目名称:ACE-Middleware,代码行数:49,代码来源:test.cpp


示例3: main

int
main(int argc, char **argv)
{
    afstest_SkipTestsIfBadHostname();

    plan(113);

    test_edges();
    test_no_config_files();
    test_with_config_files();
    test_update_config_files();
    test_set_local_realms(); /* must be the last test */

    return 0;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:15,代码来源:realms-t.c


示例4: main

int
main(void)
{
    struct opr_rbtree head;

    plan(3);

    opr_rbtree_init(&head);
    ok(1, "Initialising the tree works");

    ok(createTree(&head), "Creating tree with 1000 nodes works");
    ok(destroyTree(&head), "Tree retains consistency as nodes deleted");

    return 0;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:15,代码来源:rbtree-t.c


示例5: main

int main () {
    setvbuf(stdout, NULL, _IONBF, 0);
    plan(6);
    todo();
    ok(0, "foo");
    ok(1, "bar");
    ok(1, "baz");
    endtodo;
    todo("im not ready");
    ok(0, "quux");
    ok(1, "thud");
    ok(1, "wombat");
    endtodo;
    done_testing();
}
开发者ID:ImmobilienScout24,项目名称:icinga-core,代码行数:15,代码来源:todo.c


示例6: main

int main (int argc, char *argv[])
{
    struct queue *queue;

    plan (NO_PLAN);

    if (!(queue = queue_create (true)))
        BAIL_OUT ("queue_create() failed");

    single_job_check (queue);
    multi_job_check (queue);

    queue_destroy (queue);
    done_testing ();
}
开发者ID:flux-framework,项目名称:flux-core,代码行数:15,代码来源:submit.c


示例7: main

int main () {
    setvbuf(stdout, NULL, _IONBF, 0);
    plan(6);
    todo();
    ok(0, "foo");
    ok(1, "bar");
    ok(1, "baz");
    endtodo;
    todo("im not ready");
    ok(0, "quux");
    ok(1, "thud");
    ok(1, "wombat");
    endtodo;
    return exit_status();
}
开发者ID:e-user,项目名称:libtap,代码行数:15,代码来源:todo.c


示例8: main

int main()
{
  plan(4);
  ok(1, NULL);
  ok(1, NULL);
  /*
    Tests in the todo region is expected to fail. If they don't,
    something is strange.
  */
  todo_start("Need to fix these");
  ok(0, NULL);
  ok(0, NULL);
  todo_end();
  return exit_status();
}
开发者ID:0x-ff,项目名称:libmysql-android,代码行数:15,代码来源:todo-t.c


示例9: main

int main(
    int argc, char **argv, char **env
) {
    plan(13);

    test_error_jump();
    /* test_error2() has been deprecated */
    test_error_macros();
    test_error_object();
    test_hemp_throw();

    test_error_finally();

    return done();
}
开发者ID:abw,项目名称:hemp,代码行数:15,代码来源:error.c


示例10: compute_object

double			compute_object(t_ray ray, t_object object)
{
	double		len;

	len = 0;
	if (object.type == SPHERE)
		len = sphere(ray, object);
	else if (object.type == PLAN)
		len = plan(ray, object);
	else if (object.type == CYLINDER)
		len = cylinder(ray, object);
	else if (object.type == CONE)
		len = cone(ray, object);
	return (len);
}
开发者ID:mathieu74,项目名称:Source,代码行数:15,代码来源:compute.c


示例11: free_dps

void DivePlannerPointsModel::createTemporaryPlan()
{
	// Get the user-input and calculate the dive info
	free_dps(&diveplan);
	int lastIndex = -1;
	for (int i = 0; i < rowCount(); i++) {
		divedatapoint p = at(i);
		int deltaT = lastIndex != -1 ? p.time - at(lastIndex).time : p.time;
		lastIndex = i;
		if (i == 0 && prefs.drop_stone_mode) {
			/* Okay, we add a first segment where we go down to depth */
			plan_add_segment(&diveplan, p.depth / prefs.descrate, p.depth, p.cylinderid, p.setpoint, true);
			deltaT -= p.depth / prefs.descrate;
		}
		if (p.entered)
			plan_add_segment(&diveplan, deltaT, p.depth, p.cylinderid, p.setpoint, true);
	}

	// what does the cache do???
	char *cache = NULL;
	struct divedatapoint *dp = NULL;
	for (int i = 0; i < MAX_CYLINDERS; i++) {
		cylinder_t *cyl = &displayed_dive.cylinder[i];
		if (cyl->depth.mm) {
			dp = create_dp(0, cyl->depth.mm, i, 0);
			if (diveplan.dp) {
				dp->next = diveplan.dp;
				diveplan.dp = dp;
			} else {
				dp->next = NULL;
				diveplan.dp = dp;
			}
		}
	}
#if DEBUG_PLAN
	dump_plan(&diveplan);
#endif
	if (recalcQ() && !diveplan_empty(&diveplan)) {
		plan(&diveplan, &cache, isPlanner(), false);
		emit calculatedPlanNotes();
	}
	// throw away the cache
	free(cache);
#if DEBUG_PLAN
	save_dive(stderr, &displayed_dive);
	dump_plan(&diveplan);
#endif
}
开发者ID:ollie314,项目名称:subsurface,代码行数:48,代码来源:diveplannermodel.cpp


示例12: test_numbers

static int
test_numbers()
{
	plan(96);
	header();

	test_read_int32(uint, 123, true);
	test_read_int32(uint, 12345, true);
	test_read_int32(uint, 2147483647, true);
	test_read_int32(uint, 2147483648, false);
	test_read_int32(int, -123, true);
	test_read_int32(int, -12345, true);
	test_read_int32(int, -2147483648, true);
	test_read_int32(int, -2147483649LL, false);
	test_read_int32(float, -1e2, false);
	test_read_int32(double, 1.2345, false);
	test_read_int32(map, 5, false);

	test_read_int64(uint, 123, true);
	test_read_int64(uint, 12345, true);
	test_read_int64(uint, 123456789, true);
	test_read_int64(uint, 9223372036854775807ULL, true);
	test_read_int64(uint, 9223372036854775808ULL, false);
	test_read_int64(int, -123, true);
	test_read_int64(int, -12345, true);
	test_read_int64(int, -123456789, true);
	test_read_int64(int, -9223372036854775807LL, true);
	test_read_int64(float, 100, false);
	test_read_int64(double, -5.4321, false);
	test_read_int64(array, 10, false);

	test_read_double(uint, 123, true);
	test_read_double(uint, 12345, true);
	test_read_double(uint, 123456789, true);
	test_read_double(uint, 1234567890000ULL, true);
	test_read_double(uint, 123456789123456789ULL, false);
	test_read_double(int, -123, true);
	test_read_double(int, -12345, true);
	test_read_double(int, -123456789, true);
	test_read_double(int, -1234567890000LL, true);
	test_read_double(int, -123456789123456789LL, false);
	test_read_double(float, 6.565e6, true);
	test_read_double(double, -5.555, true);
	test_read_double(strl, 100, false);

	footer();
	return check_plan();
}
开发者ID:rtsisyk,项目名称:msgpuck,代码行数:48,代码来源:msgpuck.c


示例13: goalCallback

void goalCallback(const geometry_msgs::PointStamped::ConstPtr& msg){
	ROS_INFO_STREAM("goal update: "<< msg->point.x << "," << msg->point.y);
	if(planning)
		return;
	//update local goal
	goal.header.frame_id=msg->header.frame_id;
	goal.header.stamp=ros::Time(0);
	goal.point.x=msg->point.x;
	goal.point.y=msg->point.y;

	goalState[0]=goal.point.x;
	goalState[1]=goal.point.y;
	
	plan();
	sendWaypoint();
}
开发者ID:cecilialiu,项目名称:GT_mini_autonomous_car,代码行数:16,代码来源:planner.cpp


示例14: main

int main (int argc, char *argv[])
{

    plan (31);

    test_put (); // 3
    test_get (); // 8
    test_watch (); // 7
    test_unwatch (); // 2
    test_commit (); // 7
    test_getroot (); // 2
    test_setroot (); // 2

    done_testing();
    return (0);
}
开发者ID:surajpkn,项目名称:flux-core,代码行数:16,代码来源:proto.c


示例15: main

int main () {
    plan(9);

    MSpec opt1 = { .Opt = {
            .type = MOPT,
            .flags = 0,
            .possible = (MSpec[]) {
                {   .Char = {
                        .type = MCHAR,
                        .flags = 0,
                        .c = 'a'
                    }
                }
            }
        }
    };
开发者ID:quietfanatic,项目名称:ltm,代码行数:16,代码来源:MOpt.c


示例16: main

int main(void)
{
	plan(375);

	assignment();
	cmp();
	init_from_vector();
	init_from_angle_and_axe();
	times_quaternion();
	norm2();
	conjugate();
	to_matrix();
	to_angle_and_axe();

	return 0;
}
开发者ID:picca,项目名称:hkl,代码行数:16,代码来源:hkl-quaternion-t.c


示例17: do_tests

void do_tests()
{
  plan(49);

  ok(my_timer_init_ext() == 0, "my_timer_init_ext");

  test_create_and_delete();
  test_reset();
  test_timer();
  test_timer_reuse();
  test_independent_timers();
  test_concurrently("per-thread", test_timer_per_thread, THREADS, 5);
  test_reinitialization();

  my_timer_deinit();
}
开发者ID:0x00xw,项目名称:mysql-2,代码行数:16,代码来源:my_timer-t.c


示例18: test_doubles

static int
test_doubles(void)
{
	plan(27);
	header();

	test_double((double) 1.0,
		    "\xcb\x3f\xf0\x00\x00\x00\x00\x00\x00", 9);
	test_double((double) 3.141592653589793,
		    "\xcb\x40\x09\x21\xfb\x54\x44\x2d\x18", 9);
	test_double((double) -1e99,
		    "\xcb\xd4\x7d\x42\xae\xa2\x87\x9f\x2e", 9);

	footer();
	return check_plan();
}
开发者ID:rtsisyk,项目名称:msgpuck,代码行数:16,代码来源:msgpuck.c


示例19: transmit_message_callback

/**
 * Function called to get a message for transmission.
 *
 * @param cls closure
 * @param buf_size number of bytes available in buf
 * @param buf where to copy the message, NULL on error (peer disconnect)
 * @return number of bytes copied to 'buf', can be 0 (without indicating an error)
 */
static size_t
transmit_message_callback (void *cls, size_t buf_size, void *buf)
{
  struct PeerPlan *pp = cls;
  struct GSF_RequestPlan *rp;
  size_t msize;

  pp->pth = NULL;
  if (NULL == buf)
  {
    /* failed, try again... */
    pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
    GNUNET_STATISTICS_update (GSF_stats,
                              gettext_noop
                              ("# transmission failed (core has no bandwidth)"),
                              1, GNUNET_NO);
    return 0;
  }
  rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap);
  if (NULL == rp)
  {
    pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
    return 0;
  }
  msize = GSF_pending_request_get_message_ (get_latest (rp), buf_size, buf);
  if (msize > buf_size)
  {
    /* buffer to small (message changed), try again */
    pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
    return 0;
  }
  /* remove from root, add again elsewhere... */
  GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->priority_heap));
  rp->hn = NULL;
  rp->last_transmission = GNUNET_TIME_absolute_get ();
  rp->transmission_counter++;
  total_delay++;
  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Executing plan %p executed %u times, planning retransmission\n",
              rp, rp->transmission_counter);
  plan (pp, rp);
  GNUNET_STATISTICS_update (GSF_stats,
                            gettext_noop
                            ("# query messages sent to other peers"), 1,
                            GNUNET_NO);
  return msize;
}
开发者ID:schanzen,项目名称:gnunet-mirror,代码行数:55,代码来源:gnunet-service-fs_pe.c


示例20: main

int main(int argc, char *argv[])
{
	plan(12);

	typedef union {
		uint16_t value;
		uint8_t  array[2];
	} trafo16_t;

	const uint16_t host16 = 0x0102;
	const trafo16_t be16 = { .array = { 0x01, 0x02 } };
	const trafo16_t le16 = { .array = { 0x02, 0x01 } };
	ok(htobe16(host16) == be16.value, "htobe16");
	ok(htole16(host16) == le16.value, "htole16");
	ok(be16toh(be16.value) == host16, "be16toh");
	ok(le16toh(le16.value) == host16, "le16toh");

	typedef union {
		uint32_t value;
		uint8_t  array[4];
	} trafo32_t;

	const uint32_t host32 = 0x01020304;
	const trafo32_t be32 = { .array = { 0x01, 0x02, 0x03, 0x04 } };
	const trafo32_t le32 = { .array = { 0x04, 0x03, 0x02, 0x01 } };
	ok(htobe32(host32) == be32.value, "htobe32");
	ok(htole32(host32) == le32.value, "htole32");
	ok(be32toh(be32.value) == host32, "be32toh");
	ok(le32toh(le32.value) == host32, "le32toh");

	typedef union {
		uint64_t value;
		uint8_t  array[8];
	} trafo64_t;

	const uint64_t host64 = 0x0102030405060708;
	const trafo64_t be64 = { .array = { 0x01, 0x02, 0x03, 0x04,
	                                    0x05, 0x06, 0x07, 0x08 } };
	const trafo64_t le64 = { .array = { 0x08, 0x07, 0x06, 0x05,
	                                    0x04, 0x03, 0x02, 0x01 } };
	ok(htobe64(host64) == be64.value, "htobe64");
	ok(htole64(host64) == le64.value, "htole64");
	ok(be64toh(be64.value) == host64, "be64toh");
	ok(le64toh(le64.value) == host64, "le64toh");

	return 0;
}
开发者ID:idtek,项目名称:knot,代码行数:47,代码来源:endian.c



注:本文中的plan函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ plan_buffer_line函数代码示例发布时间:2022-05-30
下一篇:
C++ plainText函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap