[OCaml] Fix the wrapmacro test

Add a typecheck typemap for size_t and const size_t &.

Add the const qualifier to the typemaps for primitive reference
types.

Add multiple runtime tests.
This commit is contained in:
Zackery Spytz 2019-02-17 01:41:59 -07:00
commit 10d62aecd5
10 changed files with 58 additions and 10 deletions

View file

@ -1,13 +1,13 @@
/* File : example.i */
%module example
%typemap(argout) (int &x, int &y) {
%typemap(argout) (const int &x, const int &y) {
swig_result = caml_list_append(swig_result, caml_val_int(*$1));
swig_result = caml_list_append(swig_result, caml_val_int(*$2));
}
%{
extern "C" void factor(int &x, int &y);
extern "C" void factor(const int &x, const int &y);
%}
extern "C" void factor(int &x, int &y);
extern "C" void factor(const int &x, const int &y);