[Pkg-libvirt-commits] [libguestfs] 17/29: v2v: Add unit test of Utils.drive_name function.

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:15:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.29.49
in repository libguestfs.

commit 36e22d1e8ec7a82b12624539d43467de759838e7
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Jul 1 15:14:49 2015 +0100

    v2v: Add unit test of Utils.drive_name function.
---
 v2v/v2v_unit_tests.ml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/v2v/v2v_unit_tests.ml b/v2v/v2v_unit_tests.ml
index aa27b9f..1b84ed0 100644
--- a/v2v/v2v_unit_tests.ml
+++ b/v2v/v2v_unit_tests.ml
@@ -82,11 +82,24 @@ let test_get_ostype ctx =
                                         i_product_variant = "Server";
                                         i_arch = "x86_64" })
 
+let test_drive_name ctx =
+  let printer = identity in
+  assert_equal ~printer "a" (Utils.drive_name 0);
+  assert_equal ~printer "z" (Utils.drive_name 25);
+  assert_equal ~printer "aa" (Utils.drive_name 26);
+  assert_equal ~printer "ab" (Utils.drive_name 27);
+  assert_equal ~printer "az" (Utils.drive_name 51);
+  assert_equal ~printer "ba" (Utils.drive_name 52);
+  assert_equal ~printer "zz" (Utils.drive_name 701);
+  assert_equal ~printer "aaa" (Utils.drive_name 702);
+  assert_equal ~printer "zzz" (Utils.drive_name 18277)
+
 (* Suites declaration. *)
 let suite =
   "virt-v2v" >:::
     [
       "OVF.get_ostype" >:: test_get_ostype;
+      "Utils.drive_name" >:: test_drive_name;
     ]
 
 let () =

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list