aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-05-07 00:11:58 -0500
committerGanesh Viswanathan <dev@genotrance.com>2019-05-07 00:11:58 -0500
commit62f5dc121b6b66b6e80500ce044666ae4b11d7c6 (patch)
treebbb03e245f43e9901d3e31386e8757d9e8d847f0
parentd21ec6287be4882d14332c14bb302b50f1296c22 (diff)
downloadnimterop-62f5dc121b6b66b6e80500ce044666ae4b11d7c6.tar.gz
nimterop-62f5dc121b6b66b6e80500ce044666ae4b11d7c6.zip
Test case for enum identifer or'd
-rw-r--r--tests/include/test.h6
-rw-r--r--tests/tnimterop_c.nim5
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/include/test.h b/tests/include/test.h
index eb36650..8138e54 100644
--- a/tests/include/test.h
+++ b/tests/include/test.h
@@ -49,7 +49,9 @@ enum ENUM {
typedef enum {
enum4 = 3,
enum5,
- enum6
+ enum6,
+ enum6a = enum5 & enum6,
+ enum6b = enum5 | enum6
} ENUM2;
enum {
@@ -149,4 +151,4 @@ typedef struct dstruct2 {
#ifdef __cplusplus
}
-#endif \ No newline at end of file
+#endif
diff --git a/tests/tnimterop_c.nim b/tests/tnimterop_c.nim
index 3fc33b9..01fa70b 100644
--- a/tests/tnimterop_c.nim
+++ b/tests/tnimterop_c.nim
@@ -116,6 +116,9 @@ else:
check test_call9() == nil
+check enum6a == 4
+check enum6b == 5
+
check e3 == enum7
check e4 == enum11
@@ -160,4 +163,4 @@ di = addr iptr
ds.field1 = di
ds2.field1 = addr cstr
ds2.tcv = test_call10
-check ds2.tcv(di) == nil \ No newline at end of file
+check ds2.tcv(di) == nil