-
Notifications
You must be signed in to change notification settings - Fork 7
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
Test types that use native.CArray #90
Conversation
@@ -10,5 +11,9 @@ object StructTests extends TestSuite { | |||
assert(point.x == 10) | |||
assert(point.y == 20) | |||
} | |||
|
|||
'bigStructSize - { | |||
assert(Struct.getBigStructSize() == sizeof[Struct.struct_bigStruct]) |
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.
👍
@@ -13,6 +13,8 @@ object UnionTests extends TestSuite { | |||
assert(!structPtr.i == 10) | |||
Union.setLongValue(structPtr) | |||
assert(!structPtr.l == 10000000000L) |
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.
Just noticed that the name could be better: unionPtr
@@ -13,6 +13,8 @@ object UnionTests extends TestSuite { | |||
assert(!structPtr.i == 10) | |||
Union.setLongValue(structPtr) | |||
assert(!structPtr.l == 10000000000L) | |||
|
|||
assert(Union.getUnionSize() == sizeof[Union.union_values]) |
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.
Let's put it in a separate test case.
@@ -8,7 +8,9 @@ import scala.scalanative.native._ | |||
object Struct { | |||
type struct_point = native.CStruct2[native.CInt, native.CInt] | |||
type point_s = native.Ptr[struct_point] | |||
type struct_bigStruct = native.CArray[Byte, native.Nat.Digit[native.Nat._1, native.Nat.Digit[native.Nat._1, native.Nat._2]]] |
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.
Interesting, so this doesn't the helper with getters and setters. We should probably create a ticket for that.
d7f7bad
to
11a0a59
Compare
Found this issue #91 // ...
!anonymousStruct._1 = 'a'
val array = anonymousStruct.cast[Ptr[CArray[Byte, Nat._8]]]
!structWithAnonymousStruct._2 = !array |
Closes #89