[Tools 1/2] testbot/lib: Simplify the @PropertyDescriptors array initializations.

Francois Gouget fgouget at codeweavers.com
Thu Aug 30 09:27:55 CDT 2012


---
 testbot/lib/WineTestBot/Branches.pm         |    8 ++---
 testbot/lib/WineTestBot/CGI/Sessions.pm     |   11 +++----
 testbot/lib/WineTestBot/Jobs.pm             |   35 ++++++++-------------
 testbot/lib/WineTestBot/Patches.pm          |   23 ++++++--------
 testbot/lib/WineTestBot/PendingPatchSets.pm |   11 +++----
 testbot/lib/WineTestBot/PendingPatches.pm   |    8 ++---
 testbot/lib/WineTestBot/Roles.pm            |    8 ++---
 testbot/lib/WineTestBot/Steps.pm            |   29 +++++++----------
 testbot/lib/WineTestBot/StepsTasks.pm       |   45 ++++++++++-----------------
 testbot/lib/WineTestBot/Tasks.pm            |   29 +++++++----------
 testbot/lib/WineTestBot/UserRoles.pm        |    5 +--
 testbot/lib/WineTestBot/Users.pm            |   24 ++++++--------
 testbot/lib/WineTestBot/VMs.pm              |   32 +++++++------------
 testbot/web/Feedback.pl                     |    9 +++---
 testbot/web/ForgotPassword.pl               |    5 +--
 testbot/web/Login.pl                        |    9 +++---
 testbot/web/ResetPassword.pl                |   11 ++++---
 testbot/web/Submit.pl                       |   18 ++++++-----
 18 files changed, 135 insertions(+), 185 deletions(-)

diff --git a/testbot/lib/WineTestBot/Branches.pm b/testbot/lib/WineTestBot/Branches.pm
index 8a13c07..50182d4 100644
--- a/testbot/lib/WineTestBot/Branches.pm
+++ b/testbot/lib/WineTestBot/Branches.pm
@@ -71,10 +71,10 @@ sub GetDefaultBranch
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Name",      "Branch name",          1,  1, "A", 20);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("IsDefault", "Default branch",       !1,  1, "B",  1);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name",      "Branch name",          1,  1, "A", 20),
+    CreateBasicPropertyDescriptor("IsDefault", "Default branch",       !1,  1, "B",  1),
+  );
 }
 
 sub MultipleBranchesPresent()
diff --git a/testbot/lib/WineTestBot/CGI/Sessions.pm b/testbot/lib/WineTestBot/CGI/Sessions.pm
index d938deb..cd423bf 100644
--- a/testbot/lib/WineTestBot/CGI/Sessions.pm
+++ b/testbot/lib/WineTestBot/CGI/Sessions.pm
@@ -61,12 +61,11 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Id",        "Session id",         1,  1, "A", 32);
-  $PropertyDescriptors[1] =
-    CreateItemrefPropertyDescriptor("User",    "User",              !1,  1, \&CreateUsers, ["UserName"]);
-  $PropertyDescriptors[2] =
-    CreateBasicPropertyDescriptor("Permanent", "Permanent session", !1,  1, "B",  1);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Id",        "Session id",         1,  1, "A", 32),
+    CreateItemrefPropertyDescriptor("User",    "User",              !1,  1, \&CreateUsers, ["UserName"]),
+    CreateBasicPropertyDescriptor("Permanent", "Permanent session", !1,  1, "B",  1),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index 0a9701e..98d3510 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -293,28 +293,19 @@ my @PropertyDescriptors;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Id", "Job id", 1, 1, "S",  5);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("Archived", "Job is archived", !1, 1, "B", 1);
-  $PropertyDescriptors[2] =
-    CreateItemrefPropertyDescriptor("Branch", "Branch", !1, 1, \&CreateBranches, ["BranchName"]);
-  $PropertyDescriptors[3] =
-    CreateItemrefPropertyDescriptor("User", "Author", !1, 1, \&WineTestBot::Users::CreateUsers, ["UserName"]);
-  $PropertyDescriptors[4] =
-    CreateBasicPropertyDescriptor("Priority", "Priority", !1, 1, "N", 1);
-  $PropertyDescriptors[5] =
-    CreateBasicPropertyDescriptor("Status", "Status", !1, 1, "A", 9);
-  $PropertyDescriptors[6] =
-    CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, !1, "A", 50);
-  $PropertyDescriptors[7] =
-    CreateBasicPropertyDescriptor("Submitted", "Submitted", !1, !1, "DT", 19);
-  $PropertyDescriptors[8] =
-    CreateBasicPropertyDescriptor("Ended", "Ended", !1, !1, "DT", 50);
-  $PropertyDescriptors[9] =
-    CreateItemrefPropertyDescriptor("Patch", "Submitted from patch", !1, !1, \&WineTestBot::Patches::CreatePatches, ["PatchId"]);
-  $PropertyDescriptors[10] =
-    CreateDetailrefPropertyDescriptor("Steps", "Steps", !1, !1, \&CreateSteps);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Id", "Job id", 1, 1, "S",  5),
+    CreateBasicPropertyDescriptor("Archived", "Job is archived", !1, 1, "B", 1),
+    CreateItemrefPropertyDescriptor("Branch", "Branch", !1, 1, \&CreateBranches, ["BranchName"]),
+    CreateItemrefPropertyDescriptor("User", "Author", !1, 1, \&WineTestBot::Users::CreateUsers, ["UserName"]),
+    CreateBasicPropertyDescriptor("Priority", "Priority", !1, 1, "N", 1),
+    CreateBasicPropertyDescriptor("Status", "Status", !1, 1, "A", 9),
+    CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, !1, "A", 50),
+    CreateBasicPropertyDescriptor("Submitted", "Submitted", !1, !1, "DT", 19),
+    CreateBasicPropertyDescriptor("Ended", "Ended", !1, !1, "DT", 50),
+    CreateItemrefPropertyDescriptor("Patch", "Submitted from patch", !1, !1, \&WineTestBot::Patches::CreatePatches, ["PatchId"]),
+    CreateDetailrefPropertyDescriptor("Steps", "Steps", !1, !1, \&CreateSteps),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index 49bfbf0..5689399 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -301,20 +301,15 @@ my @PropertyDescriptors;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Id", "Patch id", 1, 1, "N",  7);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("Received", "Received", !1, 1, "DT", 19);
-  $PropertyDescriptors[2] =
-    CreateBasicPropertyDescriptor("AffectsTests", "Affects tests", !1, 1, "B", 1);
-  $PropertyDescriptors[3] =
-    CreateBasicPropertyDescriptor("FromName", "Author", !1, !1, "A", 40);
-  $PropertyDescriptors[4] =
-    CreateBasicPropertyDescriptor("FromEMail", "Author's email address", !1, !1, "A", 40);
-  $PropertyDescriptors[5] =
-    CreateBasicPropertyDescriptor("Subject", "Subject", !1, !1, "A", 120);
-  $PropertyDescriptors[6] =
-    CreateBasicPropertyDescriptor("Disposition", "Disposition", !1, 1, "A", 40);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Id", "Patch id", 1, 1, "N",  7),
+    CreateBasicPropertyDescriptor("Received", "Received", !1, 1, "DT", 19),
+    CreateBasicPropertyDescriptor("AffectsTests", "Affects tests", !1, 1, "B", 1),
+    CreateBasicPropertyDescriptor("FromName", "Author", !1, !1, "A", 40),
+    CreateBasicPropertyDescriptor("FromEMail", "Author's email address", !1, !1, "A", 40),
+    CreateBasicPropertyDescriptor("Subject", "Subject", !1, !1, "A", 120),
+    CreateBasicPropertyDescriptor("Disposition", "Disposition", !1, 1, "A", 40),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/PendingPatchSets.pm b/testbot/lib/WineTestBot/PendingPatchSets.pm
index 7a19760..84db07b 100644
--- a/testbot/lib/WineTestBot/PendingPatchSets.pm
+++ b/testbot/lib/WineTestBot/PendingPatchSets.pm
@@ -128,12 +128,11 @@ my @PropertyDescriptors;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("EMail", "EMail of series author", 1, 1, "A", 40);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("TotalParts", "Expected number of parts in series", 1, 1, "N", 2);
-  $PropertyDescriptors[2] =
-    CreateDetailrefPropertyDescriptor("Parts", "Parts received so far", !1, !1, \&CreatePendingPatches);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("EMail", "EMail of series author", 1, 1, "A", 40),
+    CreateBasicPropertyDescriptor("TotalParts", "Expected number of parts in series", 1, 1, "N", 2),
+    CreateDetailrefPropertyDescriptor("Parts", "Parts received so far", !1, !1, \&CreatePendingPatches),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/PendingPatches.pm b/testbot/lib/WineTestBot/PendingPatches.pm
index 976dc64..0fbe0a4 100644
--- a/testbot/lib/WineTestBot/PendingPatches.pm
+++ b/testbot/lib/WineTestBot/PendingPatches.pm
@@ -49,10 +49,10 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("No", "Part no", 1, 1, "N", 2);
-  $PropertyDescriptors[1] =
-    CreateItemrefPropertyDescriptor("Patch", "Submitted via patch", !1, 1, \&WineTestBot::Patches::CreatePatches, ["PatchId"]);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("No", "Part no", 1, 1, "N", 2),
+    CreateItemrefPropertyDescriptor("Patch", "Submitted via patch", !1, 1, \&WineTestBot::Patches::CreatePatches, ["PatchId"]),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/Roles.pm b/testbot/lib/WineTestBot/Roles.pm
index 9171084..4dd232f 100644
--- a/testbot/lib/WineTestBot/Roles.pm
+++ b/testbot/lib/WineTestBot/Roles.pm
@@ -53,10 +53,10 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Name", "Role name", 1,  1, "A", 40);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("IsDefaultRole", "Should new users get this role by default", !1, 1, "B", 1);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name", "Role name", 1,  1, "A", 40),
+    CreateBasicPropertyDescriptor("IsDefaultRole", "Should new users get this role by default", !1, 1, "B", 1),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 74cfa79..1ca1abc 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -101,24 +101,17 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("No",     "Step no",  1,  1, "N", 2);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("Status", "Status",  !1,  1, "A", 9);
-  $PropertyDescriptors[2] =
-    CreateBasicPropertyDescriptor("Type", "Step type",  !1,  1, "A", 8);
-  $PropertyDescriptors[3] =
-    CreateBasicPropertyDescriptor("FileName", "File name",  !1,  1, "A", 100);
-  $PropertyDescriptors[4] =
-    CreateBasicPropertyDescriptor("FileType", "File type",  !1,  1, "A", 13);
-  $PropertyDescriptors[5] =
-    CreateBasicPropertyDescriptor("InStaging", "File is in staging area", !1, 1, "B", 1);
-  $PropertyDescriptors[6] =
-    CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2);
-  $PropertyDescriptors[7] =
-    CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1);
-  $PropertyDescriptors[8] =
-    CreateDetailrefPropertyDescriptor("Tasks", "Tasks", !1, !1, \&CreateTasks);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("No", "Step no",  1,  1, "N", 2),
+    CreateBasicPropertyDescriptor("Status", "Status",  !1,  1, "A", 9),
+    CreateBasicPropertyDescriptor("Type", "Step type",  !1,  1, "A", 8),
+    CreateBasicPropertyDescriptor("FileName", "File name",  !1,  1, "A", 100),
+    CreateBasicPropertyDescriptor("FileType", "File type",  !1,  1, "A", 13),
+    CreateBasicPropertyDescriptor("InStaging", "File is in staging area", !1, 1, "B", 1),
+    CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2),
+    CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1),
+    CreateDetailrefPropertyDescriptor("Tasks", "Tasks", !1, !1, \&CreateTasks),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/StepsTasks.pm b/testbot/lib/WineTestBot/StepsTasks.pm
index 29f11e1..8ca7510 100644
--- a/testbot/lib/WineTestBot/StepsTasks.pm
+++ b/testbot/lib/WineTestBot/StepsTasks.pm
@@ -87,35 +87,22 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Id", "Id", 1,  1, "N", 4);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("StepNo", "Step no", !1,  1, "N", 2);
-  $PropertyDescriptors[2] =
-    CreateBasicPropertyDescriptor("TaskNo", "Task no", ! 1,  1, "N", 2);
-  $PropertyDescriptors[3] =
-    CreateBasicPropertyDescriptor("Type", "Step type", !1, 1, "A", 6);
-  $PropertyDescriptors[4] =
-    CreateBasicPropertyDescriptor("Status", "Status",  !1,  1, "A", 9);
-  $PropertyDescriptors[5] =
-    CreateItemrefPropertyDescriptor("VM", "VM", !1,  1, \&CreateVMs, ["VMName"]);
-  $PropertyDescriptors[6] =
-    CreateBasicPropertyDescriptor("Timeout", "Timeout", !1, 1, "N", 4);
-  $PropertyDescriptors[7] =
-    CreateBasicPropertyDescriptor("FileName", "File name",  !1,  1, "A", 64);
-  $PropertyDescriptors[8] =
-    CreateBasicPropertyDescriptor("FileType", "File Type",  !1,  1, "A", 64);
-  $PropertyDescriptors[9] =
-    CreateBasicPropertyDescriptor("CmdLineArg", "Command line args", !1, !1, "A", 256);
-  $PropertyDescriptors[10] =
-    CreateBasicPropertyDescriptor("ChildPid", "Process id of child process", !1, !1, "N", 5);
-  $PropertyDescriptors[11] =
-    CreateBasicPropertyDescriptor("Started", "Execution started", !1, !1, "DT", 19);
-  $PropertyDescriptors[12] =
-    CreateBasicPropertyDescriptor("Ended", "Execution ended", !1, !1, "DT", 19);
-  $PropertyDescriptors[13] =
-    CreateBasicPropertyDescriptor("TestFailures", "Number of test failures", !1, !1, "N", 5);
-
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Id", "Id", 1,  1, "N", 4),
+    CreateBasicPropertyDescriptor("StepNo", "Step no", !1,  1, "N", 2),
+    CreateBasicPropertyDescriptor("TaskNo", "Task no", ! 1,  1, "N", 2),
+    CreateBasicPropertyDescriptor("Type", "Step type", !1, 1, "A", 6),
+    CreateBasicPropertyDescriptor("Status", "Status",  !1,  1, "A", 9),
+    CreateItemrefPropertyDescriptor("VM", "VM", !1,  1, \&CreateVMs, ["VMName"]),
+    CreateBasicPropertyDescriptor("Timeout", "Timeout", !1, 1, "N", 4),
+    CreateBasicPropertyDescriptor("FileName", "File name",  !1,  1, "A", 64),
+    CreateBasicPropertyDescriptor("FileType", "File Type",  !1,  1, "A", 64),
+    CreateBasicPropertyDescriptor("CmdLineArg", "Command line args", !1, !1, "A", 256),
+    CreateBasicPropertyDescriptor("ChildPid", "Process id of child process", !1, !1, "N", 5),
+    CreateBasicPropertyDescriptor("Started", "Execution started", !1, !1, "DT", 19),
+    CreateBasicPropertyDescriptor("Ended", "Execution ended", !1, !1, "DT", 19),
+    CreateBasicPropertyDescriptor("TestFailures", "Number of test failures", !1, !1, "N", 5),
+   );
 }
 
 sub _initialize
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index b4c9040..fed093b 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -113,24 +113,17 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("No", "Task no",  1,  1, "N", 2);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("Status", "Status",  !1,  1, "A", 9);
-  $PropertyDescriptors[2] =
-    CreateItemrefPropertyDescriptor("VM", "VM", !1,  1, \&CreateVMs, ["VMName"]);
-  $PropertyDescriptors[3] =
-    CreateBasicPropertyDescriptor("Timeout", "Timeout", !1, 1, "N", 4);
-  $PropertyDescriptors[4] =
-    CreateBasicPropertyDescriptor("CmdLineArg", "Command line args", !1, !1, "A", 256);
-  $PropertyDescriptors[5] =
-    CreateBasicPropertyDescriptor("ChildPid", "Process id of child process", !1, !1, "N", 5);
-  $PropertyDescriptors[6] =
-    CreateBasicPropertyDescriptor("Started", "Execution started", !1, !1, "DT", 19);
-  $PropertyDescriptors[7] =
-    CreateBasicPropertyDescriptor("Ended", "Execution ended", !1, !1, "DT", 19);
-  $PropertyDescriptors[8] =
-    CreateBasicPropertyDescriptor("TestFailures", "Number of test failures", !1, !1, "N", 5);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("No", "Task no",  1,  1, "N", 2),
+    CreateBasicPropertyDescriptor("Status", "Status",  !1,  1, "A", 9),
+    CreateItemrefPropertyDescriptor("VM", "VM", !1,  1, \&CreateVMs, ["VMName"]),
+    CreateBasicPropertyDescriptor("Timeout", "Timeout", !1, 1, "N", 4),
+    CreateBasicPropertyDescriptor("CmdLineArg", "Command line args", !1, !1, "A", 256),
+    CreateBasicPropertyDescriptor("ChildPid", "Process id of child process", !1, !1, "N", 5),
+    CreateBasicPropertyDescriptor("Started", "Execution started", !1, !1, "DT", 19),
+    CreateBasicPropertyDescriptor("Ended", "Execution ended", !1, !1, "DT", 19),
+    CreateBasicPropertyDescriptor("TestFailures", "Number of test failures", !1, !1, "N", 5),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/UserRoles.pm b/testbot/lib/WineTestBot/UserRoles.pm
index 478473e..3772b0a 100644
--- a/testbot/lib/WineTestBot/UserRoles.pm
+++ b/testbot/lib/WineTestBot/UserRoles.pm
@@ -48,8 +48,9 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateItemrefPropertyDescriptor("Role", "Role", 1,  1, \&CreateRoles, ["RoleName"]);
+  @PropertyDescriptors = (
+    CreateItemrefPropertyDescriptor("Role", "Role", 1,  1, \&CreateRoles, ["RoleName"]),
+  );
 
 }
 
