return true;
}
-/***************************************************************************
- Map a parameter's string representation to something we can use.
- Returns False if the parameter string is not recognised, else TRUE.
-***************************************************************************/
+/**
+ * Map a parameter's string representation to something we can use.
+ * Returns False if the parameter string is not recognised, else TRUE.
+ */
static int map_parameter(const char *pszParmName)
{
}
-/*
+/**
return the parameter structure for a parameter
*/
struct parm_struct *lp_parm_struct(const char *name)
return &parm_table[parmnum];
}
-/*
+/**
return the parameter pointer for a parameter
*/
void *lp_parm_ptr(struct loadparm_context *lp_ctx,
}
}
-/***************************************************************************
-Check a service for consistency. Return False if the service is in any way
-incomplete or faulty, else True.
-***************************************************************************/
-
+/**
+ * Check a service for consistency. Return False if the service is in any way
+ * incomplete or faulty, else True.
+ */
static bool service_ok(struct loadparm_service *service)
{
bool bRetval;
/*******************************************************************
Check if a config file has changed date.
********************************************************************/
-
bool lp_file_list_changed(struct loadparm_context *lp_ctx)
{
struct file_lists *f;
return true;
}
+static bool test_lp_do_service_parameter(struct torture_context *tctx)
+{
+ struct loadparm_context *lp_ctx = loadparm_init(tctx);
+ struct loadparm_service *service = lp_add_service(lp_ctx, &sDefault, "foo");
+ torture_assert(tctx, lp_do_service_parameter(lp_ctx, service,
+ "some:thing", "foo"), "lp_set_option failed");
+ torture_assert_str_equal(tctx, lp_parm_string(lp_ctx, service, "some", "thing"), "foo",
+ "invalid parametric option");
+ return true;
+}
+
struct torture_suite *torture_local_loadparm(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite = torture_suite_create(mem_ctx, "LOADPARM");
torture_suite_add_simple_test(suite, "set_lp_parm_bool", test_lp_parm_bool);
torture_suite_add_simple_test(suite, "set_lp_parm_int", test_lp_parm_int);
torture_suite_add_simple_test(suite, "set_lp_parm_bytes", test_lp_parm_bytes);
+ torture_suite_add_simple_test(suite, "service_parameter", test_lp_do_service_parameter);
return suite;
}