aboutsummaryrefslogtreecommitdiff
path: root/tests/embind/embind_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/embind/embind_test.cpp')
-rw-r--r--tests/embind/embind_test.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index e9feccfe..156c8680 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -758,6 +758,14 @@ struct StructVector {
float x, y, z;
};
+float readStructVectorZ(const StructVector& v) {
+ return v.z;
+}
+
+void writeStructVectorZ(StructVector& v, float z) {
+ v.z = z;
+}
+
StructVector emval_test_return_StructVector() {
StructVector v;
v.x = 1;
@@ -1354,7 +1362,7 @@ EMSCRIPTEN_BINDINGS(tests) {
value_struct<StructVector>("StructVector")
.field("x", &StructVector::x)
.field("y", &StructVector::y)
- .field("z", &StructVector::z)
+ .field("z", &readStructVectorZ, &writeStructVectorZ)
;
function("emval_test_return_StructVector", &emval_test_return_StructVector);