[Libguestfs] [libnbd PATCH 2/2] ocaml: Fix test 505

Richard W.M. Jones rjones at redhat.com
Wed Aug 14 19:50:47 UTC 2019


On Wed, Aug 14, 2019 at 01:54:34PM -0500, Eric Blake wrote:
>  let callback user_data err =
> -  if user_data <= 43 then
> +  if fst user_data = 42 then
>      assert (!err = 0)
>    else
>      assert (!err = 100);
>    err := 101;
> -  assert (user_data = 42);
> +  assert (snd user_data = 42);

Actually I think this change is wrong?  It seems to need this I think.

Rich.

diff --git a/ocaml/tests/test_505_aio_pread_structured_callback.ml b/ocaml/tests/test_505_aio_pread_structured_callback.ml
index 5474b2e..fed493d 100644
--- a/ocaml/tests/test_505_aio_pread_structured_callback.ml
+++ b/ocaml/tests/test_505_aio_pread_structured_callback.ml
@@ -50,7 +50,8 @@ let callback user_data err =
   else
     assert (!err = 100);
   err := 101;
-  assert (snd user_data = 42);
+  if snd user_data <> 42 then
+    invalid_arg "this should be turned into NBD.Error";
   0
 
 let () =


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list