ruby-changes:1805
From: ko1@a...
Date: 28 Aug 2007 19:23:41 +0900
Subject: [ruby-changes:1805] suke - Ruby:r13296 (trunk): * ext/win32ole/win32ole.c (ole_type_progid): progid getted by
suke 2007-08-28 19:23:31 +0900 (Tue, 28 Aug 2007) New Revision: 13296 Modified files: trunk/ChangeLog trunk/ext/win32ole/win32ole.c trunk/test/win32ole/test_win32ole.rb trunk/test/win32ole/test_win32ole_type.rb Log: * ext/win32ole/win32ole.c (ole_type_progid): progid getted by ProgIDFromCLSID should be freed by CoTaskMemFree. Thanks, arton. * test/win32ole/test_win32ole.rb (test_raise_message): set negative compareMode value to raise WIN32OLERuntimeError. * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types): support some environment which returns IShellDispatch5 instead of IShellDispatch. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/win32ole/test_win32ole_type.rb?r1=13296&r2=13295 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13296&r2=13295 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/win32ole/win32ole.c?r1=13296&r2=13295 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/win32ole/test_win32ole.rb?r1=13296&r2=13295 Index: ChangeLog =================================================================== --- ChangeLog (revision 13295) +++ ChangeLog (revision 13296) @@ -1,3 +1,15 @@ +Tue Aug 28 19:16:00 2007 Masaki Suketa <masaki.suketa@n...> + + * ext/win32ole/win32ole.c (ole_type_progid): progid getted by + ProgIDFromCLSID should be freed by CoTaskMemFree. Thanks, arton. + + * test/win32ole/test_win32ole.rb (test_raise_message): set negative + compareMode value to raise WIN32OLERuntimeError. + + * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types): + support some environment which returns IShellDispatch5 instead + of IShellDispatch. + Tue Aug 28 15:42:09 2007 Yukihiro Matsumoto <matz@r...> * string.c (rb_str_subseq): retrieve substring based on byte offset. Index: ext/win32ole/win32ole.c =================================================================== --- ext/win32ole/win32ole.c (revision 13295) +++ ext/win32ole/win32ole.c (revision 13296) @@ -116,7 +116,7 @@ #define WC2VSTR(x) ole_wc2vstr((x), TRUE) -#define WIN32OLE_VERSION "1.0.6" +#define WIN32OLE_VERSION "1.0.7" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); @@ -5192,8 +5192,10 @@ if (FAILED(hr)) return progid; hr = ProgIDFromCLSID(&pTypeAttr->guid, &pbuf); - if (SUCCEEDED(hr)) + if (SUCCEEDED(hr)) { progid = ole_wc2vstr(pbuf, FALSE); + CoTaskMemFree(pbuf); + } OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr); return progid; } Index: test/win32ole/test_win32ole.rb =================================================================== --- test/win32ole/test_win32ole.rb (revision 13295) +++ test/win32ole/test_win32ole.rb (revision 13296) @@ -50,7 +50,7 @@ assert_match(/^\(in OLE method `<dispatch id:1>': \)/, exc.message) exc = assert_raise(WIN32OLERuntimeError) { - @dict1.compareMode = 100 + @dict1.compareMode = -1 } assert_match(/^\(in setting property `compareMode': \)/, exc.message) end Index: test/win32ole/test_win32ole_type.rb =================================================================== --- test/win32ole/test_win32ole_type.rb (revision 13295) +++ test/win32ole/test_win32ole_type.rb (revision 13296) @@ -152,7 +152,7 @@ ole_types = @ole_type.implemented_ole_types assert_instance_of(Array, ole_types) assert(ole_types.size > 0) - assert_equal("IShellDispatch", ole_types[0].name) + assert_match(/^IShellDispatch5{0,1}$/, ole_types[0].name) end def test_inspect -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml