svn commit: samba r26349 - in branches/SAMBA_4_0: . source/param source/param/tests

jelmer at samba.org jelmer at samba.org
Sat Dec 8 23:32:24 GMT 2007


Author: jelmer
Date: 2007-12-08 23:32:23 +0000 (Sat, 08 Dec 2007)
New Revision: 26349

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26349

Log:
More tests.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/param/loadparm.c
   branches/SAMBA_4_0/source/param/tests/loadparm.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c	2007-12-08 23:32:18 UTC (rev 26348)
+++ branches/SAMBA_4_0/source/param/loadparm.c	2007-12-08 23:32:23 UTC (rev 26349)
@@ -1187,10 +1187,10 @@
 	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)
 {
@@ -1213,7 +1213,7 @@
 }
 
 
-/*
+/**
   return the parameter structure for a parameter
 */
 struct parm_struct *lp_parm_struct(const char *name)
@@ -1223,7 +1223,7 @@
 	return &parm_table[parmnum];
 }
 
-/*
+/**
   return the parameter pointer for a parameter
 */
 void *lp_parm_ptr(struct loadparm_context *lp_ctx,
@@ -1348,11 +1348,10 @@
 	}
 }
 
-/***************************************************************************
-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;
@@ -1429,7 +1428,6 @@
 /*******************************************************************
  Check if a config file has changed date.
 ********************************************************************/
-
 bool lp_file_list_changed(struct loadparm_context *lp_ctx)
 {
 	struct file_lists *f;

Modified: branches/SAMBA_4_0/source/param/tests/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/tests/loadparm.c	2007-12-08 23:32:18 UTC (rev 26348)
+++ branches/SAMBA_4_0/source/param/tests/loadparm.c	2007-12-08 23:32:23 UTC (rev 26349)
@@ -97,6 +97,17 @@
 	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");
@@ -109,6 +120,7 @@
 	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;
 }



More information about the samba-cvs mailing list