diff --git a/testbot/lib/WineTestBot/Users.pm b/testbot/lib/WineTestBot/Users.pm
index 32b0d3f..bb41f31 100644
--- a/testbot/lib/WineTestBot/Users.pm
+++ b/testbot/lib/WineTestBot/Users.pm
@@ -316,21 +316,15 @@ require Exporter;
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Name",      "Username",             1,  1, "A", 40);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("EMail",     "EMail",               !1,  1, "A", 40);
-  $PropertyDescriptors[2] =
-    CreateBasicPropertyDescriptor("Active",    "Active",              !1,  1, "B",  1);
-  $PropertyDescriptors[3] =
-    CreateBasicPropertyDescriptor("Password",  "Password",            !1, !1, "A", 49);
-  $PropertyDescriptors[4] =
-    CreateBasicPropertyDescriptor("RealName",  "Real name",           !1,  1, "A", 40);
-  $PropertyDescriptors[5] =
-    CreateBasicPropertyDescriptor("ResetCode", "Password reset code", !1, !1, "A", 32);
-  $PropertyDescriptors[6] =
-    CreateDetailrefPropertyDescriptor("Roles",   "Roles",    !1, !1, \&CreateUserRoles);
-
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name",      "Username",   1,  1, "A", 40),
+    CreateBasicPropertyDescriptor("EMail",     "EMail",     !1,  1, "A", 40),
+    CreateBasicPropertyDescriptor("Active",    "Active",    !1,  1, "B",  1),
+    CreateBasicPropertyDescriptor("Password",  "Password",  !1, !1, "A", 49),
+    CreateBasicPropertyDescriptor("RealName",  "Real name", !1,  1, "A", 40),
+    CreateBasicPropertyDescriptor("ResetCode", "Password reset code", !1, !1, "A", 32),
+    CreateDetailrefPropertyDescriptor("Roles", "Roles",     !1, !1, \&CreateUserRoles),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index fac32b5..c7d9e5f 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -554,26 +554,18 @@ sub _initialize
 
 BEGIN
 {
-  $PropertyDescriptors[0] =
-    CreateBasicPropertyDescriptor("Name", "VM name", 1, 1, "A", 20);
-  $PropertyDescriptors[1] =
-    CreateBasicPropertyDescriptor("Type", "Type of VM", !1, 1, "A", 7);
-  $PropertyDescriptors[2] =
-    CreateBasicPropertyDescriptor("SortOrder", "Display order", !1, 1, "N", 3);
-  $PropertyDescriptors[3] =
-    CreateBasicPropertyDescriptor("Bits", "32 or 64 bits", !1, 1, "N", 2);
-  $PropertyDescriptors[4] =
-    CreateBasicPropertyDescriptor("Status", "Current status", !1, 1, "A", 9);
-  $PropertyDescriptors[5] =
-    CreateBasicPropertyDescriptor("VmxHost", "Host where VM is located", !1, !1, "A", 64);
-  $PropertyDescriptors[6] =
-    CreateBasicPropertyDescriptor("VmxFilePath", "Path to .vmx file", !1, 1, "A", 64);
-  $PropertyDescriptors[7] =
-    CreateBasicPropertyDescriptor("IdleSnapshot", "Name of idle snapshot", !1, 1, "A", 32);
-  $PropertyDescriptors[8] =
-    CreateBasicPropertyDescriptor("Interactive", "Needs interactive flag", !1, 1, "B", 1);
-  $PropertyDescriptors[9] =
-    CreateBasicPropertyDescriptor("Description", "Description", !1, !1, "A", 40);
+  @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name", "VM name", 1, 1, "A", 20),
+    CreateBasicPropertyDescriptor("Type", "Type of VM", !1, 1, "A", 7),
+    CreateBasicPropertyDescriptor("SortOrder", "Display order", !1, 1, "N", 3),
+    CreateBasicPropertyDescriptor("Bits", "32 or 64 bits", !1, 1, "N", 2),
+    CreateBasicPropertyDescriptor("Status", "Current status", !1, 1, "A", 9),
+    CreateBasicPropertyDescriptor("VmxHost", "Host where VM is located", !1, !1, "A", 64),
+    CreateBasicPropertyDescriptor("VmxFilePath", "Path to .vmx file", !1, 1, "A", 64),
+    CreateBasicPropertyDescriptor("IdleSnapshot", "Name of idle snapshot", !1, 1, "A", 32),
+    CreateBasicPropertyDescriptor("Interactive", "Needs interactive flag", !1, 1, "B", 1),
+    CreateBasicPropertyDescriptor("Description", "Description", !1, !1, "A", 40),
+  );
 }
 
 sub CreateItem
