aboutsummaryrefslogtreecommitdiff
path: root/tests/include
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2018-11-20 03:01:04 -0600
committerGanesh Viswanathan <dev@genotrance.com>2018-11-20 03:01:04 -0600
commit9787797d15d281ce1dd792d247fac043c72dc769 (patch)
tree6588ca41871c8dc8ed2782898f4b52605fae2f61 /tests/include
downloadnimterop-9787797d15d281ce1dd792d247fac043c72dc769.tar.gz
nimterop-9787797d15d281ce1dd792d247fac043c72dc769.zip
Initial version
Diffstat (limited to 'tests/include')
-rw-r--r--tests/include/test.c33
-rw-r--r--tests/include/test.h36
2 files changed, 69 insertions, 0 deletions
diff --git a/tests/include/test.c b/tests/include/test.c
new file mode 100644
index 0000000..8d801b7
--- /dev/null
+++ b/tests/include/test.c
@@ -0,0 +1,33 @@
+#include "test.h"
+
+int test_call_int() {
+ return 5;
+}
+
+struct STRUCT1 test_call_int_param(int param1) {
+ struct STRUCT1 s;
+
+ s.field1 = param1;
+
+ return s;
+}
+
+STRUCT2 test_call_int_param2(int param1, STRUCT2 param2) {
+ STRUCT2 s;
+
+ s.field1 = param1 + param2.field1;
+
+ return s;
+}
+
+STRUCT2 test_call_int_param3(int param1, struct STRUCT1 param2) {
+ STRUCT2 s;
+
+ s.field1 = param1 + param2.field1;
+
+ return s;
+}
+
+ENUM2 test_call_int_param4(enum ENUM param1) {
+ return enum4;
+} \ No newline at end of file
diff --git a/tests/include/test.h b/tests/include/test.h
new file mode 100644
index 0000000..60d1660
--- /dev/null
+++ b/tests/include/test.h
@@ -0,0 +1,36 @@
+#include <stdint.h>
+
+#define TEST_INT 512
+#define TEST_FLOAT 5.12
+#define TEST_HEX 0x512
+
+typedef uint8_t PRIMTYPE;
+typedef PRIMTYPE CUSTTYPE;
+
+struct STRUCT1 {
+ int field1;
+};
+
+typedef struct STRUCT1 STRUCT2;
+
+typedef struct {
+ int field1;
+} STRUCT3;
+
+enum ENUM {
+ enum1,
+ enum2,
+ enum3
+};
+
+typedef enum {
+ enum4 = 3,
+ enum5,
+ enum6
+} ENUM2;
+
+int test_call_int();
+struct STRUCT1 test_call_int_param(int param1);
+STRUCT2 test_call_int_param2(int param1, STRUCT2 param2);
+STRUCT2 test_call_int_param3(int param1, struct STRUCT1 param2);
+ENUM2 test_call_int_param4(enum ENUM param1); \ No newline at end of file