search for: close_invok

Displaying 19 results from an estimated 19 matches for "close_invok".

Did you mean: close_invoked
2016 Feb 23
2
[PATCH 1/2] Revert "ruby: Run tests one at a time, instead of in parallel."
It seems the default behaviour of rake is to run tests sequentially, and not in parallel (there are separate gems to achieve that behaviour). Hence just invoke "rake test" to run all the available tests at once. This reverts commit 8f30c3c3f8c063f7c5ff8c6154d881e07a820251. --- ruby/run-ruby-tests | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git
2016 Feb 23
0
[PATCH 2/2] ruby: tests: use more asserts instead of manual checks
...y/t/tc_410_close_event.rb index c547613..be62b91 100644 --- a/ruby/t/tc_410_close_event.rb +++ b/ruby/t/tc_410_close_event.rb @@ -29,12 +29,8 @@ class TestLoad < MiniTest::Unit::TestCase # Check that the close event is called. g.set_event_callback(close, Guestfs::EVENT_CLOSE) - if close_invoked != 0 - raise "close_invoked should be 0" - end + assert_equal 0, close_invoked g.close() - if close_invoked != 1 - raise "close_invoked should be 1" - end + assert_equal 1, close_invoked end end diff --git a/ruby/t/tc_420_log_messages.rb b/rub...
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...l Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -import unittest -import os -import guestfs - -close_invoked = 0 - -def close_callback (ev, eh, buf, array): - global close_invoked - close_invoked += 1 - -class Test410CloseEvent (unittest.TestCase): - def test_close_event (self): - g = guestfs.GuestFS (python_return_dict=True) - - # Register a callback for the close event. -...
2015 Oct 06
6
[PATCH 0/4] ocaml: Allow Guestfs.t handle to be garbage collected.
Allow Guestfs.t handle to be garbage collected, and add a regression test.
2019 Jul 31
0
Re: [PATCH] Rust bindings: Implement Event features
...; + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +extern crate guestfs; > + > +use std::sync::{Arc, Mutex}; > + > +#[test] > +fn close_event() { > + let close_invoked = Arc::new(Mutex::new(0)); Maybe a thread-safe Arc is not needed for this test -- it's just a single-threaded test with just one handle. > + { > + let mut g = guestfs::Handle::create().expect("create"); > + g.set_event_callback( > + |_, _, _...
2016 May 04
9
[PATCH 0/8] python: PEP 8 fixes
Hi, this series cleans up the Python sources, either static or generated, including also tests, to make them PEP 8 compliant; see https://www.python.org/dev/peps/pep-0008/ and tools like pep8. Almost all the issues reported by pep8 are fixed, reducing the issues from 3818 to 7. The changes should have no effect on the actual code, while it will help Python users with consistency with other
2019 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...e received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +extern crate guestfs; + +use std::sync::{Arc, Mutex}; + +#[test] +fn close_event() { + let close_invoked = Arc::new(Mutex::new(0)); + { + let mut g = guestfs::Handle::create().expect("create"); + g.set_event_callback( + |_, _, _, _| { + let mut data = (&close_invoked).lock().unwrap(); + *data += 1; + }, + &...
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
...e Software > > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > 02110-1301 USA. > > + */ > > + > > +extern crate guestfs; > > + > > +use std::sync::{Arc, Mutex}; > > + > > +#[test] > > +fn close_event() { > > + let close_invoked = Arc::new(Mutex::new(0)); > > Maybe a thread-safe Arc is not needed for this test -- it's just a > single-threaded test with just one handle. > > > + { > > + let mut g = guestfs::Handle::create().expect("create"); > > + g.set_event_cal...
2023 Jun 27
1
[PATCH libguestfs 4/4] ocaml/t/guestfs_065_implicit_close.ml: Skip this test on OCaml 5
...Caml 5, Gc.full_major does not actually collect the handle + * for unknown reasons. Skip the test until we can resolve this. + * https://discuss.ocaml.org/t/ocaml-5-forcing-objects-to-be-collected-and-finalized/12492/2 + *) + if Sys.ocaml_version >= "5" then + exit 77 + let close_invoked = ref 0 let close _ _ _ _ = -- 2.41.0
2023 Jun 28
1
[PATCH libguestfs 4/4] ocaml/t/guestfs_065_implicit_close.ml: Skip this test on OCaml 5
...ally collect the handle > + * for unknown reasons. Skip the test until we can resolve this. > + * https://discuss.ocaml.org/t/ocaml-5-forcing-objects-to-be-collected-and-finalized/12492/2 > + *) > + if Sys.ocaml_version >= "5" then > + exit 77 > + > let close_invoked = ref 0 > > let close _ _ _ _ = series looks great and even understandable, thanks!
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +extern crate guestfs; + +use std::cell::RefCell; +use std::rc::Rc; + +#[test] +fn close_event() { + let close_invoked = Rc::new(RefCell::new(0)); + { + let mut g = guestfs::Handle::create().expect("create"); + g.set_event_callback( + |_, _, _, _| { + *close_invoked.borrow_mut() += 1; + }, + &[guestfs::Event::Close], + ) +...
2012 Dec 13
3
Lua improvements
Here are a few patches I applied to get the Lua bindings to build correctly with different versions of Lua. I am not particularly happy with generating all the test scripts just for the shebang line. Since it has been a while since I had to edit autoconf/automake, this was the best I could come up with. Cheers, -Hilko
2016 Jun 07
0
[PATCH 2/2] ruby: tests: Give each test class and method a unique name.
.../tc_410_close_event.rb @@ -17,8 +17,8 @@ require File::join(File::dirname(__FILE__), 'test_helper') -class TestLoad < MiniTest::Unit::TestCase - def test_events +class Test410CloseEvent < MiniTest::Unit::TestCase + def test_410_close_event g = Guestfs::Guestfs.new() close_invoked = 0 diff --git a/ruby/t/tc_420_log_messages.rb b/ruby/t/tc_420_log_messages.rb index e64ea74..44355fd 100644 --- a/ruby/t/tc_420_log_messages.rb +++ b/ruby/t/tc_420_log_messages.rb @@ -17,8 +17,8 @@ require File::join(File::dirname(__FILE__), 'test_helper') -class TestLoad < MiniT...
2016 Jun 07
3
[PATCH 1/2] ruby: Print exceptions thrown by event callbacks.
--- generator/ruby.ml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/generator/ruby.ml b/generator/ruby.ml index 97ccfdc..0f71ccc 100644 --- a/generator/ruby.ml +++ b/generator/ruby.ml @@ -404,15 +404,17 @@ event_callback_wrapper_wrapper (VALUE argvv) return Qnil; } +/* Callbacks aren't supposed to throw exceptions. We just print the + * exception on
2023 May 27
4
[PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks
...implicit_close.ml index 567e550b4..5e00c21ac 100644 --- a/ocaml/t/guestfs_065_implicit_close.ml +++ b/ocaml/t/guestfs_065_implicit_close.ml @@ -30,8 +30,8 @@ let () = *) (* This should cause the GC to close the handle. *) -let () = Gc.compact () +let () = Gc.full_major () let () = assert (!close_invoked = 1) -let () = Gc.compact () +let () = Gc.full_major () -- 2.40.1
2020 Jan 10
8
[PATCH 0/7] Various Python pycodestyle fixes
Fixes the majority of the pycodestyle issues in the Python bindings, leaving only an overly length line in setup.py. Add a simple optional pycodestyle-based test to avoid regressions in the future. Pino Toscano (7): python: PEP 8: adapt empty lines python: PEP 8: adapt whitespaces in lines python: tests: catch specific exception python: tests: improve variable naming python: tests:
2013 Dec 27
0
[PATCH] ruby: Fix .new method (RHBZ#1046509).
...by/t/tc_410_close_event.rb index ebf4bbc..d7e53d4 100644 --- a/ruby/t/tc_410_close_event.rb +++ b/ruby/t/tc_410_close_event.rb @@ -22,7 +22,7 @@ require 'guestfs' class TestLoad < Test::Unit::TestCase def test_events - g = Guestfs::create() + g = Guestfs::Guestfs.new() close_invoked = 0 close = Proc.new {| event, event_handle, buf, array | diff --git a/ruby/t/tc_420_log_messages.rb b/ruby/t/tc_420_log_messages.rb index 3fe70de..b734fb8 100644 --- a/ruby/t/tc_420_log_messages.rb +++ b/ruby/t/tc_420_log_messages.rb @@ -22,7 +22,7 @@ require 'guestfs' class Test...
2020 Jan 10
9
[PATCH v2 0/8] Various Python pycodestyle fixes
Fixes all the pycodestyle issues in the Python bindings, overring one that does not make sense to change (and it's in setup.py, so almost irrelevant). Add a simple optional pycodestyle-based test to avoid regressions in the future. Pino Toscano (8): python: PEP 8: adapt empty lines python: PEP 8: adapt whitespaces in lines python: tests: catch specific exception python: tests:
2023 Jun 27
4
[PATCH libguestfs 0/4] Fix ups for OCaml 5
No action required here as I have pushed this already, this is just for your information. Rich.