diff --git a/testbot/web/Feedback.pl b/testbot/web/Feedback.pl
index 5fd0786..626a7f8 100644
--- a/testbot/web/Feedback.pl
+++ b/testbot/web/Feedback.pl
@@ -31,10 +31,11 @@ sub _initialize
 {
   my $self = shift;
 
-  my @PropertyDescriptors;
-  $PropertyDescriptors[0] = CreateBasicPropertyDescriptor("Name", "Name", !1, !1, "A", 40);
-  $PropertyDescriptors[1] = CreateBasicPropertyDescriptor("EMail", "Email", !1, !1, "A", 40);
-  $PropertyDescriptors[2] = CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, 1, "A", 1024);
+  my @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name", "Name", !1, !1, "A", 40),
+    CreateBasicPropertyDescriptor("EMail", "Email", !1, !1, "A", 40),
+    CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, 1, "A", 1024),
+  );
 
   $self->SUPER::_initialize(\@PropertyDescriptors);
 
diff --git a/testbot/web/ForgotPassword.pl b/testbot/web/ForgotPassword.pl
index 732747a..5a9d71f 100644
--- a/testbot/web/ForgotPassword.pl
+++ b/testbot/web/ForgotPassword.pl
@@ -35,8 +35,9 @@ sub _initialize
 
   $self->GetPageBase()->CheckSecurePage();
 
