[Libguestfs] [PATCH] perl: tests: reenable set_path tests

Pino Toscano ptoscano at redhat.com
Thu Feb 5 17:20:31 UTC 2015


guestfs_set_path now does a copy of the passed string, so bindings don't
need to take care of the lifetime of strings parameters for it.
---
 perl/t/060-handle-properties.t | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/perl/t/060-handle-properties.t b/perl/t/060-handle-properties.t
index 0057503..6b1ee42 100644
--- a/perl/t/060-handle-properties.t
+++ b/perl/t/060-handle-properties.t
@@ -17,7 +17,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 7;
+use Test::More tests => 9;
 
 use Sys::Guestfs;
 
@@ -33,13 +33,10 @@ ok ($g->get_autosync () == 1, "autosync not true");
 $g->set_autosync (0);
 ok ($g->get_autosync () == 0, "autosync not false");
 
-# This probably doesn't work at the moment because
-# the binding for set_path does not ensure the string
-# remains around for the lifetime of the handle.
-#$g->set_path (".");
-#ok ($g->get_path () eq ".", "path not dot");
-#$g->set_path (undef);
-#ok ($g->get_path () ne "", "path is empty");
+$g->set_path (".");
+ok ($g->get_path () eq ".", "path not dot");
+$g->set_path (undef);
+ok ($g->get_path () ne "", "path is empty");
 
 $g->add_drive ("/dev/null");
 ok (1, "add drive");
-- 
1.9.3




More information about the Libguestfs mailing list