Hi kou,
On Mon, Dec 15, 2008 at 6:30 AM, Kouhei Sutou <kou_at_cozmixng.org> wrote:
> Hi,
>
> In <ae6cb1100812142233n4920e50fufe2095e083948150_at_mail.gmail.com>
> "Re: SQLite and the Ruby bindings tests on Windows" on Sun, 14 Dec 2008 22:33:03 -0800,
> Joe Swatosh <joe.swatosh_at_gmail.com> wrote:
>
>> > What about adding Svn::Client::Context#close and
>> > Svn::Client::Context#initialize accepts a block?
>> >
>> > pseudo code:
>> > class Svn::Client::Context
>> > def initialize(...)
>> > ...
>> > return unless block_given?
>> > begin
>> > yield(self)
>> > ensure
>> > close
>> > end
>> > end
>> >
>> > def close
>> > @pool.destroy
>> > end
>> > end
>> >
>> > But I'm not sure that 'close' is a good name for that...
>> >
>>
>> Based on the above idea, I committed r34708. Instead of Context#initialize
>> taking a block I modified SvnTestUtil#make_context to take a block. I think
>> that worked better for updating the tests, but I'd like to see the
>> Context#initialize take a block someday.
>
> I think of an idea that 'destroy' is more better name rather
> than 'close'. What about this? The attached patch includes
> block supported #initialize.
>
With your patch I get:
Loaded suite .
Started
EEEEEEEEEEEEE.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.E..............................................EEE..........EEEEEEEE..EE.EE
EEEEEEEEE.EEEE.......EEEEEEE.E.EEEEEEE...E.EEE.EEEE......E.EEEEEEEEEE.EEE..
Finished in 695.42 seconds.
1) Error:
test_add_force(SvnClientTest):
NameError: uninitialized constant Svn::Destroyer
D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:112:in `destroy'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/util.rb:183:in
`make_context'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:69:in
`test_add_force'
2) Error:
test_add_no_ignore(SvnClientTest):
NameError: uninitialized constant Svn::Destroyer
D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:112:in `destroy'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/util.rb:183:in
`make_context'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:94:in
`test_add_no_ignore'
3) Error:
test_add_not_recurse(SvnClientTest):
NameError: uninitialized constant Svn::Destroyer
D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:112:in `destroy'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/util.rb:183:in
`make_context'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_client.rb:29:in
`test_add_not_recurse'
:
:
:
128) Error:
test_update_editor2_conflict_func(SvnWcTest):
NameError: uninitialized constant Svn::Destroyer
D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:112:in `destroy'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/util.rb:183:in
`make_context'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_wc.rb:878:in
`test_update_editor2_conflict_func'
129) Error:
test_update_editor_options(SvnWcTest):
NameError: uninitialized constant Svn::Destroyer
D:/SVN/src-trunk/subversion/bindings/swig/ruby/svn/client.rb:112:in `destroy'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/util.rb:183:in
`make_context'
D:/SVN/src-trunk/subversion/bindings/swig/ruby/test/test_wc.rb:832:in
`test_update_editor_options'
215 tests, 1368 assertions, 0 failures, 129 errors
I think I prefer close() to destroy() but it isn't too big a deal.
Actually rereading it just now, I think
destroy() on Context is fine. How to get Svn::Destroyer defined? I
see it in swigutil_rb.c, but
obviously....
--
Joe
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=984785
Received on 2008-12-16 04:45:27 CET