-  my @PropertyDescriptors;
-  $PropertyDescriptors[0] = CreateBasicPropertyDescriptor("Name", "Username or EMail", 1, 1, "A", 40);
+  my @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name", "Username or EMail", 1, 1, "A", 40),
+  );
 
   $self->SUPER::_initialize(\@PropertyDescriptors);
 }
diff --git a/testbot/web/Login.pl b/testbot/web/Login.pl
index b7b6c59..4002948 100644
--- a/testbot/web/Login.pl
+++ b/testbot/web/Login.pl
@@ -36,10 +36,11 @@ sub _initialize
 
   $self->GetPageBase()->CheckSecurePage();
 
-  my @PropertyDescriptors;
-  $PropertyDescriptors[0] = CreateBasicPropertyDescriptor("Name", "Username", 1, 1, "A", 40);
-  $PropertyDescriptors[1] = CreateBasicPropertyDescriptor("Password", "Password", !1, 1, "A", 32);
-  $PropertyDescriptors[2] = CreateBasicPropertyDescriptor("AutoLogin", "Log me in automatically each visit", !1, !1, "B", 1);
+  my @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name", "Username", 1, 1, "A", 40),
+    CreateBasicPropertyDescriptor("Password", "Password", !1, 1, "A", 32),
+    CreateBasicPropertyDescriptor("AutoLogin", "Log me in automatically each visit", !1, !1, "B", 1),
+  );
 
   $self->SUPER::_initialize(\@PropertyDescriptors);
 }
diff --git a/testbot/web/ResetPassword.pl b/testbot/web/ResetPassword.pl
index caaadcc..dff05cf 100644
--- a/testbot/web/ResetPassword.pl
+++ b/testbot/web/ResetPassword.pl
@@ -35,11 +35,12 @@ sub _initialize
 
   $self->GetPageBase()->CheckSecurePage();
 
-  my @PropertyDescriptors;
-  $PropertyDescriptors[0] = CreateBasicPropertyDescriptor("Name", "Username", 1, 1, "A", 40);
-  $PropertyDescriptors[1] = CreateBasicPropertyDescriptor("ResetCode", "Activation code", !1, 1, "A", 32);
-  $PropertyDescriptors[2] = CreateBasicPropertyDescriptor("Password1", "Password", !1, 1, "A", 32);
-  $PropertyDescriptors[3] = CreateBasicPropertyDescriptor("Password2", "Password (repeat)", !1, 1, "A", 32);
+  my @PropertyDescriptors = (
+    CreateBasicPropertyDescriptor("Name", "Username", 1, 1, "A", 40),
+    CreateBasicPropertyDescriptor("ResetCode", "Activation code", !1, 1, "A", 32),
+    CreateBasicPropertyDescriptor("Password1", "Password", !1, 1, "A", 32),
+    CreateBasicPropertyDescriptor("Password2", "Password (repeat)", !1, 1, "A", 32),
+  );
 
   $self->SUPER::_initialize(\@PropertyDescriptors);
 }
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 3ee89d7..72687aa 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -41,16 +41,18 @@ sub _initialize
 
   $self->{Page} = $self->GetParam("Page") || 1;
 
