1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
Aaron Patterson 5c0d8c6369
[ruby/fiddle] Add "offsetof" to Struct classes (https://github.com/ruby/fiddle/pull/83)
* Add "offsetof" to Struct classes

I need to get the offset of a member inside a struct without allocating
the struct.  This patch adds an "offsetof" class method to structs that
are generated.

The usage is like this:

```ruby
MyStruct = struct [
  "int64_t i",
  "char c",
]

MyStruct.offsetof("i") # => 0
MyStruct.offsetof("c") # => 8
```

* Update test/fiddle/test_c_struct_builder.rb

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>

https://github.com/ruby/fiddle/commit/4e3b60c5b6

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2021-07-13 19:37:46 +09:00
..
-ext- Add basic test for updated IO wait functions. 2021-06-29 23:54:41 +12:00
base64
benchmark
bigdecimal
cgi
coverage Check type of instruction - can be INSN or ADJUST 2021-06-23 11:34:37 -07:00
csv
date [ruby/date] Fix comparison with Float::INFINITY 2021-07-11 20:28:21 +09:00
did_you_mean Use assert_not_match "Did you mean?" for UncorrectableNameCheckTest 2021-06-29 15:49:51 +09:00
digest
drb
dtrace
erb
error_highlight [ruby/error_highlight] Support a file that has no final newline 2021-07-13 16:54:17 +09:00
etc
excludes
fiber Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
fiddle [ruby/fiddle] Add "offsetof" to Struct classes (https://github.com/ruby/fiddle/pull/83) 2021-07-13 19:37:46 +09:00
fileutils
fixtures/fake_sorted_set_gem
io
irb [ruby/irb] Show LANG and LC_ALL env by irb_info 2021-07-11 06:12:07 +09:00
json
lib
logger
mkmf mkmf.rb: try linking at try_var 2021-07-08 18:18:35 +09:00
monitor Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
net
nkf
objspace
open-uri
openssl
optparse
ostruct [lib/ostruct] Fix YAML test 2021-06-14 12:28:53 -04:00
pathname
psych [ruby/psych] Fix the test that does not work with libyaml-0.1.7 2021-06-08 08:12:27 +09:00
racc [ruby/racc] Stop compressing integer lists 2021-06-25 17:23:06 +09:00
rdoc [ruby/rdoc] Fix links without paths 2021-07-05 11:34:37 +09:00
readline Remove half-defined Reline on LoadError 2021-07-10 21:02:50 +09:00
reline Revert "Revert "[ruby/reline] Fix failed test"" 2021-06-25 18:56:46 +09:00
resolv
rinda
ripper
ruby Split test of Hash.[] and add assertion for default value/proc 2021-07-08 16:47:30 +09:00
rubygems Sync RubyGems and Bundler with upstream 2021-07-07 15:31:52 +09:00
socket
stringio
strscan
syslog
uri
win32ole
yaml Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
zlib
runner.rb
test_abbrev.rb
test_delegate.rb
test_extlibs.rb
test_find.rb
test_forwardable.rb
test_ipaddr.rb
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb
test_prettyprint.rb
test_pstore.rb Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
test_pty.rb
test_rbconfig.rb
test_securerandom.rb
test_set.rb
test_shellwords.rb
test_singleton.rb
test_sorted_set.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_trick.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb