当前位置: 首页>>代码示例>>C++>>正文


C++ plan函数代码示例

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


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


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