aboutsummaryrefslogtreecommitdiffstats
path: root/test/dl
Commit message (Collapse)AuthorAgeFilesLines
* test/dl, test/fiddle: relax criterianobu2014-03-132-2/+2
| | | | | | | * 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
* envutil.rb: do not check RSS by defaultnobu2014-03-112-2/+2
| | | | | | | | * 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
* tests for [Bug #9599]nobu2014-03-092-0/+8
| | | | | | | | * 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
* Use assert_separately to speed upnaruse2014-03-021-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* same as r44598naruse2014-01-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* /usr/lib/libc.so is not symlink on FreeBSD 10naruse2014-01-151-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_base.rb: {libc, libm} detection now handle GNU/Hurdkosaki2013-09-281-0/+3
| | | | | | | 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
* * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo2013-06-121-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_base.rb: typo.usa2013-04-111-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Experimental fix for ffi_closure_free causes dumping core/SEGVnaruse2013-04-111-0/+5
| | | | | | 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
* * test/fiddle/helper.rb: specify libc and libm locations for MirOS BSD.akr2013-02-081-0/+3
| | | | | | | | * test/dl/test_base.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_func.rb (test_name_with_block, test_bind, test_qsort1): call ↵ngoto2012-12-111-19/+31
| | | | | | unbind to release the callback closure because maximum number of callbacks is limited to DL::MAX_CALLBACK (== 5) with pure DL without Fiddle. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/func.rb (DL::Function#unbind, #bound?): suppress ↵ngoto2012-12-111-0/+43
| | | | | | | | | NoMethodError when Fiddle is available. [ruby-core:50756] [Bug #7543] * test/dl/test_func.rb (test_bound*, test_unbind*): tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/func.rb (DL::Function#bind): When Fiddle is used,ngoto2012-12-051-0/+8
| | | | | | | | | @ptr should be updated. This fixes SEGV raised in DL::Function#call after calling DL::Function#bind. [Bug #7516] [ruby-dev:46708] * test/dl/test_func.rb (test_bind): test for the above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/func.rb (DL::Function#initialize, DL::Function#bind):ngoto2012-12-051-0/+6
| | | | | | | | | | | | | ABI should be set by using CFunc#calltype even when Fiddle is used. When Fiddle is used and a block is given, name shoud not be ignored. [ruby-core:50562] [Bug #7514] * ext/dl/lib/dl/import.rb (DL::Importer#bind_function): should respect abi and name when Fiddle is used. * test/dl/test_func.rb (test_name_with_block): test for "name" method with giving a block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warnings: unused variablesnaruse2012-11-302-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use RUBYOPT to overwrite original RUBYOPT ENVnaruse2012-11-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* assert_in_out_err with block ignores test_stdoutkazu2012-11-301-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Refix r38002: capture_subprocess_io also doesn't forknaruse2012-11-301-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use capture_subprocess_io instead of capture_io. fix r38002naruse2012-11-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Run another process to avoid failure when objspace is already loadednaruse2012-11-291-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/dl: no warningsnobu2012-11-292-2/+4
| | | | | | | * test/dl/test_base.rb, test/dl/test_c_struct_entry.rb: deprecation warnings make no sense here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/fiddle/fiddle.c: adding alignment constants for compatibilitytenderlove2012-11-284-61/+63
| | | | | | | | | | | | | | | | | | | | | | | | 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
* * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handletenderlove2012-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* reverting r37881tenderlove2012-11-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/fiddle/handle.c: Make Fiddle independent of DL, copy DL::Handletenderlove2012-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* * ruby.c (load_file_internal): set default source encoding asnaruse2012-11-061-0/+1
| | | | | | | | | UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679] * parse.y (parser_initialize): set default parser encoding as UTF-8 instead of US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/struct.rb: fix strange require order. [ruby-dev:45702]tenderlove2012-10-302-4/+0
| | | | | | | | | | | * ext/dl/lib/dl/value.rb: ditto * test/dl/test_c_struct_entry.rb: remove strange require order from tests. * test/dl/test_c_union_entity.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_func.rb (test_qsort1, test_qsort2): use TYPE_SIZE_Tngoto2012-06-131-2/+2
| | | | | | | for size_t variables. [ruby-dev:45733] [Bug #6584] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_c_{struct_entry,union_entity}.rb: sorry, typos.usa2012-06-062-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_c_{struct,union}_entity.rb: broken require.usa2012-06-042-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/struct.rb (DL::CStructEntity#set_ctypes): Refactoreddrbrain2012-05-311-0/+12
| | | | | | | | | | | #set_ctypes using newer ruby features to simplify its implementation. * test/dl/test_c_struct_entry.rb (class DL): Test to verify refactoring. Reviewed by Aaron Patterson. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_c_struct_entry.rb: Removed duplicated testdrbrain2012-05-311-5/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/struct.rb (DL::CStructEntity::size): Refactored ::sizedrbrain2012-05-311-0/+46
| | | | | | | | | | to remove unused variables and simplify using newer ruby features. * test/dl/test_c_struct_entry.rb: Test to validate refactoring Reviewed by Aaron Patterson git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/struct.rb (DL::CUnionEntity#set_ctypes): Refactoreddrbrain2012-05-301-0/+12
| | | | | | | | | | #set_types to reuse DL::CUnionEntity::size * test/dl/test_c_union_entity.rb: Added test Reviewed by Aaron Paterson git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/struct.rb (DL::CUnionEntity::size): Fixed ::size todrbrain2012-05-301-0/+18
| | | | | | | | | | return the size of the union. * test/dl/test_c_union_entity.rb: Test for DL::CUnionEntity::size Reviewed by Aaron Patterson git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/dl.c (Init_dl): support intrinsic types, size_t, ptrdiff_tnobu2012-02-252-0/+32
| | | | | | | | 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
* * test/dl/test_callback.rb (test_callback_with_string): preventsnagachika2011-08-301-2/+5
| | | | | | temporary string from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/fiddle/helper.rb (libc_so, libm_so): Solaris support added.ngoto2011-08-091-2/+2
| | | | | | | | * 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
* * ext/dl/cptr.c (rb_dlptr_aref, rb_dlptr_aset): check NULL pointernobu2011-07-281-0/+6
| | | | | | dereference. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/cfunc.c (dlcfunc_mark), ext/dl/cptr.c (dlptr_mark):nobu2011-07-271-0/+5
| | | | | | | workaround to mark wrapped object. this is not a true fix, because [Bug #4929] is caused by the interface design of DL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add test for r32586.naruse2011-07-201-0/+11
| | | | | | | | | | FreeBSD (at least 7.2 to 7.2) calls nsdispatch(3) when it calls getaddrinfo(3). And nsdispatch(3) doesn't call dlerror(3) even if it calls _nss_cache_cycle_prevention_function with dlsym(3). So our DL::Handle#sym must call dlerror(3) before call dlsym. In general uses of dlerror(3) should call it before use it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2011-05-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_base.rb (DL::LIBC_SO): its always msvc*.dll onusa2011-04-281-1/+1
| | | | | | | mswin/mingw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_process.rb (TestProcess#test_no_curdir): skip silently onusa2011-03-251-3/+2
| | | | | | | | | | | | | | | | | Windows, because this tests a platform specific feature and it'll never be supported on ruby on Windows. * test/ruby/test_dir_m17n.rb (TestDir_M17N#test_filename_extutf8_invalid, TestDir_M17N#test_filename_as_bytes_extutf8): ditto. * test/open-uri/test_open-uri.rb (TestOpenURI#test_find_proxy_case_sensitive_env): ditto. * test/dl/test_handle.rb (DL::TestHandle#test_NEXT, DL::TestHandle#test_DEFAULT): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/dl/test_dl2.rb (TestDL#test_sin): math functions do notnobu2011-01-302-0/+3
| | | | | | | work on x86_64 due to the design of DL2. * test/dl/test_func.rb (DL::TestFunc#test_{sinf,sin): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Creating dummy library for dl/fiddle tests on AIX.kanemoto2010-08-261-0/+28
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* forgot to commit the assert_match()tenderlove2010-07-051-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/import.rb (handler): add a more helpful error messagetenderlove2010-07-051-0/+9
| | | | | | | when calling import_symbol or import_function without calling dlload. Thanks nobu! [ruby-core:30996] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/func.rb (call): don't overwrite original argumentstarui2010-06-251-0/+12
| | | | | | | | to defend from GC. * test/dl/test_func.rb (test_string): add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e