-
Notifications
You must be signed in to change notification settings - Fork 47
Make pointer size consistent between backends #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,9 @@ def test_to_str | |
|
|
||
| ptr[5] = 0 | ||
| assert_equal "hello\0world", ptr.to_str | ||
|
|
||
| ptr.size = 0 | ||
| assert_equal "", ptr.to_str | ||
| end | ||
|
|
||
| def test_to_s | ||
|
|
@@ -93,6 +96,9 @@ def test_to_s | |
| ptr[5] = 0 | ||
| assert_equal 'hello', ptr.to_s | ||
| assert_equal "hello\0", ptr.to_s(6) | ||
|
|
||
| ptr.size = 0 | ||
| assert_equal "hello", ptr.to_s | ||
|
Comment on lines
+100
to
+101
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this this, why does
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the current behavior of CRuby, so the PR mirrors it. |
||
| end | ||
|
|
||
| def test_minus | ||
|
|
@@ -256,6 +262,8 @@ def test_size | |
| Pointer.malloc(4, Fiddle::RUBY_FREE) do |ptr| | ||
| assert_equal 4, ptr.size | ||
| end | ||
| assert_equal 0, Pointer.new(0).size | ||
| assert_equal 0, Pointer.new(0).ref.size | ||
| end | ||
|
|
||
| def test_size= | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.