win32utils-devel@rubyforge.org
2004-Feb-01 00:10 UTC
[Win32utils-devel] test_services test case
While working on win32-service-0.3.0 I got hung up trying to resolve that "RPC server is unavailable" error message that was popping up on some systems. I couldn''t duplicate this on my XP Pro box, but it does show up on my Win2k box. Quick review - this is the test case from tc_service.rb def test_services assert_nothing_raised{ Service.services{ } } assert_raises(NotImplementedError){ Service.services } # no non-block a = [] Service.services{ |s| a.push(s) } assert_kind_of(Struct::Win32Service,a.first) end I added some more information to the error messages, and it turns out that the failure is caused by the call to OpenSCManager() in the services() function in service.c. As far as I can tell, the only reason for this to happen would have something to do with the way TestUnit calls the tests. I discovered two interesting things while tinkering with this test case. First, If I remove the 2nd assertion (assert_raises) the test passes fine. Second, if I add a "sleep 1" after the "assert raises", I get a different error: "Invalid access to memory location.". I think this is a quirk of TestUnit myself, and can safely be ignored, although I wouldn''t mind a code review of the services() function after I post 0.3.0. I will note this oddity in the documentation. Regards, Dan _________________________________________________________________ Check out the coupons and bargains on MSN Offers! http://shopping.msn.com/softcontent/softcontent.aspx?scmId=1418
win32utils-devel@rubyforge.org
2004-Feb-01 06:33 UTC
[Win32utils-devel] test_services test case
> While working on win32-service-0.3.0 I got hung up trying to resolve that > "RPC server is unavailable" error message that was popping up on some > systems. I couldn''t duplicate this on my XP Pro box, but it does show upon> my Win2k box. > > Quick review - this is the test case from tc_service.rb > > def test_services > assert_nothing_raised{ Service.services{ } } > assert_raises(NotImplementedError){ Service.services } # nonon-block> a = [] > Service.services{ |s| a.push(s) } > assert_kind_of(Struct::Win32Service,a.first) > end > > I added some more information to the error messages, and it turns out that > the failure is caused by the call to OpenSCManager() in the services() > function in service.c. As far as I can tell, the only reason for this to > happen would have something to do with the way TestUnit calls the tests. > > I discovered two interesting things while tinkering with this test case. > First, If I remove the 2nd assertion (assert_raises) the test passes fine. > Second, if I add a "sleep 1" after the "assert raises", I get a different > error: "Invalid access to memory location.". > > I think this is a quirk of TestUnit myself, and can safely be ignored, > although I wouldn''t mind a code review of the services() function after I > post 0.3.0. I will note this oddity in the documentation. >After some debugging, I am confinced that there is some bug at assert_raise method in test\unit\assertions.rb related to block and yield. But I can''t figure out. How about comment out of the test assert_raises(NotImplementedError){ Service.services } until further notice? Regards, Park Heesob
win32utils-devel@rubyforge.org
2004-Feb-02 08:29 UTC
[Win32utils-devel] test_services test case
> -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > win32utils-devel@rubyforge.org > Sent: Sunday, February 01, 2004 4:32 AM > To: win32utils-devel@rubyforge.org > Subject: Re: [Win32utils-devel] test_services test case > > > > > > While working on win32-service-0.3.0 I got hung up trying > to resolve > > that "RPC server is unavailable" error message that was > popping up on > > some systems. I couldn''t duplicate this on my XP Pro box, > but it does > > show up > on > > my Win2k box. > > > > Quick review - this is the test case from tc_service.rb > > > > def test_services > > assert_nothing_raised{ Service.services{ } } > > assert_raises(NotImplementedError){ Service.services } # no > non-block > > a = [] > > Service.services{ |s| a.push(s) } > > assert_kind_of(Struct::Win32Service,a.first) > > end > > > > I added some more information to the error messages, and it > turns out > > that the failure is caused by the call to OpenSCManager() in the > > services() function in service.c. As far as I can tell, the only > > reason for this to happen would have something to do with the way > > TestUnit calls the tests. > > > > I discovered two interesting things while tinkering with this test > > case. First, If I remove the 2nd assertion (assert_raises) the test > > passes fine. Second, if I add a "sleep 1" after the "assert > raises", I > > get a different > > error: "Invalid access to memory location.". > > > > I think this is a quirk of TestUnit myself, and can safely > be ignored, > > although I wouldn''t mind a code review of the services() function > > after I post 0.3.0. I will note this oddity in the documentation. > > > After some debugging, I am confinced that there is some bug > at assert_raise method in test\unit\assertions.rb related to > block and yield. But I can''t figure out. How about comment > out of the test assert_raises(NotImplementedError){ > Service.services } > until further notice? > > Regards, > > Park HeesobI didn''t see this message until about an hour after I had already released. The test is still in there, but the issue is under the "Known Bugs" section. I will comment it out for 0.3.1. Regards, Dan