summaryrefslogtreecommitdiff
path: root/source4/param/tests
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-07-16 14:32:42 +1000
committerAndrew Tridgell <tridge@samba.org>2010-07-16 18:24:27 +1000
commit6b266b85cf34145ac1f03d8f787b81121e4ec92b (patch)
tree9f6faebdcf58c73e0297bfdf3b905ef256f8e478 /source4/param/tests
parente4c35c5a09dd66c9280caa39130b7e3b941b7e51 (diff)
downloadsamba-6b266b85cf34145ac1f03d8f787b81121e4ec92b.tar.gz
samba-6b266b85cf34145ac1f03d8f787b81121e4ec92b.tar.bz2
samba-6b266b85cf34145ac1f03d8f787b81121e4ec92b.zip
s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/param/tests')
-rw-r--r--source4/param/tests/loadparm.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/source4/param/tests/loadparm.c b/source4/param/tests/loadparm.c
index 49fcdf7249..2e44a29eed 100644
--- a/source4/param/tests/loadparm.c
+++ b/source4/param/tests/loadparm.c
@@ -32,26 +32,26 @@ static bool test_create(struct torture_context *tctx)
static bool test_set_option(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "workgroup=werkgroep"), "lp_set_option failed");
- torture_assert_str_equal(tctx, "WERKGROEP", lp_workgroup(lp_ctx), "workgroup");
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "workgroup=werkgroep"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, "WERKGROEP", lpcfg_workgroup(lp_ctx), "workgroup");
return true;
}
static bool test_set_cmdline(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_cmdline(lp_ctx, "workgroup", "werkgroep"), "lp_set_cmdline failed");
- torture_assert(tctx, lp_do_global_parameter(lp_ctx, "workgroup", "barbla"), "lp_set_option failed");
- torture_assert_str_equal(tctx, "WERKGROEP", lp_workgroup(lp_ctx), "workgroup");
+ torture_assert(tctx, lpcfg_set_cmdline(lp_ctx, "workgroup", "werkgroep"), "lpcfg_set_cmdline failed");
+ torture_assert(tctx, lpcfg_do_global_parameter(lp_ctx, "workgroup", "barbla"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, "WERKGROEP", lpcfg_workgroup(lp_ctx), "workgroup");
return true;
}
static bool test_do_global_parameter(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_do_global_parameter(lp_ctx, "workgroup", "werkgroep42"),
- "lp_set_cmdline failed");
- torture_assert_str_equal(tctx, lp_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
+ torture_assert(tctx, lpcfg_do_global_parameter(lp_ctx, "workgroup", "werkgroep42"),
+ "lpcfg_set_cmdline failed");
+ torture_assert_str_equal(tctx, lpcfg_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
return true;
}
@@ -59,9 +59,9 @@ static bool test_do_global_parameter(struct torture_context *tctx)
static bool test_do_global_parameter_var(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_do_global_parameter_var(lp_ctx, "workgroup", "werk%s%d", "groep", 42),
- "lp_set_cmdline failed");
- torture_assert_str_equal(tctx, lp_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
+ torture_assert(tctx, lpcfg_do_global_parameter_var(lp_ctx, "workgroup", "werk%s%d", "groep", 42),
+ "lpcfg_set_cmdline failed");
+ torture_assert_str_equal(tctx, lpcfg_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
return true;
}
@@ -69,15 +69,15 @@ static bool test_do_global_parameter_var(struct torture_context *tctx)
static bool test_set_option_invalid(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, !lp_set_option(lp_ctx, "workgroup"), "lp_set_option succeeded");
+ torture_assert(tctx, !lpcfg_set_option(lp_ctx, "workgroup"), "lpcfg_set_option succeeded");
return true;
}
static bool test_set_option_parametric(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=blaat"), "lp_set_option failed");
- torture_assert_str_equal(tctx, lp_parm_string(lp_ctx, NULL, "some", "thing"), "blaat",
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=blaat"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, lpcfg_parm_string(lp_ctx, NULL, "some", "thing"), "blaat",
"invalid parametric option");
return true;
}
@@ -85,10 +85,10 @@ static bool test_set_option_parametric(struct torture_context *tctx)
static bool test_lp_parm_double(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=3.4"), "lp_set_option failed");
- torture_assert(tctx, lp_parm_double(lp_ctx, NULL, "some", "thing", 2.0) == 3.4,
+ 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, lp_parm_double(lp_ctx, NULL, "some", "bla", 2.0) == 2.0,
+ torture_assert(tctx, lpcfg_parm_double(lp_ctx, NULL, "some", "bla", 2.0) == 2.0,
"invalid parametric option");
return true;
}
@@ -96,10 +96,10 @@ static bool test_lp_parm_double(struct torture_context *tctx)
static bool test_lp_parm_bool(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=true"), "lp_set_option failed");
- torture_assert(tctx, lp_parm_bool(lp_ctx, NULL, "some", "thing", false) == true,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=true"), "lpcfg_set_option failed");
+ torture_assert(tctx, lpcfg_parm_bool(lp_ctx, NULL, "some", "thing", false) == true,
"invalid parametric option");
- torture_assert(tctx, lp_parm_bool(lp_ctx, NULL, "some", "bla", true) == true,
+ torture_assert(tctx, lpcfg_parm_bool(lp_ctx, NULL, "some", "bla", true) == true,
"invalid parametric option");
return true;
}
@@ -107,10 +107,10 @@ static bool test_lp_parm_bool(struct torture_context *tctx)
static bool test_lp_parm_int(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=34"), "lp_set_option failed");
- torture_assert_int_equal(tctx, lp_parm_int(lp_ctx, NULL, "some", "thing", 20), 34,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=34"), "lpcfg_set_option failed");
+ torture_assert_int_equal(tctx, lpcfg_parm_int(lp_ctx, NULL, "some", "thing", 20), 34,
"invalid parametric option");
- torture_assert_int_equal(tctx, lp_parm_int(lp_ctx, NULL, "some", "bla", 42), 42,
+ torture_assert_int_equal(tctx, lpcfg_parm_int(lp_ctx, NULL, "some", "bla", 42), 42,
"invalid parametric option");
return true;
}
@@ -118,10 +118,10 @@ static bool test_lp_parm_int(struct torture_context *tctx)
static bool test_lp_parm_bytes(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=16K"), "lp_set_option failed");
- torture_assert_int_equal(tctx, lp_parm_bytes(lp_ctx, NULL, "some", "thing", 20), 16 * 1024,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=16K"), "lpcfg_set_option failed");
+ torture_assert_int_equal(tctx, lpcfg_parm_bytes(lp_ctx, NULL, "some", "thing", 20), 16 * 1024,
"invalid parametric option");
- torture_assert_int_equal(tctx, lp_parm_bytes(lp_ctx, NULL, "some", "bla", 42), 42,
+ torture_assert_int_equal(tctx, lpcfg_parm_bytes(lp_ctx, NULL, "some", "bla", 42), 42,
"invalid parametric option");
return true;
}
@@ -129,10 +129,10 @@ static bool test_lp_parm_bytes(struct torture_context *tctx)
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, lp_default_service(lp_ctx), "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",
+ struct loadparm_service *service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), "foo");
+ torture_assert(tctx, lpcfg_do_service_parameter(lp_ctx, service,
+ "some:thing", "foo"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, lpcfg_parm_string(lp_ctx, service, "some", "thing"), "foo",
"invalid parametric option");
return true;
}
@@ -140,8 +140,8 @@ static bool test_lp_do_service_parameter(struct torture_context *tctx)
static bool test_lp_service(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- struct loadparm_service *service = lp_add_service(lp_ctx, lp_default_service(lp_ctx), "foo");
- torture_assert(tctx, service == lp_service(lp_ctx, "foo"), "invalid service");
+ struct loadparm_service *service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), "foo");
+ torture_assert(tctx, service == lpcfg_service(lp_ctx, "foo"), "invalid service");
return true;
}
@@ -159,7 +159,7 @@ struct torture_suite *torture_local_loadparm(TALLOC_CTX *mem_ctx)
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);
- torture_suite_add_simple_test(suite, "lp_service", test_lp_service);
+ torture_suite_add_simple_test(suite, "lpcfg_service", test_lp_service);
torture_suite_add_simple_test(suite, "do_global_parameter_var", test_do_global_parameter_var);
torture_suite_add_simple_test(suite, "do_global_parameter", test_do_global_parameter);