-  my @PropertyDescriptors1;
-  $PropertyDescriptors1[0] = CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, !1, "A", 50);
+  my @PropertyDescriptors1 = (
+    CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, !1, "A", 50),
+  );
   $self->{PropertyDescriptors1} = \@PropertyDescriptors1;
 
-  my @PropertyDescriptors3;
-  $PropertyDescriptors3[0] = CreateBasicPropertyDescriptor("TestExecutable", "Test executable", !1, 1, "A", 50);
-  $PropertyDescriptors3[1] = CreateBasicPropertyDescriptor("CmdLineArg", "Command line arguments", !1, !1, "A", 50);
-  $PropertyDescriptors3[2] = CreateBasicPropertyDescriptor("Run64", "Run 64-bit tests in addition to 32-bit tests", !1, 1, "B", 1);
-  $PropertyDescriptors3[3] = CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2);
-  $PropertyDescriptors3[4] = CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1);
+  my @PropertyDescriptors3 = (
+    CreateBasicPropertyDescriptor("TestExecutable", "Test executable", !1, 1, "A", 50),
+    CreateBasicPropertyDescriptor("CmdLineArg", "Command line arguments", !1, !1, "A", 50),
+    CreateBasicPropertyDescriptor("Run64", "Run 64-bit tests in addition to 32-bit tests", !1, 1, "B", 1),
+    CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2),
+    CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1),
+  );
   $self->{PropertyDescriptors3} = \@PropertyDescriptors3;
 
   if ($self->{Page} == 2)
-- 
1.7.10.4




More information about the wine-patches mailing list