[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 2/3] generator: Change type of 'tests' to 'c_api_tests'.



Just a code refactoring, has no functional effect.
---
 generator/main.ml        |  2 +-
 generator/tests_c_api.ml |  4 ++--
 generator/types.ml       | 12 ++++++------
 generator/utils.mli      |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/generator/main.ml b/generator/main.ml
index 63ddb9a..c0ad146 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -115,7 +115,7 @@ Run it from the top source directory using the command
   output_to "daemon/names.c" generate_daemon_names;
   output_to "daemon/optgroups.c" generate_daemon_optgroups_c;
   output_to "daemon/optgroups.h" generate_daemon_optgroups_h;
-  output_to "tests/c-api/tests.c" generate_tests;
+  output_to "tests/c-api/tests.c" generate_c_api_tests;
   output_to "fish/cmds-gperf.gperf" generate_fish_cmds_gperf;
   output_to "fish/cmds.c" generate_fish_cmds;
   output_to "fish/completion.c" generate_fish_completion;
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index c0ebcb9..88aa07e 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -28,8 +28,8 @@ open Optgroups
 open Actions
 open Structs
 
-(* Generate the tests. *)
-let rec generate_tests () =
+(* Generate the C API tests. *)
+let rec generate_c_api_tests () =
   generate_header CStyle GPLv2plus;
 
   pr "\
diff --git a/generator/types.ml b/generator/types.ml
index 48ac32a..63aa235 100644
--- a/generator/types.ml
+++ b/generator/types.ml
@@ -208,8 +208,8 @@ type fish_output_t =
   | FishOutputHexadecimal (* for int return, print in hex *)
 
 (* See guestfs(3)/EXTENDING LIBGUESTFS. *)
-type tests = (test_init * test_prereq * test * test_cleanup) list
-and test =
+type c_api_tests = (c_api_test_init * c_api_test_prereq * c_api_test * c_api_test_cleanup) list
+and c_api_test =
     (* Run the command sequence and just expect nothing to fail. *)
   | TestRun of seq
 
@@ -241,7 +241,7 @@ and test =
   | TestLastFail of seq
 
 (* Test prerequisites. *)
-and test_prereq =
+and c_api_test_prereq =
     (* Test always runs. *)
   | Always
 
@@ -254,7 +254,7 @@ and test_prereq =
   | IfAvailable of string
 
 (* Some initial scenarios for testing. *)
-and test_init =
+and c_api_test_init =
     (* Do nothing, block devices could contain random stuff including
      * LVM PVs, and some filesystems might be mounted.  This is usually
      * a bad idea.
@@ -309,7 +309,7 @@ and test_init =
   | InitScratchFS
 
 (* Cleanup commands which are run whether the test succeeds or fails. *)
-and test_cleanup = cmd list
+and c_api_test_cleanup = cmd list
 
 (* Sequence of commands for testing. *)
 and seq = cmd list
@@ -328,7 +328,7 @@ type action = {
   name : string;                  (* name, not including "guestfs_" *)
   style : style;                  (* args and return value *)
   proc_nr : int option;           (* proc number, None for non-daemon *)
-  tests : tests;                  (* tests *)
+  tests : c_api_tests;            (* C API tests *)
   test_excuse : string;           (* if there's no tests ... *)
   shortdesc : string;             (* single line description *)
   longdesc : string;              (* longer documentation *)
diff --git a/generator/utils.mli b/generator/utils.mli
index c96bde4..8dca20b 100644
--- a/generator/utils.mli
+++ b/generator/utils.mli
@@ -99,7 +99,7 @@ val name_of_argt : Types.argt -> string
 val name_of_optargt : Types.optargt -> string
 (** Extract optional argument name. *)
 
-val seq_of_test : Types.test -> Types.seq
+val seq_of_test : Types.c_api_test -> Types.seq
 (** Extract test sequence from a test. *)
 
 val c_quote : string -> string
-- 
2.0.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]