Esempio n. 1
0
static bool test_lp_parm_double(struct torture_context *tctx)
{
	struct loadparm_context *lp_ctx = loadparm_init(tctx);
	torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=3.4"), "lpcfg_set_option failed");
	torture_assert(tctx, lpcfg_parm_double(lp_ctx, NULL, "some", "thing", 2.0) == 3.4,
				 "invalid parametric option");
	torture_assert(tctx, lpcfg_parm_double(lp_ctx, NULL, "some", "bla", 2.0) == 2.0,
				 "invalid parametric option");
	return true;
}
Esempio n. 2
0
double torture_setting_double(struct torture_context *test, const char *name,
                              double default_value)
{
    return lpcfg_parm_double(test->lp_ctx, NULL, "torture", name, default_value);
}