Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
akr fb2008a73a * test/lib/envutil.rb: Moved from test/ruby/.
* test/lib/find_executable.rb: Ditto.

* test/lib/memory_status.rb: Ditto.

* test/lib/test/unit.rb: require envutil.

* test/: Don't require envutil in test files.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13 16:05:37 +00:00
hsbt 842e0b05ea * test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
added test for long long [fix GH-716]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-17 02:33:41 +00:00
nobu 065b6d2b7c fiddle/import.rb: fix typo
* ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof): fix typo,
  SIZEOF_LONG_LON.  [Fix GH-714]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-15 00:43:14 +00:00
nobu 03787200af test/dl, test/fiddle: relax criteria
* test/dl/test_{cptr,handle}.rb, test/fiddle/test_{handle,pointer}.rb:
  relax memory leak criteria.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-13 16:18:30 +00:00
nobu dc52725655 envutil.rb: do not check RSS by default
* test/ruby/envutil.rb (Test::Test#assert_no_memory_leak): do not
  check RSS by default, enabled by rss optional keyword argument.
  TestHash#test_exception_in_rehash sometimes fails otherwise.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-11 05:16:04 +00:00
nobu dfdb8b7372 fiddle/function.c: fix memory leak on exception
* ext/fiddle/function.c (function_call): fix memory leak when an
  exception occurs at argument conversion or the function call.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-09 04:51:38 +00:00
nobu cb05f199ee tests for [Bug #9599]
* test/dl/test_{cptr,handle}.rb: tests for [Bug #9599].

* test/fiddle/test_{handle,pointer}.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-09 04:19:10 +00:00
hsbt fa7b849f94 * test/fiddle/test_function.rb: remove unused variables.
* test/fileutils/test_fileutils.rb: ditto.
* test/io/console/test_io_console.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-24 09:12:18 +00:00
naruse 622db848ce same as r44598
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 01:46:03 +00:00
naruse d1bbd80d93 same as r44597
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15 01:43:29 +00:00
kosaki 1a0eb89cff * test/dl/test_base.rb: {libc, libm} detection now handle GNU/Hurd
correctly. Patch by Gabriele Giacone (1o5g4r8o@gmail.com).
* test/fiddle/helper.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-28 05:43:50 +00:00
ktsj 9421b18662 * test/fiddle/test_handle.rb (Fiddle::TestHandle#test_static_sym): adjust indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 14:29:05 +00:00
ktsj 1dafd4ebf1 * test/fiddle/test_c_struct_entry.rb,
test/fiddle/test_c_union_entity.rb,
  test/fiddle/test_cparser.rb, test/fiddle/test_func.rb,
  test/fiddle/test_handle.rb, test/fiddle/test_import.rb,
  test/fiddle/test_pointer.rb: don't run test if the system
  don't support fiddle.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 14:29:02 +00:00
nagachika c7d7ff45f1 * ext/dl/lib/dl/func.rb (DL::Function#call): check tainted when
$SAFE > 0.
* ext/fiddle/function.c (function_call): check tainted when $SAFE > 0.
* test/fiddle/test_func.rb (module Fiddle): add test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 11:06:58 +00:00
naruse 3ae53e4943 Fix if-end
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11 07:53:26 +00:00
naruse 91fe36e99a Experimental fix for ffi_closure_free causes dumping core/SEGV
http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20130411T041301Z.log.html.gz#test%2F-ext-

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11 06:35:43 +00:00
akr b7d8d0321c * test/fiddle/helper.rb: specify libc and libm locations for MirOS BSD.
* test/dl/test_base.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-08 16:27:17 +00:00
kou 8346f7b2ad * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
CPtr -> Pointer.
* test/fiddle/test_c_struct_entry.rb
  (Fiddle::TestCStructEntity#test_aref_pointer):
  Added the test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21 14:16:02 +00:00
kou e852838cee * ext/fiddle/lib/fiddle/struct.rb (Fiddle::CStructEntity#set_ctypes):
CPtr -> Pointer.
* test/fiddle/test_c_struct_entry.rb
  (Fiddle::TestCStructEntity#test_aref_pointer_array):
  Added the test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21 14:12:57 +00:00
kou 3fed8bc9a5 * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof):
CPtr -> Pointer.
* test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
  Added the test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21 13:44:44 +00:00
ngoto 3e6a624a83 * ext/fiddle/function.c (Fiddle::Function.new): new keyword argument :name to set the name attribute.
* ext/fiddle/lib/fiddle/import.rb (import_function, bind_function): set function name by using the :name keyword argument.
  Re-fixes r38243. [ruby-core:50566]
* test/fiddle/test_function.rb (test_name): test for the :name keyword argument and Fiddle::Function#name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-11 10:41:00 +00:00
tenderlove 0713f89944 * ext/fiddle/fiddle.c: adding alignment constants for compatibility
with DL.
* ext/fiddle/fiddle.h: ditto
* ext/fiddle/lib/fiddle/cparser.rb: importing the C parser for DL
  backwards compatibility.
* ext/fiddle/lib/fiddle/import.rb: importing the import DSL for DL
  backwards compatibility.
* ext/fiddle/lib/fiddle/pack.rb: importing structure pack for DL
  backwards compatibility.
* ext/fiddle/lib/fiddle/value.rb: ditto
* ext/fiddle/lib/fiddle/struct.rb: importing struct DSL for DL backwards
  compatibility.
* test/dl/test_c_struct_entry.rb: importing tests
* test/dl/test_c_union_entity.rb: ditto
* test/dl/test_cparser.rb: ditto
* test/dl/test_import.rb: ditto
* test/fiddle/test_c_struct_entry.rb: ditto
* test/fiddle/test_c_union_entity.rb: ditto
* test/fiddle/test_cparser.rb: ditto
* test/fiddle/test_import.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28 00:02:49 +00:00
tenderlove c1fb6a82dc * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handle
to Fiddle::Handle.
* ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
  DL::Pointer to Fiddle::Pointer.
* test/fiddle/test_func.rb: relevent tests
* test/fiddle/test_handle.rb: ditto
* test/fiddle/test_pointer.rb: ditto
* ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
* ext/fiddle/extconf.rb: check for dlfcn.h
* ext/fiddle/fiddle.c: add constants for sizeof() things
* ext/fiddle/fiddle.h: include dlfcn.h
* ext/fiddle/function.c: expose a C function for creating new
  Fiddle::Function objects.
* ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
* ext/fiddle/lib/fiddle/function.rb: read the pointer from the
  function for dl backwards compat.
* test/dl/test_callback.rb: check the addresses of the pointers rather
  than their types.
* test/fiddle/helper.rb: remove dependency on dl
* test/fiddle/test_closure.rb: ditto
* test/fiddle/test_fiddle.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 19:54:50 +00:00
tenderlove 1eac1cb21e reverting r37881
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 05:59:34 +00:00
tenderlove ab2a7a9346 * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handle
to Fiddle::Handle.
* ext/fiddle/pointer.c: Make Fiddle independent of DL, copy
  DL::Pointer to Fiddle::Pointer.
* test/fiddle/test_func.rb: relevent tests
* test/fiddle/test_handle.rb: ditto
* test/fiddle/test_pointer.rb: ditto
* ext/dl/lib/dl/struct.rb: use Fiddle::Pointer if available
* ext/fiddle/extconf.rb: check for dlfcn.h
* ext/fiddle/fiddle.c: add constants for sizeof() things
* ext/fiddle/fiddle.h: include dlfcn.h
* ext/fiddle/function.c: expose a C function for creating new
  Fiddle::Function objects.
* ext/fiddle/lib/fiddle.rb: include constants for dl backwards compat
* ext/fiddle/lib/fiddle/function.rb: read the pointer from the
  function for dl backwards compat.
* test/dl/test_callback.rb: check the addresses of the pointers rather
  than their types.
* test/fiddle/helper.rb: remove dependency on dl
* test/fiddle/test_closure.rb: ditto
* test/fiddle/test_fiddle.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 01:38:41 +00:00
nobu b4288080e7 * ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_t
and intptr_t.  [ruby-core:42460][Feature #5992]
* ext/fiddle/fiddle.c (Init_fiddle): ditto.
* ext/dl/lib/dl/cparser.rb (DL::CParser#parse_ctype): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 05:47:16 +00:00
nobu fa65df0d08 * ext/fiddle/closure.c (callback): same as r34506.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 10:52:31 +00:00
ngoto 321be14fe7 * test/fiddle/helper.rb (libc_so, libm_so): Solaris support added.
* test/dl/test_base.rb (libc_so, libm_so): on Solaris, remove libc
  and libm version numbers for detecting default libc and libm.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-09 03:36:18 +00:00
usa dd4dca8f06 * test/dl/test_base.rb (Fiddle::LIBC_SO): its always msvc*.dll on
mswin/mingw.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-12 05:51:55 +00:00
kosaki 99ef86707c * test/fiddle/test_fiddle.rb: Don't run test if the system don't support
fiddle.

	* test/fiddle/test_function.rb: ditto.
	* test/fiddle/test_closure.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-23 13:20:58 +00:00
tenderlove 5c99ee83ad * ext/fiddle/extconf.rb: check for windows.h while building fiddle.
Thanks Jon Forums! [ruby-core:33923]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-27 19:34:00 +00:00
nobu 6c416e96f0 * test/fiddle/test_closure.rb (test_memsize): test for r29635.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-30 00:09:42 +00:00
kanemoto 6ef6cbc4f6 Creating dummy library for dl/fiddle tests on AIX.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-26 01:16:53 +00:00
tenderlove 4bada8b864 * ext/fiddle/*: Adding fiddle library to wrap libffi
* test/fiddle/*: testing fiddle extension
* ext/dl/lib/dl.rb: Requiring fiddle if it is available
* ext/dl/lib/dl/callback.rb: using Fiddle if it is available
* ext/dl/lib/dl/func.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-06 06:59:24 +00:00