Skip to content
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

Add support for byte[] properties #567

Merged
merged 5 commits into from
May 31, 2016
Merged

Add support for byte[] properties #567

merged 5 commits into from
May 31, 2016

Conversation

fealebenpae
Copy link
Member

@fealebenpae fealebenpae commented May 27, 2016

Implements #510


public IEnumerable<object[]> SetAndReplaceWithNullCases()
{
yield return new object[] { "NullableCharProperty", '0' };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like copy and paste error - shouldn't these all be null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test first sets the property to a non-null value and asserts the getter returns the value, and then sets the property to null and asserts that the getter returns null.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, yup noted it now.

@AndyDentFree
Copy link
Contributor

👍

if (buffer.Length == 0)
{
// see RealmObject.SetByteArrayValue
NativeQuery.binary_equal(queryHandle, columnIndex, (IntPtr)0x1, IntPtr.Zero);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm bothered by this 0x1 magic value being repeated as a literal. Does it have significance and, if so, could it be a constant?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it just has to be anything but zero, as long as the length is zero. Seeing as how it's a dummy value I wouldn't bother with a constant.

@AndyDentFree
Copy link
Contributor

👍 with the added check for empty byte arrays!

@kristiandupont
Copy link
Contributor

👍

@fealebenpae fealebenpae merged commit 866c2e6 into master May 31, 2016
@fealebenpae fealebenpae deleted the yg/binary-columns branch May 31, 2016 09:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants