-
Notifications
You must be signed in to change notification settings - Fork 746
tests: Add an integration test for static arrays. #457
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
let also_expected = unsafe { bindings::Test_COUNTDOWN_PTR }; | ||
assert!(!test.is_null()); | ||
assert_eq!(also_expected, expected, "Pointer value was bogus"); | ||
assert_eq!(test, also_expected, "Array value was bogus"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Assertion diagnostic messages should describe expectations, not explain what happens when things go wrong. Expectations read fine whether the assertion is passing (ie when I happen to be reading this code) or when it is printed out because of assertion failure. What is written here only reads OK if the assertion is failing.
Here is my suggested wording:
bindings::Test_COUNTDOWN.as_ptr() should be the same as bindings::Test_countdown()
but in this particular case, I think the default assert_eq message should be fine.
Turns out they were broken before rust-lang#456. Let's test it so it doesn't regress.
These aren't extremely great, since this usually requires extra bookkeeping. But C allows it, so let's keep the same semantics.
@bors-servo r=fitzgen Thanks for the review Nick :) |
📌 Commit fedca48 has been approved by |
☀️ Test successful - status-travis |
Turns out they were broken before
#456.
Let's test it so it doesn't regress.
r? @fitzgen