aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-07-29 23:24:03 -0500
committerGanesh Viswanathan <dev@genotrance.com>2019-07-29 23:24:03 -0500
commit29f59eee99f72b9a7a2dde1e6fc22ff3c943f440 (patch)
tree6914a6d8473318d16b2ac33a10fea7dd96a837a8 /tests
parente159eb7c9c996d62eecdea4fb989e09566d8dfad (diff)
downloadnimterop-29f59eee99f72b9a7a2dde1e6fc22ff3c943f440.tar.gz
nimterop-29f59eee99f72b9a7a2dde1e6fc22ff3c943f440.zip
Fix #131 - division in enums
Diffstat (limited to 'tests')
-rw-r--r--tests/include/test.h10
-rw-r--r--tests/tnimterop_c.nim6
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/include/test.h b/tests/include/test.h
index 91bfd75..cb4dd59 100644
--- a/tests/include/test.h
+++ b/tests/include/test.h
@@ -156,6 +156,16 @@ typedef struct dstruct2 {
void **(*tcv)(int **param1);
} DSTRUCT2;
+// Issue #131
+enum
+{
+ TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024,
+ TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10,
+ TDEFL_BOGUS_1 = (1024 * 128) / TDEFL_LZ_CODE_BUF_SIZE,
+ TDEFL_BOGUS_2 = TDEFL_LZ_CODE_BUF_SIZE / 64,
+ TDEFL_BOGUS_3 = TDEFL_OUT_BUF_SIZE / TDEFL_BOGUS_1
+};
+
#ifdef __cplusplus
}
#endif
diff --git a/tests/tnimterop_c.nim b/tests/tnimterop_c.nim
index 9f37141..1c30387 100644
--- a/tests/tnimterop_c.nim
+++ b/tests/tnimterop_c.nim
@@ -172,3 +172,9 @@ ds.field1 = di
ds2.field1 = addr cstr
ds2.tcv = test_call10
check ds2.tcv(di) == nil
+
+# Issue #131
+check TDEFL_OUT_BUF_SIZE == 85196
+check TDEFL_BOGUS_1 == 2
+check TDEFL_BOGUS_2 == 1024
+check TDEFL_BOGUS_3 == (85196 / 2).int