From bbdb8384220f3fa51ded65d89fdab0496ad3da25 Mon Sep 17 00:00:00 2001
From: Kamen Mazdrashki <kamenim@samba.org>
Date: Tue, 25 May 2010 17:24:45 +0300
Subject: s4/test: rename enum test_fields{} member names to be more
 descriptive

---
 source4/torture/libnet/libnet_user.c | 34 +++++++++++++++++-----------------
 source4/torture/libnet/userman.c     | 16 ++++++++--------
 source4/torture/libnet/usertest.h    |  7 ++++---
 3 files changed, 29 insertions(+), 28 deletions(-)

(limited to 'source4/torture/libnet')

diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c
index 03e460fcf59..b7d78fed5b3 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -365,7 +365,7 @@ static void set_test_changes(struct torture_context *tctx,
 		gettimeofday(&now, NULL);
 
 		switch (testfld) {
-		case account_name:
+		case acct_name:
 			continue_if_field_set(r->in.account_name);
 			r->in.account_name = talloc_asprintf(mem_ctx, TEST_CHG_ACCOUNTNAME,
 							     (int)(random() % 100));
@@ -375,49 +375,49 @@ static void set_test_changes(struct torture_context *tctx,
 			*user_name = talloc_strdup(mem_ctx, r->in.account_name);
 			break;
 
-		case full_name:
+		case acct_full_name:
 			continue_if_field_set(r->in.full_name);
 			r->in.full_name = talloc_asprintf(mem_ctx, TEST_CHG_FULLNAME,
 							  (unsigned int)random(), (unsigned int)random());
 			fldname = "full_name";
 			break;
 
-		case description:
+		case acct_description:
 			continue_if_field_set(r->in.description);
 			r->in.description = talloc_asprintf(mem_ctx, TEST_CHG_DESCRIPTION,
 							    (long)random());
 			fldname = "description";
 			break;
 
-		case home_directory:
+		case acct_home_directory:
 			continue_if_field_set(r->in.home_directory);
 			homedir = home_dirs[random() % ARRAY_SIZE(home_dirs)];
 			r->in.home_directory = talloc_strdup(mem_ctx, homedir);
 			fldname = "home_dir";
 			break;
 
-		case home_drive:
+		case acct_home_drive:
 			continue_if_field_set(r->in.home_drive);
 			homedrive = home_drives[random() % ARRAY_SIZE(home_drives)];
 			r->in.home_drive = talloc_strdup(mem_ctx, homedrive);
 			fldname = "home_drive";
 			break;
 
-		case comment:
+		case acct_comment:
 			continue_if_field_set(r->in.comment);
 			r->in.comment = talloc_asprintf(mem_ctx, TEST_CHG_COMMENT,
 							(unsigned long)random(), (unsigned long)random());
 			fldname = "comment";
 			break;
 
-		case logon_script:
+		case acct_logon_script:
 			continue_if_field_set(r->in.logon_script);
 			logonscript = logon_scripts[random() % ARRAY_SIZE(logon_scripts)];
 			r->in.logon_script = talloc_strdup(mem_ctx, logonscript);
 			fldname = "logon_script";
 			break;
 
-		case profile_path:
+		case acct_profile_path:
 			continue_if_field_set(r->in.profile_path);
 			r->in.profile_path = talloc_asprintf(mem_ctx, TEST_CHG_PROFILEPATH,
 							     (unsigned long)random(), (unsigned int)random());
@@ -551,21 +551,21 @@ bool torture_modifyuser(struct torture_context *torture)
 		}
 
 		switch (fld) {
-		case account_name: TEST_STR_FLD(account_name);
+		case acct_name: TEST_STR_FLD(account_name);
 			break;
-		case full_name: TEST_STR_FLD(full_name);
+		case acct_full_name: TEST_STR_FLD(full_name);
 			break;
-		case comment: TEST_STR_FLD(comment);
+		case acct_comment: TEST_STR_FLD(comment);
 			break;
-		case description: TEST_STR_FLD(description);
+		case acct_description: TEST_STR_FLD(description);
 			break;
-		case home_directory: TEST_STR_FLD(home_directory);
+		case acct_home_directory: TEST_STR_FLD(home_directory);
 			break;
-		case home_drive: TEST_STR_FLD(home_drive);
+		case acct_home_drive: TEST_STR_FLD(home_drive);
 			break;
-		case logon_script: TEST_STR_FLD(logon_script);
+		case acct_logon_script: TEST_STR_FLD(logon_script);
 			break;
-		case profile_path: TEST_STR_FLD(profile_path);
+		case acct_profile_path: TEST_STR_FLD(profile_path);
 			break;
 		case acct_expiry: TEST_TIME_FLD(acct_expiry);
 			break;
@@ -575,7 +575,7 @@ bool torture_modifyuser(struct torture_context *torture)
 			break;
 		}
 
-		if (fld == account_name) {
+		if (fld == acct_name) {
 			/* restore original testing username - it's useful when test fails
 			   because it prevents from problems with recreating account */
 			ZERO_STRUCT(req);
diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c
index c67f133356c..b1699cf4e70 100644
--- a/source4/torture/libnet/userman.c
+++ b/source4/torture/libnet/userman.c
@@ -118,7 +118,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 		gettimeofday(&now, NULL);
 
 		switch (testfld) {
-		case account_name:
+		case acct_name:
 			continue_if_field_set(mod->in.change.account_name);
 			mod->in.change.account_name = talloc_asprintf(mem_ctx, TEST_CHG_ACCOUNTNAME,
 								      (int)(random() % 100));
@@ -127,7 +127,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 			*username = talloc_strdup(mem_ctx, mod->in.change.account_name);
 			break;
 
-		case full_name:
+		case acct_full_name:
 			continue_if_field_set(mod->in.change.full_name);
 			mod->in.change.full_name = talloc_asprintf(mem_ctx, TEST_CHG_FULLNAME,
 								  (int)random(), (int)random());
@@ -135,7 +135,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 			fldname = "full_name";
 			break;
 
-		case description:
+		case acct_description:
 			continue_if_field_set(mod->in.change.description);
 			mod->in.change.description = talloc_asprintf(mem_ctx, TEST_CHG_DESCRIPTION,
 								    random());
@@ -143,7 +143,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 			fldname = "description";
 			break;
 
-		case home_directory:
+		case acct_home_directory:
 			continue_if_field_set(mod->in.change.home_directory);
 			homedir = home_dirs[random() % (sizeof(home_dirs)/sizeof(char*))];
 			mod->in.change.home_directory = talloc_strdup(mem_ctx, homedir);
@@ -151,7 +151,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 			fldname = "home_directory";
 			break;
 
-		case home_drive:
+		case acct_home_drive:
 			continue_if_field_set(mod->in.change.home_drive);
 			homedrive = home_drives[random() % (sizeof(home_drives)/sizeof(char*))];
 			mod->in.change.home_drive = talloc_strdup(mem_ctx, homedrive);
@@ -159,7 +159,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 			fldname = "home_drive";
 			break;
 
-		case comment:
+		case acct_comment:
 			continue_if_field_set(mod->in.change.comment);
 			mod->in.change.comment = talloc_asprintf(mem_ctx, TEST_CHG_COMMENT,
 								random(), random());
@@ -167,7 +167,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 			fldname = "comment";
 			break;
 
-		case logon_script:
+		case acct_logon_script:
 			continue_if_field_set(mod->in.change.logon_script);
 			logonscript = logon_scripts[random() % (sizeof(logon_scripts)/sizeof(char*))];
 			mod->in.change.logon_script = talloc_strdup(mem_ctx, logonscript);
@@ -175,7 +175,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
 			fldname = "logon_script";
 			break;
 
-		case profile_path:
+		case acct_profile_path:
 			continue_if_field_set(mod->in.change.profile_path);
 			mod->in.change.profile_path = talloc_asprintf(mem_ctx, TEST_CHG_PROFILEPATH,
 								     (long int)random(), (unsigned int)random());
diff --git a/source4/torture/libnet/usertest.h b/source4/torture/libnet/usertest.h
index aecec538dd6..b3b2dc1bd2e 100644
--- a/source4/torture/libnet/usertest.h
+++ b/source4/torture/libnet/usertest.h
@@ -26,12 +26,13 @@
 	}
 
 
-#define USER_FIELD_FIRST	account_name
+#define USER_FIELD_FIRST	acct_name
 #define USER_FIELD_LAST 	acct_flags
 
 enum test_fields { none = 0,
-		   account_name, full_name, description, home_directory, home_drive,
-		   comment, logon_script, profile_path, acct_expiry, acct_flags };
+		   acct_name, acct_full_name, acct_description,
+		   acct_home_directory, acct_home_drive, acct_comment,
+		   acct_logon_script, acct_profile_path, acct_expiry, acct_flags };
 
 
 #define TEST_CHG_ACCOUNTNAME   "newlibnetusertest%02d"
-- 
cgit v1.2.1