aboutsummaryrefslogtreecommitdiff
path: root/tests/embind/embind_test.cpp
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-12-05 18:12:06 -0800
committerBruce Mitchener <bruce.mitchener@gmail.com>2014-02-04 16:19:50 +0700
commitb09a5551ea298d0d8d95946a7131df342362ea51 (patch)
tree685d229644dcad45c80469c736876baab87768b9 /tests/embind/embind_test.cpp
parentdd8b8e71bfc4aff36909eab7cc23c03907f02ef1 (diff)
Add a test to verify we can use static constants defined in classes.
Diffstat (limited to 'tests/embind/embind_test.cpp')
-rw-r--r--tests/embind/embind_test.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 4cf12615..508fe052 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -2215,8 +2215,20 @@ EMSCRIPTEN_BINDINGS(read_only_properties) {
;
}
+struct StaticConstIntStruct {
+ static const int STATIC_CONST_INTEGER_VALUE_1;
+ static const int STATIC_CONST_INTEGER_VALUE_1000;
+};
+
+const int StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1 = 1;
+const int StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1000 = 1000;
+
EMSCRIPTEN_BINDINGS(constants) {
constant("INT_CONSTANT", 10);
+
+ constant("STATIC_CONST_INTEGER_VALUE_1", StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1);
+ constant("STATIC_CONST_INTEGER_VALUE_1000", StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1000);
+
constant("STRING_CONSTANT", std::string("some string"));
TupleVector tv(1, 2, 3, 4);